diff options
| author | 2025-12-14 21:25:54 +0100 | |
|---|---|---|
| committer | 2025-12-14 21:25:54 +0100 | |
| commit | 0559d1b932bc5614ce4f1f44747b38d03b2fef5b (patch) | |
| tree | 1642adb926910a1015bf4a0bba0fbd3c09d55464 /x86_64 | |
| parent | ce5e09aa4616bcaadccf26129ca2831b0ad8930a (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')
| -rw-r--r-- | x86_64/emit.c | 2 |
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 { |