Skip to contentSkip to conversation

[7094] target-mips: don't map zero register as a TCG global

Qemu-devel Aurelien Jarno 2 participants 3 messages Apr 11, 2009 – Apr 15, 2009

lore
Share & tools
lore
#0 lore raw

Revision: 7094

          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=7094
Author:   aurel32
Date:     2009-04-11 18:43:20 +0000 (Sat, 11 Apr 2009)

Log Message:
-----------
target-mips: don't map zero register as a TCG global

Modified Paths:
--------------
trunk/target-mips/translate.c

Modified: trunk/target-mips/translate.c
===================================================================

target-mips/translate.c +1 -1
@@ -8491,7 +8491,7 @@
         return;
 
     cpu_env = tcg_global_reg_new_ptr(TCG_AREG0, "env");
-    for (i = 0; i < 32; i++)
+    for (i = 1; i < 32; i++)
         cpu_gpr[i] = tcg_global_mem_new(TCG_AREG0,
                                         offsetof(CPUState, active_tc.gpr[i]),
                                         regnames[i]);
#1 lore raw
Quoted 1 line · Aurelien Jarno

target-mips: don't map zero register as a TCG global

Just wondering, would it make some small sense to initialise cpu_gpr[0] to something? For instance:

    TCGV_UNUSED(cpu_gpr[0]);

Cheers,

Signature · 1 line
Stuart Brady
#2 lore raw
Quoted 8 lines · Stuart Brady
Quoted 1 line · Aurelien Jarno

target-mips: don't map zero register as a TCG global

Just wondering, would it make some small sense to initialise cpu_gpr[0] to something? For instance:

    TCGV_UNUSED(cpu_gpr[0]);

I did the change mostly to detect wrong use of this register (like it was before my optimisations commits, hopefully only in read mode). You are right that to correctly detect it, we should use this macro. This is fixed in the SVN.

Signature · 2 lines
Aurelien Jarno	                        GPG: 1024D/F1BCDB73
[email protected]                 http://www.aurel32.net