aboutsummaryrefslogtreecommitdiffhomepage
path: root/amd64/emit.c
diff options
context:
space:
mode:
author lemon<lsof@mailbox.org>2025-10-25 17:35:13 +0200
committer lemon<lsof@mailbox.org>2025-10-25 17:35:13 +0200
commitf307f4dbb08f57f814c0482802c5b7f807f8c666 (patch)
tree6cfdfb26ed121e0e921e788ce612b3d5ce052395 /amd64/emit.c
parentdacc801be75fa716b240a0c36d33db1d1cb06b58 (diff)
amd64: add/sub operands less restrictive
Diffstat (limited to 'amd64/emit.c')
-rw-r--r--amd64/emit.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/amd64/emit.c b/amd64/emit.c
index 7ee1f93..ab82a91 100644
--- a/amd64/emit.c
+++ b/amd64/emit.c
@@ -951,7 +951,7 @@ emitinstr(uchar **pcode, struct function *fn, struct block *blk, int curi, struc
if (kisflt(cls)) {
Xaddf(pcode, cls, dst, mkimmdatregoper(ins->r));
} else if (ins->reg-1 == dst.reg) { /* two-address add */
- Xadd(pcode, cls, dst, mkimmdatregoper(ins->r));
+ Xadd(pcode, cls, dst, ref2oper(ins->r));
} else if (isregref(ins->r) && ins->reg-1 == mkregoper(ins->r).reg) {
/* also two-address after swapping operands */
Xadd(pcode, cls, reg2oper(ins->reg-1), mkimmdatregoper(ins->l));
@@ -968,7 +968,7 @@ emitinstr(uchar **pcode, struct function *fn, struct block *blk, int curi, struc
if (kisflt(cls)) {
Xsubf(pcode, cls, dst, mkimmdatregoper(ins->r));
} else if (ins->reg-1 == dst.reg) { /* two-address */
- Xsub(pcode, cls, dst, mkimmdatregoper(ins->r));
+ Xsub(pcode, cls, dst, ref2oper(ins->r));
} else {
assert(isintcon(ins->r));
Xlea(pcode, cls, reg2oper(ins->reg-1),