From 5fe155a88907cf09e316f6eb6df2c781e49c6e74 Mon Sep 17 00:00:00 2001 From: lemon Date: Mon, 13 Oct 2025 22:19:25 +0200 Subject: amd64: mul -> imul --- amd64/emit.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'amd64/emit.c') diff --git a/amd64/emit.c b/amd64/emit.c index 739e89d..490f21f 100644 --- a/amd64/emit.c +++ b/amd64/emit.c @@ -615,18 +615,18 @@ DEFINSTR2(Xtest, ) DEFINSTR2(Ximul2, - {4|8, PGPR, PGPR, "\x0F\xAF", EN_RR}, /* MUL r32/64, r32/64 */ - {4|8, PGPR, PMEM, "\x0F\xAF", EN_RM}, /* MUL r32/64, m32/64 */ + {4|8, PGPR, PGPR, "\x0F\xAF", EN_RR}, /* IMUL r32/64, r32/64 */ + {4|8, PGPR, PMEM, "\x0F\xAF", EN_RM}, /* IMUL r32/64, m32/64 */ ) static void -Xmul(uchar **pcode, enum irclass k, struct oper dst, struct oper s1, struct oper s2) +Ximul(uchar **pcode, enum irclass k, struct oper dst, struct oper s1, struct oper s2) { static const struct desc imm8tab[] = { - {4|8, PGPR, PGPR, "\x6B", EN_RR}, /* MUL r32/64, r32/64, (imm8) */ - {4|8, PGPR, PMEM, "\x6B", EN_RM}, /* MUL r32/64, m32/64, (imm8) */ + {4|8, PGPR, PGPR, "\x6B", EN_RR}, /* IMUL r32/64, r32/64, (imm8) */ + {4|8, PGPR, PMEM, "\x6B", EN_RM}, /* IMUL r32/64, m32/64, (imm8) */ }, imm32tab[] = { - {4|8, PGPR, PGPR, "\x69", EN_RR}, /* MUL r32/64, r32/64, (imm32) */ - {4|8, PGPR, PMEM, "\x69", EN_RM}, /* MUL r32/64, m32/64, (imm32) */ + {4|8, PGPR, PGPR, "\x69", EN_RR}, /* IMUL r32/64, r32/64, (imm32) */ + {4|8, PGPR, PMEM, "\x69", EN_RM}, /* IMUL r32/64, m32/64, (imm32) */ }; if (!memcmp(&dst, &s1, sizeof dst) && s2.t != OIMM) { Ximul2(pcode, k, dst, s2); @@ -930,7 +930,8 @@ emitinstr(uchar **pcode, struct function *fn, struct block *blk, int curi, struc break; case Omul: if (kisint(cls)) - Xmul(pcode, cls, reg2oper(ins->reg-1), ref2oper(ins->l), ref2oper(ins->r)); + case Oumul: + Ximul(pcode, cls, reg2oper(ins->reg-1), ref2oper(ins->l), ref2oper(ins->r)); else Xmulf(pcode, cls, reg2oper(ins->reg-1), ref2oper(ins->r)); break; -- cgit v1.2.3