Skip to contentSkip to conversation

target-ppc: modsw - return 64-bit sign extended

PATCH In review Nikunj A Dadhania 2 participants 4 messages Aug 2, 2016 – Aug 3, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 target-ppc: modsw - return 64-bit sign extended

---

Can be squashed with the original commit

 target-ppc/translate.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
target-ppc/translate.c +1 -1
index fc3d371..dc89e6a 100644
@@ -1243,7 +1243,7 @@ static inline void gen_op_arith_modw(DisasContext *ctx, TCGv ret, TCGv arg1,
         tcg_gen_movi_i32(t3, 0);
         tcg_gen_movcond_i32(TCG_COND_NE, t1, t2, t3, t2, t1);
         tcg_gen_rem_i32(t3, t0, t1);
-        tcg_gen_extu_i32_tl(ret, t3);
+        tcg_gen_ext_i32_tl(ret, t3);
         tcg_temp_free_i32(t2);
         tcg_temp_free_i32(t3);
     } else {
Signature · 1 line
2.7.4
#1 lore raw

PATCH 2/2 target-ppc: cmprb - truncate RA to 8bits

Missed the following bit in the instruction coding.

src1 ← EXTZ(RA(56:63))

---

Can be squashed with the original commit

 target-ppc/translate.c | 1 +
 1 file changed, 1 insertion(+)
target-ppc/translate.c +1 -0
index dc89e6a..14f4b68 100644
@@ -867,6 +867,7 @@ static void gen_cmprb(DisasContext *ctx)
     tcg_gen_trunc_tl_i32(src1, cpu_gpr[rA(ctx->opcode)]);
     tcg_gen_trunc_tl_i32(src2, cpu_gpr[rB(ctx->opcode)]);
 
+    tcg_gen_andi_i32(src1, src1, 0xFF);
     tcg_gen_ext8u_i32(src2lo, src2);
     tcg_gen_shri_i32(src2, src2, 8);
     tcg_gen_ext8u_i32(src2hi, src2);
Signature · 1 line
2.7.4
#3 lore raw
In reply to Nikunj A Dadhania
Quoted 5 lines · Nikunj A Dadhania

---

Can be squashed with the original commit

Done.

Quoted 17 lines
 target-ppc/translate.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
target-ppc/translate.c +1 -1
index fc3d371..dc89e6a 100644
@@ -1243,7 +1243,7 @@ static inline void gen_op_arith_modw(DisasContext *ctx, TCGv ret, TCGv arg1,
         tcg_gen_movi_i32(t3, 0);
         tcg_gen_movcond_i32(TCG_COND_NE, t1, t2, t3, t2, t1);
         tcg_gen_rem_i32(t3, t0, t1);
-        tcg_gen_extu_i32_tl(ret, t3);
+        tcg_gen_ext_i32_tl(ret, t3);
         tcg_temp_free_i32(t2);
         tcg_temp_free_i32(t3);
     } else {
Signature · 4 lines
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson
#2 lore raw

Re: [Qemu-devel] [PATCH v1 2/2] target-ppc: cmprb - truncate RA to 8bits

In reply to Nikunj A Dadhania
Quoted 9 lines · Nikunj A Dadhania

Missed the following bit in the instruction coding.

src1 ← EXTZ(RA(56:63))

---

Can be squashed with the original commit

Done.

Quoted 16 lines
 target-ppc/translate.c | 1 +
 1 file changed, 1 insertion(+)
target-ppc/translate.c +1 -0
index dc89e6a..14f4b68 100644
@@ -867,6 +867,7 @@ static void gen_cmprb(DisasContext *ctx)
     tcg_gen_trunc_tl_i32(src1, cpu_gpr[rA(ctx->opcode)]);
     tcg_gen_trunc_tl_i32(src2, cpu_gpr[rB(ctx->opcode)]);
 
+    tcg_gen_andi_i32(src1, src1, 0xFF);
     tcg_gen_ext8u_i32(src2lo, src2);
     tcg_gen_shri_i32(src2, src2, 8);
     tcg_gen_ext8u_i32(src2hi, src2);
Signature · 4 lines
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson