[6667] Fix mtcrf/mfcr
Revision: 6667
http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=6667 Author: malc Date: 2009-03-02 22:39:39 +0000 (Mon, 02 Mar 2009)
Log Message:
-----------
Fix mtcrf/mfcr
Noticed by Alexander Graf
Modified Paths:
--------------
trunk/target-ppc/translate.c
Modified: trunk/target-ppc/translate.c
===================================================================
target-ppc/translate.c +13 -9
@@ -3843,9 +3843,11 @@if (likely (ctx->opcode &0x00100000 )) { crm =CRM (ctx->opcode); -if (likely ((crm ^ (crm -1 )) ==0 )) { - crn =ffs (crm); +if (likely (crm && ((crm & (crm -1 )) ==0 ))) { + crn =ffs (crm) -1 ;tcg_gen_extu_i32_tl (cpu_gpr[rD (ctx->opcode)], cpu_crf[7 - crn]); +tcg_gen_shli_i32 (cpu_gpr[rD (ctx->opcode)], + cpu_gpr[rD (ctx->opcode)], crn *4 ); } }else {gen_helper_load_cr (cpu_gpr[rD (ctx->opcode)]);
@@ -3935,13 +3937,15 @@uint32_t crm, crn; crm =CRM (ctx->opcode); -if (likely ((ctx->opcode &0x00100000 ) || (crm ^ (crm -1 )) ==0 )) { -TCGv_i32 temp =tcg_temp_new_i32 (); - crn =ffs (crm); -tcg_gen_trunc_tl_i32 (temp, cpu_gpr[rS (ctx->opcode)]); -tcg_gen_shri_i32 (cpu_crf[7 - crn], temp, crn *4 ); -tcg_gen_andi_i32 (cpu_crf[7 - crn], cpu_crf[7 - crn],0xf ); -tcg_temp_free_i32 (temp); +if (likely ((ctx->opcode &0x00100000 ))) { +if (crm && ((crm & (crm -1 )) ==0 )) { +TCGv_i32 temp =tcg_temp_new_i32 (); + crn =ffs (crm) -1 ; +tcg_gen_trunc_tl_i32 (temp, cpu_gpr[rS (ctx->opcode)]); +tcg_gen_shri_i32 (cpu_crf[7 - crn], temp, crn *4 ); +tcg_gen_andi_i32 (cpu_crf[7 - crn], cpu_crf[7 - crn],0xf ); +tcg_temp_free_i32 (temp); + } }else {TCGv_i32 temp =tcg_const_i32 (crm);gen_helper_store_cr (cpu_gpr[rS (ctx->opcode)], temp);
Quoted 5 lines · malc
Modified:
trunk/target-ppc/translate.c
===================================================================target-ppc/translate.c +0
-0@@ -3843,9 +3843,11 @@
...
target-ppc/translate.c line 3850
Quoted 3 lines
tcg_gen_extu_i32_tl(cpu_gpr[rD(ctx->opcode)], cpu_crf[7 - crn]);target-ppc/translate.c +2
-0+tcg_gen_shli_i32 (cpu_gpr[rD (ctx->opcode)], + cpu_gpr[rD (ctx->opcode)], crn *4 );
This breaks compilation of PPC64 targets with DEBUG_TCGV enabled.
Regards,
Signature · 1 line
Stuart Brady
Quoted 7 lines · Stuart Brady
Quoted 5 lines · malc
Modified:
trunk/target-ppc/translate.c
===================================================================target-ppc/translate.c +0
-0@@ -3843,9 +3843,11 @@...
Quoted 6 lines
target-ppc/translate.c line 3850
Quoted 3 lines
tcg_gen_extu_i32_tl(cpu_gpr[rD(ctx->opcode)], cpu_crf[7 - crn]);target-ppc/translate.c +2
-0+tcg_gen_shli_i32 (cpu_gpr[rD (ctx->opcode)], + cpu_gpr[rD (ctx->opcode)], crn *4 );This breaks compilation of PPC64 targets with
DEBUG_TCGVenabled.
That should be fixed in SVN, thanks.
Signature · 2 lines
Aurelien Jarno GPG: 1024D/F1BCDB73 [email protected] http://www.aurel32.net