aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main/stanza/passes.stanza9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/main/stanza/passes.stanza b/src/main/stanza/passes.stanza
index 873b03b4..2cd884b8 100644
--- a/src/main/stanza/passes.stanza
+++ b/src/main/stanza/passes.stanza
@@ -1934,11 +1934,11 @@ 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) " " width(e)], top)
+ emit-all(["rsh'" prim-width(type(e)) " " value(e) " 0"], top)
(e:Register) :
emit-all(["reg'" prim-width(type(e)) " 1 " value(e)], top) ;; enable(e)
(e:ReadPort) :
- emit-all(["rd'" prim-width(type(e)) " " enable(e) " " mem(e) " " index(e)], top)
+ emit-all(["rd'" prim-width(type(e)) " " "1" " " mem(e) " " index(e)], top) ;; enable(e)
(e:DoPrim) :
if cmp-op?(op(e)) :
emit-all([flo-op-name(op(e)) "'" prim-width(type(args(e)[0]))], top)
@@ -1963,8 +1963,7 @@ defn emit! (e:Expression,top:Symbol) :
print(" ")
emit!(arg, top)
for const in consts(e) do :
- print(" ")
- print(const)
+ print-all([" " const "'" sizeof(const)])
(e) : error("SHOULDN'T EMIT THIS") ;; print-all(["EMIT(" e ")"])
;(e) : emit-all(["mov'" prim-width(type(e)) " " e], top) ;TODO, not sure which one is right
@@ -1989,7 +1988,7 @@ defn emit-s (s:Stmt, v:List<Symbol>, top:Symbol) :
if value(s) typeof WritePort :
val e = value(s) as WritePort
val n = gensym(`F)
- emit-all([top "::" n " = wr'" prim-width(type(e)) " " enable(e) " " mem(e) " " index(e) " " name(s) "\n"], top)
+ emit-all([top "::" n " = wr'" prim-width(type(e)) " " enable(e) " " mem(e) " " index(e) " " top "::" name(s) "\n"], top)
else :
emit-all([top "::" name(s) " = " maybe-mov(value(s)) value(s) "\n"], top)
(s:Begin) : do(emit-s{_, v, top}, body(s))