]> git.proxmox.com Git - mirror_qemu.git/commitdiff
target/ppc: Fix gen_tlbsx_booke206
authorRichard Henderson <richard.henderson@linaro.org>
Sun, 26 Feb 2023 19:08:09 +0000 (09:08 -1000)
committerRichard Henderson <richard.henderson@linaro.org>
Mon, 13 Mar 2023 14:03:39 +0000 (07:03 -0700)
Fix incorrect read from rD.
Avoid adding 0 when rA == 0.

Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
target/ppc/translate.c

index df324fc7ffd1151f7cc1c95e154f070fb8e211e8..7ec940b7d8042573222c61aa54057ae0642f355d 100644 (file)
@@ -5875,12 +5875,10 @@ static void gen_tlbsx_booke206(DisasContext *ctx)
     CHK_SV(ctx);
     if (rA(ctx->opcode)) {
         t0 = tcg_temp_new();
-        tcg_gen_mov_tl(t0, cpu_gpr[rD(ctx->opcode)]);
+        tcg_gen_add_tl(t0, cpu_gpr[rA(ctx->opcode)], cpu_gpr[rB(ctx->opcode)]);
     } else {
-        t0 = tcg_const_tl(0);
+        t0 = cpu_gpr[rB(ctx->opcode)];
     }
-
-    tcg_gen_add_tl(t0, t0, cpu_gpr[rB(ctx->opcode)]);
     gen_helper_booke206_tlbsx(cpu_env, t0);
 #endif /* defined(CONFIG_USER_ONLY) */
 }