diff mbox series

[v2,23/76] target/microblaze: Rename env_* tcg variables to cpu_*

Message ID 20200828141929.77854-24-richard.henderson@linaro.org
State Superseded
Headers show
Series target/microblaze improvements | expand

Commit Message

Richard Henderson Aug. 28, 2020, 2:18 p.m. UTC
This is cpu_imm, cpu_btaken, cpu_iflags, cpu_res_addr and cpu_res_val.
It is standard for these file-scope globals to begin with cpu_*.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

---
 target/microblaze/translate.c | 54 +++++++++++++++++------------------
 1 file changed, 27 insertions(+), 27 deletions(-)

-- 
2.25.1

Comments

Philippe Mathieu-Daudé Aug. 31, 2020, 9:11 p.m. UTC | #1
Le ven. 28 août 2020 16:36, Richard Henderson <richard.henderson@linaro.org>
a écrit :

> This is cpu_imm, cpu_btaken, cpu_iflags, cpu_res_addr and cpu_res_val.

> It is standard for these file-scope globals to begin with cpu_*.

>

> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

>


Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>


---
>  target/microblaze/translate.c | 54 +++++++++++++++++------------------

>  1 file changed, 27 insertions(+), 27 deletions(-)

>

> diff --git a/target/microblaze/translate.c b/target/microblaze/translate.c

> index ecfa6b86a4..9aa63ddcc5 100644

> --- a/target/microblaze/translate.c

> +++ b/target/microblaze/translate.c

> @@ -56,12 +56,12 @@

>  static TCGv_i32 cpu_R[32];

>  static TCGv_i32 cpu_pc;

>  static TCGv_i32 cpu_msr;

> -static TCGv_i32 env_imm;

> -static TCGv_i32 env_btaken;

> +static TCGv_i32 cpu_imm;

> +static TCGv_i32 cpu_btaken;

>  static TCGv_i32 cpu_btarget;

> -static TCGv_i32 env_iflags;

> -static TCGv env_res_addr;

> -static TCGv_i32 env_res_val;

> +static TCGv_i32 cpu_iflags;

> +static TCGv cpu_res_addr;

> +static TCGv_i32 cpu_res_val;

>

>  #include "exec/gen-icount.h"

>

> @@ -107,7 +107,7 @@ static inline void t_sync_flags(DisasContext *dc)

>  {

>      /* Synch the tb dependent flags between translator and runtime.  */

>      if (dc->tb_flags != dc->synced_flags) {

> -        tcg_gen_movi_i32(env_iflags, dc->tb_flags);

> +        tcg_gen_movi_i32(cpu_iflags, dc->tb_flags);

>          dc->synced_flags = dc->tb_flags;

>      }

>  }

> @@ -222,10 +222,10 @@ static inline TCGv_i32 *dec_alu_op_b(DisasContext

> *dc)

>  {

>      if (dc->type_b) {

>          if (dc->tb_flags & IMM_FLAG)

> -            tcg_gen_ori_i32(env_imm, env_imm, dc->imm);

> +            tcg_gen_ori_i32(cpu_imm, cpu_imm, dc->imm);

>          else

> -            tcg_gen_movi_i32(env_imm, (int32_t)((int16_t)dc->imm));

> -        return &env_imm;

> +            tcg_gen_movi_i32(cpu_imm, (int32_t)((int16_t)dc->imm));

> +        return &cpu_imm;

>      } else

>          return &cpu_R[dc->rb];

>  }

> @@ -859,7 +859,7 @@ static inline void sync_jmpstate(DisasContext *dc)

>  {

>      if (dc->jmp == JMP_DIRECT || dc->jmp == JMP_DIRECT_CC) {

>          if (dc->jmp == JMP_DIRECT) {

> -            tcg_gen_movi_i32(env_btaken, 1);

> +            tcg_gen_movi_i32(cpu_btaken, 1);

>          }

>          dc->jmp = JMP_INDIRECT;

>          tcg_gen_movi_i32(cpu_btarget, dc->jmp_pc);

> @@ -869,7 +869,7 @@ static inline void sync_jmpstate(DisasContext *dc)

>  static void dec_imm(DisasContext *dc)

>  {

>      LOG_DIS("imm %x\n", dc->imm << 16);

> -    tcg_gen_movi_i32(env_imm, (dc->imm << 16));

> +    tcg_gen_movi_i32(cpu_imm, (dc->imm << 16));

>      dc->tb_flags |= IMM_FLAG;

>      dc->clear_imm = 0;

>  }

> @@ -1040,8 +1040,8 @@ static void dec_load(DisasContext *dc)

>      }

>

>      if (ex) {

> -        tcg_gen_mov_tl(env_res_addr, addr);

> -        tcg_gen_mov_i32(env_res_val, v);

> +        tcg_gen_mov_tl(cpu_res_addr, addr);

> +        tcg_gen_mov_i32(cpu_res_val, v);

>      }

>      if (dc->rd) {

>          tcg_gen_mov_i32(cpu_R[dc->rd], v);

> @@ -1103,7 +1103,7 @@ static void dec_store(DisasContext *dc)

>

>          write_carryi(dc, 1);

>          swx_skip = gen_new_label();

> -        tcg_gen_brcond_tl(TCG_COND_NE, env_res_addr, addr, swx_skip);

> +        tcg_gen_brcond_tl(TCG_COND_NE, cpu_res_addr, addr, swx_skip);

>

>          /*

>           * Compare the value loaded at lwx with current contents of

> @@ -1111,11 +1111,11 @@ static void dec_store(DisasContext *dc)

>           */

>          tval = tcg_temp_new_i32();

>

> -        tcg_gen_atomic_cmpxchg_i32(tval, addr, env_res_val,

> +        tcg_gen_atomic_cmpxchg_i32(tval, addr, cpu_res_val,

>                                     cpu_R[dc->rd], mem_index,

>                                     mop);

>

> -        tcg_gen_brcond_i32(TCG_COND_NE, env_res_val, tval, swx_skip);

> +        tcg_gen_brcond_i32(TCG_COND_NE, cpu_res_val, tval, swx_skip);

>          write_carryi(dc, 0);

>          tcg_temp_free_i32(tval);

>      }

> @@ -1204,7 +1204,7 @@ static void eval_cond_jmp(DisasContext *dc, TCGv_i32

> pc_true, TCGv_i32 pc_false)

>      TCGv_i32 zero = tcg_const_i32(0);

>

>      tcg_gen_movcond_i32(TCG_COND_NE, cpu_pc,

> -                        env_btaken, zero,

> +                        cpu_btaken, zero,

>                          pc_true, pc_false);

>

>      tcg_temp_free_i32(zero);

> @@ -1245,7 +1245,7 @@ static void dec_bcc(DisasContext *dc)

>          dc->jmp = JMP_INDIRECT;

>          tcg_gen_addi_i32(cpu_btarget, *dec_alu_op_b(dc), dc->pc);

>      }

> -    eval_cc(dc, cc, env_btaken, cpu_R[dc->ra]);

> +    eval_cc(dc, cc, cpu_btaken, cpu_R[dc->ra]);

>  }

>

>  static void dec_br(DisasContext *dc)

> @@ -1311,7 +1311,7 @@ static void dec_br(DisasContext *dc)

>

>      dc->jmp = JMP_INDIRECT;

>      if (abs) {

> -        tcg_gen_movi_i32(env_btaken, 1);

> +        tcg_gen_movi_i32(cpu_btaken, 1);

>          tcg_gen_mov_i32(cpu_btarget, *(dec_alu_op_b(dc)));

>          if (link && !dslot) {

>              if (!(dc->tb_flags & IMM_FLAG) &&

> @@ -1330,7 +1330,7 @@ static void dec_br(DisasContext *dc)

>              dc->jmp = JMP_DIRECT;

>              dc->jmp_pc = dc->pc + (int32_t)((int16_t)dc->imm);

>          } else {

> -            tcg_gen_movi_i32(env_btaken, 1);

> +            tcg_gen_movi_i32(cpu_btaken, 1);

>              tcg_gen_addi_i32(cpu_btarget, *dec_alu_op_b(dc), dc->pc);

>          }

>      }

> @@ -1419,7 +1419,7 @@ static void dec_rts(DisasContext *dc)

>          LOG_DIS("rts ir=%x\n", dc->ir);

>

>      dc->jmp = JMP_INDIRECT;

> -    tcg_gen_movi_i32(env_btaken, 1);

> +    tcg_gen_movi_i32(cpu_btaken, 1);

>      tcg_gen_add_i32(cpu_btarget, cpu_R[dc->ra], *dec_alu_op_b(dc));

>  }

>

> @@ -1722,7 +1722,7 @@ void gen_intermediate_code(CPUState *cs,

> TranslationBlock *tb, int max_insns)

>                      TCGLabel *l1 = gen_new_label();

>                      t_sync_flags(dc);

>                      /* Conditional jmp.  */

> -                    tcg_gen_brcondi_i32(TCG_COND_NE, env_btaken, 0, l1);

> +                    tcg_gen_brcondi_i32(TCG_COND_NE, cpu_btaken, 0, l1);

>                      gen_goto_tb(dc, 1, dc->pc);

>                      gen_set_label(l1);

>                      gen_goto_tb(dc, 0, dc->jmp_pc);

> @@ -1848,22 +1848,22 @@ void mb_tcg_init(void)

>  {

>      int i;

>

> -    env_iflags = tcg_global_mem_new_i32(cpu_env,

> +    cpu_iflags = tcg_global_mem_new_i32(cpu_env,

>                      offsetof(CPUMBState, iflags),

>                      "iflags");

> -    env_imm = tcg_global_mem_new_i32(cpu_env,

> +    cpu_imm = tcg_global_mem_new_i32(cpu_env,

>                      offsetof(CPUMBState, imm),

>                      "imm");

>      cpu_btarget = tcg_global_mem_new_i32(cpu_env,

>                       offsetof(CPUMBState, btarget),

>                       "btarget");

> -    env_btaken = tcg_global_mem_new_i32(cpu_env,

> +    cpu_btaken = tcg_global_mem_new_i32(cpu_env,

>                       offsetof(CPUMBState, btaken),

>                       "btaken");

> -    env_res_addr = tcg_global_mem_new(cpu_env,

> +    cpu_res_addr = tcg_global_mem_new(cpu_env,

>                       offsetof(CPUMBState, res_addr),

>                       "res_addr");

> -    env_res_val = tcg_global_mem_new_i32(cpu_env,

> +    cpu_res_val = tcg_global_mem_new_i32(cpu_env,

>                       offsetof(CPUMBState, res_val),

>                       "res_val");

>      for (i = 0; i < ARRAY_SIZE(cpu_R); i++) {

> --

> 2.25.1

>

>

>
<div dir="auto"><div><br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le ven. 28 août 2020 16:36, Richard Henderson &lt;<a href="mailto:richard.henderson@linaro.org">richard.henderson@linaro.org</a>&gt; a écrit :<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">This is cpu_imm, cpu_btaken, cpu_iflags, cpu_res_addr and cpu_res_val.<br>
It is standard for these file-scope globals to begin with cpu_*.<br>
<br>
Signed-off-by: Richard Henderson &lt;<a href="mailto:richard.henderson@linaro.org" target="_blank" rel="noreferrer">richard.henderson@linaro.org</a>&gt;<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto"><span style="font-family:sans-serif;font-size:13.696px">Reviewed-by: Philippe Mathieu-Daudé &lt;</span><a href="mailto:f4bug@amsat.org" style="text-decoration:none;color:rgb(66,133,244);font-family:sans-serif;font-size:13.696px">f4bug@amsat.org</a><span style="font-family:sans-serif;font-size:13.696px">&gt;</span><br></div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

---<br>
 target/microblaze/translate.c | 54 +++++++++++++++++------------------<br>
 1 file changed, 27 insertions(+), 27 deletions(-)<br>
<br>
diff --git a/target/microblaze/translate.c b/target/microblaze/translate.c<br>
index ecfa6b86a4..9aa63ddcc5 100644<br>
--- a/target/microblaze/translate.c<br>
+++ b/target/microblaze/translate.c<br>
@@ -56,12 +56,12 @@<br>
 static TCGv_i32 cpu_R[32];<br>
 static TCGv_i32 cpu_pc;<br>
 static TCGv_i32 cpu_msr;<br>
-static TCGv_i32 env_imm;<br>
-static TCGv_i32 env_btaken;<br>
+static TCGv_i32 cpu_imm;<br>
+static TCGv_i32 cpu_btaken;<br>
 static TCGv_i32 cpu_btarget;<br>
-static TCGv_i32 env_iflags;<br>
-static TCGv env_res_addr;<br>
-static TCGv_i32 env_res_val;<br>
+static TCGv_i32 cpu_iflags;<br>
+static TCGv cpu_res_addr;<br>
+static TCGv_i32 cpu_res_val;<br>
<br>
 #include &quot;exec/gen-icount.h&quot;<br>
<br>
@@ -107,7 +107,7 @@ static inline void t_sync_flags(DisasContext *dc)<br>
 {<br>
     /* Synch the tb dependent flags between translator and runtime.  */<br>
     if (dc-&gt;tb_flags != dc-&gt;synced_flags) {<br>
-        tcg_gen_movi_i32(env_iflags, dc-&gt;tb_flags);<br>
+        tcg_gen_movi_i32(cpu_iflags, dc-&gt;tb_flags);<br>
         dc-&gt;synced_flags = dc-&gt;tb_flags;<br>
     }<br>
 }<br>
@@ -222,10 +222,10 @@ static inline TCGv_i32 *dec_alu_op_b(DisasContext *dc)<br>
 {<br>
     if (dc-&gt;type_b) {<br>
         if (dc-&gt;tb_flags &amp; IMM_FLAG)<br>
-            tcg_gen_ori_i32(env_imm, env_imm, dc-&gt;imm);<br>
+            tcg_gen_ori_i32(cpu_imm, cpu_imm, dc-&gt;imm);<br>
         else<br>
-            tcg_gen_movi_i32(env_imm, (int32_t)((int16_t)dc-&gt;imm));<br>
-        return &amp;env_imm;<br>
+            tcg_gen_movi_i32(cpu_imm, (int32_t)((int16_t)dc-&gt;imm));<br>
+        return &amp;cpu_imm;<br>
     } else<br>
         return &amp;cpu_R[dc-&gt;rb];<br>
 }<br>
@@ -859,7 +859,7 @@ static inline void sync_jmpstate(DisasContext *dc)<br>
 {<br>
     if (dc-&gt;jmp == JMP_DIRECT || dc-&gt;jmp == JMP_DIRECT_CC) {<br>
         if (dc-&gt;jmp == JMP_DIRECT) {<br>
-            tcg_gen_movi_i32(env_btaken, 1);<br>
+            tcg_gen_movi_i32(cpu_btaken, 1);<br>
         }<br>
         dc-&gt;jmp = JMP_INDIRECT;<br>
         tcg_gen_movi_i32(cpu_btarget, dc-&gt;jmp_pc);<br>
@@ -869,7 +869,7 @@ static inline void sync_jmpstate(DisasContext *dc)<br>
 static void dec_imm(DisasContext *dc)<br>
 {<br>
     LOG_DIS(&quot;imm %x\n&quot;, dc-&gt;imm &lt;&lt; 16);<br>
-    tcg_gen_movi_i32(env_imm, (dc-&gt;imm &lt;&lt; 16));<br>
+    tcg_gen_movi_i32(cpu_imm, (dc-&gt;imm &lt;&lt; 16));<br>
     dc-&gt;tb_flags |= IMM_FLAG;<br>
     dc-&gt;clear_imm = 0;<br>
 }<br>
@@ -1040,8 +1040,8 @@ static void dec_load(DisasContext *dc)<br>
     }<br>
<br>
     if (ex) {<br>
-        tcg_gen_mov_tl(env_res_addr, addr);<br>
-        tcg_gen_mov_i32(env_res_val, v);<br>
+        tcg_gen_mov_tl(cpu_res_addr, addr);<br>
+        tcg_gen_mov_i32(cpu_res_val, v);<br>
     }<br>
     if (dc-&gt;rd) {<br>
         tcg_gen_mov_i32(cpu_R[dc-&gt;rd], v);<br>
@@ -1103,7 +1103,7 @@ static void dec_store(DisasContext *dc)<br>
<br>
         write_carryi(dc, 1);<br>
         swx_skip = gen_new_label();<br>
-        tcg_gen_brcond_tl(TCG_COND_NE, env_res_addr, addr, swx_skip);<br>
+        tcg_gen_brcond_tl(TCG_COND_NE, cpu_res_addr, addr, swx_skip);<br>
<br>
         /*<br>
          * Compare the value loaded at lwx with current contents of<br>
@@ -1111,11 +1111,11 @@ static void dec_store(DisasContext *dc)<br>
          */<br>
         tval = tcg_temp_new_i32();<br>
<br>
-        tcg_gen_atomic_cmpxchg_i32(tval, addr, env_res_val,<br>
+        tcg_gen_atomic_cmpxchg_i32(tval, addr, cpu_res_val,<br>
                                    cpu_R[dc-&gt;rd], mem_index,<br>
                                    mop);<br>
<br>
-        tcg_gen_brcond_i32(TCG_COND_NE, env_res_val, tval, swx_skip);<br>
+        tcg_gen_brcond_i32(TCG_COND_NE, cpu_res_val, tval, swx_skip);<br>
         write_carryi(dc, 0);<br>
         tcg_temp_free_i32(tval);<br>
     }<br>
@@ -1204,7 +1204,7 @@ static void eval_cond_jmp(DisasContext *dc, TCGv_i32 pc_true, TCGv_i32 pc_false)<br>
     TCGv_i32 zero = tcg_const_i32(0);<br>
<br>
     tcg_gen_movcond_i32(TCG_COND_NE, cpu_pc,<br>
-                        env_btaken, zero,<br>
+                        cpu_btaken, zero,<br>
                         pc_true, pc_false);<br>
<br>
     tcg_temp_free_i32(zero);<br>
@@ -1245,7 +1245,7 @@ static void dec_bcc(DisasContext *dc)<br>
         dc-&gt;jmp = JMP_INDIRECT;<br>
         tcg_gen_addi_i32(cpu_btarget, *dec_alu_op_b(dc), dc-&gt;pc);<br>
     }<br>
-    eval_cc(dc, cc, env_btaken, cpu_R[dc-&gt;ra]);<br>
+    eval_cc(dc, cc, cpu_btaken, cpu_R[dc-&gt;ra]);<br>
 }<br>
<br>
 static void dec_br(DisasContext *dc)<br>
@@ -1311,7 +1311,7 @@ static void dec_br(DisasContext *dc)<br>
<br>
     dc-&gt;jmp = JMP_INDIRECT;<br>
     if (abs) {<br>
-        tcg_gen_movi_i32(env_btaken, 1);<br>
+        tcg_gen_movi_i32(cpu_btaken, 1);<br>
         tcg_gen_mov_i32(cpu_btarget, *(dec_alu_op_b(dc)));<br>
         if (link &amp;&amp; !dslot) {<br>
             if (!(dc-&gt;tb_flags &amp; IMM_FLAG) &amp;&amp;<br>
@@ -1330,7 +1330,7 @@ static void dec_br(DisasContext *dc)<br>
             dc-&gt;jmp = JMP_DIRECT;<br>
             dc-&gt;jmp_pc = dc-&gt;pc + (int32_t)((int16_t)dc-&gt;imm);<br>
         } else {<br>
-            tcg_gen_movi_i32(env_btaken, 1);<br>
+            tcg_gen_movi_i32(cpu_btaken, 1);<br>
             tcg_gen_addi_i32(cpu_btarget, *dec_alu_op_b(dc), dc-&gt;pc);<br>
         }<br>
     }<br>
@@ -1419,7 +1419,7 @@ static void dec_rts(DisasContext *dc)<br>
         LOG_DIS(&quot;rts ir=%x\n&quot;, dc-&gt;ir);<br>
<br>
     dc-&gt;jmp = JMP_INDIRECT;<br>
-    tcg_gen_movi_i32(env_btaken, 1);<br>
+    tcg_gen_movi_i32(cpu_btaken, 1);<br>
     tcg_gen_add_i32(cpu_btarget, cpu_R[dc-&gt;ra], *dec_alu_op_b(dc));<br>
 }<br>
<br>
@@ -1722,7 +1722,7 @@ void gen_intermediate_code(CPUState *cs, TranslationBlock *tb, int max_insns)<br>
                     TCGLabel *l1 = gen_new_label();<br>
                     t_sync_flags(dc);<br>
                     /* Conditional jmp.  */<br>
-                    tcg_gen_brcondi_i32(TCG_COND_NE, env_btaken, 0, l1);<br>
+                    tcg_gen_brcondi_i32(TCG_COND_NE, cpu_btaken, 0, l1);<br>
                     gen_goto_tb(dc, 1, dc-&gt;pc);<br>
                     gen_set_label(l1);<br>
                     gen_goto_tb(dc, 0, dc-&gt;jmp_pc);<br>
@@ -1848,22 +1848,22 @@ void mb_tcg_init(void)<br>
 {<br>
     int i;<br>
<br>
-    env_iflags = tcg_global_mem_new_i32(cpu_env,<br>
+    cpu_iflags = tcg_global_mem_new_i32(cpu_env,<br>
                     offsetof(CPUMBState, iflags),<br>
                     &quot;iflags&quot;);<br>
-    env_imm = tcg_global_mem_new_i32(cpu_env,<br>
+    cpu_imm = tcg_global_mem_new_i32(cpu_env,<br>
                     offsetof(CPUMBState, imm),<br>
                     &quot;imm&quot;);<br>
     cpu_btarget = tcg_global_mem_new_i32(cpu_env,<br>
                      offsetof(CPUMBState, btarget),<br>
                      &quot;btarget&quot;);<br>
-    env_btaken = tcg_global_mem_new_i32(cpu_env,<br>
+    cpu_btaken = tcg_global_mem_new_i32(cpu_env,<br>
                      offsetof(CPUMBState, btaken),<br>
                      &quot;btaken&quot;);<br>
-    env_res_addr = tcg_global_mem_new(cpu_env,<br>
+    cpu_res_addr = tcg_global_mem_new(cpu_env,<br>
                      offsetof(CPUMBState, res_addr),<br>
                      &quot;res_addr&quot;);<br>
-    env_res_val = tcg_global_mem_new_i32(cpu_env,<br>
+    cpu_res_val = tcg_global_mem_new_i32(cpu_env,<br>
                      offsetof(CPUMBState, res_val),<br>
                      &quot;res_val&quot;);<br>
     for (i = 0; i &lt; ARRAY_SIZE(cpu_R); i++) {<br>
-- <br>
2.25.1<br>
<br>
<br>
</blockquote></div></div></div>
diff mbox series

Patch

diff --git a/target/microblaze/translate.c b/target/microblaze/translate.c
index ecfa6b86a4..9aa63ddcc5 100644
--- a/target/microblaze/translate.c
+++ b/target/microblaze/translate.c
@@ -56,12 +56,12 @@ 
 static TCGv_i32 cpu_R[32];
 static TCGv_i32 cpu_pc;
 static TCGv_i32 cpu_msr;
-static TCGv_i32 env_imm;
-static TCGv_i32 env_btaken;
+static TCGv_i32 cpu_imm;
+static TCGv_i32 cpu_btaken;
 static TCGv_i32 cpu_btarget;
-static TCGv_i32 env_iflags;
-static TCGv env_res_addr;
-static TCGv_i32 env_res_val;
+static TCGv_i32 cpu_iflags;
+static TCGv cpu_res_addr;
+static TCGv_i32 cpu_res_val;
 
 #include "exec/gen-icount.h"
 
@@ -107,7 +107,7 @@  static inline void t_sync_flags(DisasContext *dc)
 {
     /* Synch the tb dependent flags between translator and runtime.  */
     if (dc->tb_flags != dc->synced_flags) {
-        tcg_gen_movi_i32(env_iflags, dc->tb_flags);
+        tcg_gen_movi_i32(cpu_iflags, dc->tb_flags);
         dc->synced_flags = dc->tb_flags;
     }
 }
@@ -222,10 +222,10 @@  static inline TCGv_i32 *dec_alu_op_b(DisasContext *dc)
 {
     if (dc->type_b) {
         if (dc->tb_flags & IMM_FLAG)
-            tcg_gen_ori_i32(env_imm, env_imm, dc->imm);
+            tcg_gen_ori_i32(cpu_imm, cpu_imm, dc->imm);
         else
-            tcg_gen_movi_i32(env_imm, (int32_t)((int16_t)dc->imm));
-        return &env_imm;
+            tcg_gen_movi_i32(cpu_imm, (int32_t)((int16_t)dc->imm));
+        return &cpu_imm;
     } else
         return &cpu_R[dc->rb];
 }
@@ -859,7 +859,7 @@  static inline void sync_jmpstate(DisasContext *dc)
 {
     if (dc->jmp == JMP_DIRECT || dc->jmp == JMP_DIRECT_CC) {
         if (dc->jmp == JMP_DIRECT) {
-            tcg_gen_movi_i32(env_btaken, 1);
+            tcg_gen_movi_i32(cpu_btaken, 1);
         }
         dc->jmp = JMP_INDIRECT;
         tcg_gen_movi_i32(cpu_btarget, dc->jmp_pc);
@@ -869,7 +869,7 @@  static inline void sync_jmpstate(DisasContext *dc)
 static void dec_imm(DisasContext *dc)
 {
     LOG_DIS("imm %x\n", dc->imm << 16);
-    tcg_gen_movi_i32(env_imm, (dc->imm << 16));
+    tcg_gen_movi_i32(cpu_imm, (dc->imm << 16));
     dc->tb_flags |= IMM_FLAG;
     dc->clear_imm = 0;
 }
@@ -1040,8 +1040,8 @@  static void dec_load(DisasContext *dc)
     }
 
     if (ex) {
-        tcg_gen_mov_tl(env_res_addr, addr);
-        tcg_gen_mov_i32(env_res_val, v);
+        tcg_gen_mov_tl(cpu_res_addr, addr);
+        tcg_gen_mov_i32(cpu_res_val, v);
     }
     if (dc->rd) {
         tcg_gen_mov_i32(cpu_R[dc->rd], v);
@@ -1103,7 +1103,7 @@  static void dec_store(DisasContext *dc)
 
         write_carryi(dc, 1);
         swx_skip = gen_new_label();
-        tcg_gen_brcond_tl(TCG_COND_NE, env_res_addr, addr, swx_skip);
+        tcg_gen_brcond_tl(TCG_COND_NE, cpu_res_addr, addr, swx_skip);
 
         /*
          * Compare the value loaded at lwx with current contents of
@@ -1111,11 +1111,11 @@  static void dec_store(DisasContext *dc)
          */
         tval = tcg_temp_new_i32();
 
-        tcg_gen_atomic_cmpxchg_i32(tval, addr, env_res_val,
+        tcg_gen_atomic_cmpxchg_i32(tval, addr, cpu_res_val,
                                    cpu_R[dc->rd], mem_index,
                                    mop);
 
-        tcg_gen_brcond_i32(TCG_COND_NE, env_res_val, tval, swx_skip);
+        tcg_gen_brcond_i32(TCG_COND_NE, cpu_res_val, tval, swx_skip);
         write_carryi(dc, 0);
         tcg_temp_free_i32(tval);
     }
@@ -1204,7 +1204,7 @@  static void eval_cond_jmp(DisasContext *dc, TCGv_i32 pc_true, TCGv_i32 pc_false)
     TCGv_i32 zero = tcg_const_i32(0);
 
     tcg_gen_movcond_i32(TCG_COND_NE, cpu_pc,
-                        env_btaken, zero,
+                        cpu_btaken, zero,
                         pc_true, pc_false);
 
     tcg_temp_free_i32(zero);
@@ -1245,7 +1245,7 @@  static void dec_bcc(DisasContext *dc)
         dc->jmp = JMP_INDIRECT;
         tcg_gen_addi_i32(cpu_btarget, *dec_alu_op_b(dc), dc->pc);
     }
-    eval_cc(dc, cc, env_btaken, cpu_R[dc->ra]);
+    eval_cc(dc, cc, cpu_btaken, cpu_R[dc->ra]);
 }
 
 static void dec_br(DisasContext *dc)
@@ -1311,7 +1311,7 @@  static void dec_br(DisasContext *dc)
 
     dc->jmp = JMP_INDIRECT;
     if (abs) {
-        tcg_gen_movi_i32(env_btaken, 1);
+        tcg_gen_movi_i32(cpu_btaken, 1);
         tcg_gen_mov_i32(cpu_btarget, *(dec_alu_op_b(dc)));
         if (link && !dslot) {
             if (!(dc->tb_flags & IMM_FLAG) &&
@@ -1330,7 +1330,7 @@  static void dec_br(DisasContext *dc)
             dc->jmp = JMP_DIRECT;
             dc->jmp_pc = dc->pc + (int32_t)((int16_t)dc->imm);
         } else {
-            tcg_gen_movi_i32(env_btaken, 1);
+            tcg_gen_movi_i32(cpu_btaken, 1);
             tcg_gen_addi_i32(cpu_btarget, *dec_alu_op_b(dc), dc->pc);
         }
     }
@@ -1419,7 +1419,7 @@  static void dec_rts(DisasContext *dc)
         LOG_DIS("rts ir=%x\n", dc->ir);
 
     dc->jmp = JMP_INDIRECT;
-    tcg_gen_movi_i32(env_btaken, 1);
+    tcg_gen_movi_i32(cpu_btaken, 1);
     tcg_gen_add_i32(cpu_btarget, cpu_R[dc->ra], *dec_alu_op_b(dc));
 }
 
@@ -1722,7 +1722,7 @@  void gen_intermediate_code(CPUState *cs, TranslationBlock *tb, int max_insns)
                     TCGLabel *l1 = gen_new_label();
                     t_sync_flags(dc);
                     /* Conditional jmp.  */
-                    tcg_gen_brcondi_i32(TCG_COND_NE, env_btaken, 0, l1);
+                    tcg_gen_brcondi_i32(TCG_COND_NE, cpu_btaken, 0, l1);
                     gen_goto_tb(dc, 1, dc->pc);
                     gen_set_label(l1);
                     gen_goto_tb(dc, 0, dc->jmp_pc);
@@ -1848,22 +1848,22 @@  void mb_tcg_init(void)
 {
     int i;
 
-    env_iflags = tcg_global_mem_new_i32(cpu_env,
+    cpu_iflags = tcg_global_mem_new_i32(cpu_env,
                     offsetof(CPUMBState, iflags),
                     "iflags");
-    env_imm = tcg_global_mem_new_i32(cpu_env,
+    cpu_imm = tcg_global_mem_new_i32(cpu_env,
                     offsetof(CPUMBState, imm),
                     "imm");
     cpu_btarget = tcg_global_mem_new_i32(cpu_env,
                      offsetof(CPUMBState, btarget),
                      "btarget");
-    env_btaken = tcg_global_mem_new_i32(cpu_env,
+    cpu_btaken = tcg_global_mem_new_i32(cpu_env,
                      offsetof(CPUMBState, btaken),
                      "btaken");
-    env_res_addr = tcg_global_mem_new(cpu_env,
+    cpu_res_addr = tcg_global_mem_new(cpu_env,
                      offsetof(CPUMBState, res_addr),
                      "res_addr");
-    env_res_val = tcg_global_mem_new_i32(cpu_env,
+    cpu_res_val = tcg_global_mem_new_i32(cpu_env,
                      offsetof(CPUMBState, res_val),
                      "res_val");
     for (i = 0; i < ARRAY_SIZE(cpu_R); i++) {