summaryrefslogtreecommitdiff
path: root/emit.fun
diff options
context:
space:
mode:
Diffstat (limited to 'emit.fun')
-rw-r--r--emit.fun20
1 files changed, 10 insertions, 10 deletions
diff --git a/emit.fun b/emit.fun
index 6b8ceb2..90cbaa2 100644
--- a/emit.fun
+++ b/emit.fun
@@ -200,12 +200,12 @@ functor Emit(I: IL) = struct
val p = SpOrd (ord c)
val l = collectStr cs []
in
- if null acc then l else SpStr (implode $ rev acc) :: p :: l
+ if null acc then p :: l else SpStr (implode $ rev acc) :: p :: l
end
| collectStr [] acc =
if null acc then [] else [SpStr (implode $ rev acc)]
- fun printPart (SpStr s) out = Printf out `"'" `s `"'" %
+ fun printPart (SpStr s) out = Printf out `"\"" `s `"\"" %
| printPart (SpOrd v) out = Printf out I v %
fun printStr [] = ()
@@ -1496,19 +1496,19 @@ functor Emit(I: IL) = struct
val () = assertSize is81 is82 is83
- val (first, second) =
- case (t2, t3) of
- (VtReg _ | VtStack _, _) => (t3, t2)
- | (_, VtReg _ | VtStack _) => (t2, t3)
- | (_, _) => raise Unreachable
+ val (pre, right) =
+ case t3 of
+ VtReg _ | VtStack _ => ([], t3)
+ | VtConst c => ([movRV is81 Rcx c], VtReg Rcx)
+ | VtUnk => raise Unreachable
in
- [
+ pre @ [
+ mov is81 (VtReg Rax) t2,
if signExtend then
if is81 then "cqo" else "cdq"
else
"xor edx, edx",
- mov is81 (VtReg Rax) first,
- sprintf `op' `" " A2 prm is81 second %,
+ sprintf `op' `" " A2 prm is81 right %,
mov is81 t1 (VtReg resInReg)
]
end