diff options
Diffstat (limited to 'src/main')
| -rw-r--r-- | src/main/stanza/passes.stanza | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/main/stanza/passes.stanza b/src/main/stanza/passes.stanza index 835a032e..131f0a7b 100644 --- a/src/main/stanza/passes.stanza +++ b/src/main/stanza/passes.stanza @@ -1882,10 +1882,10 @@ defn flo-op-name (op:PrimOp) -> String : EQUAL-SS-OP : "eq" MUX-UU-OP : "mux" MUX-SS-OP : "mux" - PAD-U-OP : "rsh" ;; todo: signed version - PAD-S-OP : "rsh" ;; todo: signed version - NEG-U-OP : "neg" - NEG-S-OP : "neg" + PAD-U-OP : "rsh" + PAD-S-OP : "arsh" + NEG-U-OP : "neg" + NEG-S-OP : "neg" ;AS-UINT-U-OP : ;AS-UINT-S-OP : ;AS-SINT-U-OP : @@ -1904,6 +1904,9 @@ defn flo-op-name (op:PrimOp) -> String : BIT-NOT-OP : "not" BIT-OR-OP : "or" BIT-XOR-OP : "xor" + BIT-XOR-REDUCE-OP : "xorr" + BIT-AND-REDUCE-OP : "andr" + BIT-OR-REDUCE-OP : "orr" CONCAT-OP : "cat" BIT-SELECT-OP : "rsh" BITS-SELECT-OP : "rsh" @@ -1952,7 +1955,10 @@ defn emit! (e:Expression,top:Symbol) : (e:Subfield) : emit-all([exp(e) "/" name(e)], top) (e:Index) : emit-all([exp(e) "/" value(e)], top) (e:Pad) : - emit-all(["rsh'" prim-width(type(e)) " " value(e) " 0"], top) + val op-name = match(type(e)) : + (t:SIntType) : "arsh" + (u) : "rsh" + emit-all([op-name "'" prim-width(type(e)) " " value(e) " 0"], top) (e:Register) : emit-all(["reg'" prim-width(type(e)) " " enable(e) " " value(e)], top) (e:ReadPort) : |
