]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
target/mips: Simplify Loongson MULTU.G opcode
authorPhilippe Mathieu-Daudé <philmd@linaro.org>
Thu, 31 Aug 2023 20:06:57 +0000 (22:06 +0200)
committerPhilippe Mathieu-Daudé <philmd@linaro.org>
Sun, 3 Nov 2024 08:49:12 +0000 (05:49 -0300)
Since MULTU opcodes don't record the most significant bits
of the infinite result, sign-extending the sources make no
difference in the result.

Once we remove the sign extension of source registers, MULT
and MULTU are identical (as are DMULT and DMULTU).

Suggested-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20241026175349.84523-3-philmd@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
target/mips/tcg/translate.c

index 6c881af561859dc09eae367d84f66523587222b5..6d7e913263e55f6ed86288295359a6d7598e5977 100644 (file)
@@ -3615,8 +3615,6 @@ static void gen_loongson_integer(DisasContext *ctx, uint32_t opc,
         break;
     case OPC_MULTU_G_2E:
     case OPC_MULTU_G_2F:
-        tcg_gen_ext32u_tl(t0, t0);
-        tcg_gen_ext32u_tl(t1, t1);
         tcg_gen_mul_tl(cpu_gpr[rd], t0, t1);
         tcg_gen_ext32s_tl(cpu_gpr[rd], cpu_gpr[rd]);
         break;