aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main/stanza/passes.stanza13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/main/stanza/passes.stanza b/src/main/stanza/passes.stanza
index b5c3b22c..d04f7366 100644
--- a/src/main/stanza/passes.stanza
+++ b/src/main/stanza/passes.stanza
@@ -1854,10 +1854,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 :
@@ -1927,7 +1927,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) :