[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 21/25] target/ppc: Fix gen_tlbsx_booke206
From: |
Richard Henderson |
Subject: |
[PATCH v2 21/25] target/ppc: Fix gen_tlbsx_booke206 |
Date: |
Tue, 7 Mar 2023 10:34:59 -0800 |
Fix incorrect read from rD.
Avoid adding 0 when rA == 0.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
Cc: Daniel Henrique Barboza <danielhb413@gmail.com>
Cc: Cédric Le Goater <clg@kaod.org>
Cc: David Gibson <david@gibson.dropbear.id.au>
Cc: Greg Kurz <groug@kaod.org>
Cc: qemu-ppc@nongnu.org
---
target/ppc/translate.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/target/ppc/translate.c b/target/ppc/translate.c
index df324fc7ff..7ec940b7d8 100644
--- a/target/ppc/translate.c
+++ b/target/ppc/translate.c
@@ -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) */
}
--
2.34.1
- Re: [PATCH v2 16/25] target/ppc: Avoid tcg_const_* in xxeval, (continued)
- [PATCH v2 17/25] target/ppc: Avoid tcg_const_* in vsx-impl.c.inc, Richard Henderson, 2023/03/07
- [PATCH v2 18/25] target/ppc: Avoid tcg_const_* in fp-impl.c.inc, Richard Henderson, 2023/03/07
- [PATCH v2 19/25] target/ppc: Avoid tcg_const_* in power8-pmu-regs.c.inc, Richard Henderson, 2023/03/07
- [PATCH v2 21/25] target/ppc: Fix gen_tlbsx_booke206,
Richard Henderson <=
- [PATCH v2 22/25] target/ppc: Avoid tcg_const_* in translate.c, Richard Henderson, 2023/03/07
- [PATCH v2 20/25] target/ppc: Rewrite trans_ADDG6S, Richard Henderson, 2023/03/07
- [PATCH v2 23/25] target/tricore: Use min/max for saturate, Richard Henderson, 2023/03/07
- [PATCH v2 25/25] tcg: Drop tcg_const_*, Richard Henderson, 2023/03/07