aboutsummaryrefslogtreecommitdiffhomepage
path: root/x86_64/emit.c
diff options
context:
space:
mode:
author lemon<lsof@mailbox.org>2025-12-14 21:25:54 +0100
committer lemon<lsof@mailbox.org>2025-12-14 21:25:54 +0100
commit0559d1b932bc5614ce4f1f44747b38d03b2fef5b (patch)
tree1642adb926910a1015bf4a0bba0fbd3c09d55464 /x86_64/emit.c
parentce5e09aa4616bcaadccf26129ca2831b0ad8930a (diff)
x86_64/emit: handle pseudo subtraction used for cmp
Isel had this forever, but the matching code for it in emit wasn't there
Diffstat (limited to 'x86_64/emit.c')
-rw-r--r--x86_64/emit.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/x86_64/emit.c b/x86_64/emit.c
index 6e832a4..3c72712 100644
--- a/x86_64/emit.c
+++ b/x86_64/emit.c
@@ -1034,6 +1034,8 @@ emitinstr(uchar **pcode, struct function *fn, struct block *blk, int curi, struc
dst = mkregoper(ins->l);
if (kisflt(cls)) {
Xsubf(pcode, cls, dst, mkimmdatregoper(ins->r));
+ } else if (!ins->reg) {
+ Xcmp(pcode, cls, mkregoper(ins->l), mkimmdatregoper(ins->r));
} else if (ins->reg-1 == dst.reg) { /* two-address */
Xsub(pcode, cls, dst, ref2oper(ins->r));
} else {