From f25ab2fdef20db0d495840144b468304efffdf67 Mon Sep 17 00:00:00 2001 From: Mikulas Patocka Date: Sun, 20 Oct 2024 17:44:55 +0200 Subject: [PATCH] power: use 32-bit multiplication --- c2-power.inc | 2 +- codegen.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/c2-power.inc b/c2-power.inc index 1a94372..dffa095 100644 --- a/c2-power.inc +++ b/c2-power.inc @@ -1061,7 +1061,7 @@ static bool attr_w cgen_insn(struct codegen_context *ctx, uint32_t insn) return true; case INSN_ALU: case INSN_ALU_FLAGS: - if (unlikely(insn_op_size(insn) != OP_SIZE_NATIVE) && (insn_aux(insn) < ALU_UDIV || insn_aux(insn) > ALU_SREM)) + if (unlikely(insn_op_size(insn) != OP_SIZE_NATIVE) && !((insn_aux(insn) >= ALU_UDIV && insn_aux(insn) <= ALU_SREM) || insn_aux(insn) == ALU_MUL)) goto invalid_insn; g(cgen_alu(ctx, insn_op_size(insn), insn_aux(insn), insn_writes_flags(insn))); return true; diff --git a/codegen.c b/codegen.c index 012c678..15c62e6 100644 --- a/codegen.c +++ b/codegen.c @@ -4353,10 +4353,10 @@ do_multiply: { } #endif #if defined(ARCH_POWER) - if (mode == MODE_INT && op_size == OP_SIZE_NATIVE) { + if (mode == MODE_INT && op_size >= OP_SIZE_4) { target = gen_frame_target(ctx, slot_r, slot_1, slot_2, R_SCRATCH_1); - g(gen_frame_get(ctx, op_size, sign_x, slot_1, 0, R_SCRATCH_1, ®1)); - g(gen_frame_get(ctx, op_size, sign_x, slot_2, 0, R_SCRATCH_2, ®2)); + g(gen_frame_get(ctx, op_size, garbage, slot_1, 0, R_SCRATCH_1, ®1)); + g(gen_frame_get(ctx, op_size, garbage, slot_2, 0, R_SCRATCH_2, ®2)); g(gen_3address_alu(ctx, op_size, ALU_MUL, target, reg1, reg2, 1)); -- 2.11.4.GIT