From 0559d1b932bc5614ce4f1f44747b38d03b2fef5b Mon Sep 17 00:00:00 2001 From: lemon Date: Sun, 14 Dec 2025 21:25:54 +0100 Subject: x86_64/emit: handle pseudo subtraction used for cmp Isel had this forever, but the matching code for it in emit wasn't there --- x86_64/emit.c | 2 ++ 1 file changed, 2 insertions(+) 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 { -- cgit v1.2.3