Skip to contentSkip to conversation

target-ppc: fix nego and subf*o instructions

PATCH Applied Aurelien Jarno 3 participants 3 messages Apr 1, 2013 – Apr 2, 2013

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 target-ppc: fix nego and subf*o instructions

The overflow computation of nego and subf*o instructions has been broken in commit ffe30937. Contrary to other targets, the instruction is subtract from an not subtract on PowerPC.

This patch fixes the issue by using the correct argument in the xor computation. Thanks to Peter Maydell for the hint.

With this change the PPC emulation passes the Gwenole Beauchesne testsuite again.

Cc Alexander Graf <[email protected]>
Cc Richard Henderson <[email protected]>
---
 target-ppc/translate.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
target-ppc/translate.c +1 -1
index 5e741d1..294ab58 100644
@@ -746,7 +746,7 @@ static inline void gen_op_arith_compute_ov(DisasContext *ctx, TCGv arg0,
 {
     TCGv t0 = tcg_temp_new();
 
-    tcg_gen_xor_tl(cpu_ov, arg0, arg1);
+    tcg_gen_xor_tl(cpu_ov, arg0, arg2);
     tcg_gen_xor_tl(t0, arg1, arg2);
     if (sub) {
         tcg_gen_and_tl(cpu_ov, cpu_ov, t0);
Signature · 1 line
1.7.10.4
Reviewed-by on v2 1/1
#1 lore raw
Quoted 10 lines · Aurelien Jarno

The overflow computation of nego and subf*o instructions has been broken in commit ffe30937. Contrary to other targets, the instruction is subtract from an not subtract on PowerPC.

This patch fixes the issue by using the correct argument in the xor computation. Thanks to Peter Maydell for the hint.

With this change the PPC emulation passes the Gwenole Beauchesne testsuite again.

Quoted 6 lines
Cc Alexander Graf <[email protected]>
Cc Richard Henderson <[email protected]>
---
 target-ppc/translate.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

r~

#2 lore raw
In reply to Aurelien Jarno
Quoted 7 lines · Aurelien Jarno

The overflow computation of nego and subf*o instructions has been broken in commit ffe30937. Contrary to other targets, the instruction is subtract from an not subtract on PowerPC.

This patch fixes the issue by using the correct argument in the xor computation. Thanks to Peter Maydell for the hint.

Quoted 6 lines

With this change the PPC emulation passes the Gwenole Beauchesne testsuite again.

Cc Alexander Graf <[email protected]>
Cc Richard Henderson <[email protected]>

Thanks, applied to ppc-next.

Alex