tcg_temp_local_new should take no parameter
[qemu] / target-sh4 / translate.c
index 55b6c43..73134f0 100644 (file)
@@ -185,9 +185,9 @@ void cpu_dump_state(CPUState * env, FILE * f,
 static void cpu_sh4_reset(CPUSH4State * env)
 {
 #if defined(CONFIG_USER_ONLY)
-    env->sr = SR_FD;            /* FD - kernel does lazy fpu context switch */
+    env->sr = 0;
 #else
-    env->sr = 0x700000F0;      /* MD, RB, BL, I3-I0 */
+    env->sr = SR_MD | SR_RB | SR_BL | SR_I3 | SR_I2 | SR_I1 | SR_I0;
 #endif
     env->vbr = 0;
     env->pc = 0xA0000000;
@@ -240,7 +240,7 @@ static const sh4_def_t *cpu_sh4_find_by_name(const char *name)
     if (strcasecmp(name, "any") == 0)
        return &sh4_defs[0];
 
-    for (i = 0; i < sizeof(sh4_defs) / sizeof(*sh4_defs); i++)
+    for (i = 0; i < ARRAY_SIZE(sh4_defs); i++)
        if (strcasecmp(name, sh4_defs[i].name) == 0)
            return &sh4_defs[i];
 
@@ -251,7 +251,7 @@ void sh4_cpu_list(FILE *f, int (*cpu_fprintf)(FILE *f, const char *fmt, ...))
 {
     int i;
 
-    for (i = 0; i < sizeof(sh4_defs) / sizeof(*sh4_defs); i++)
+    for (i = 0; i < ARRAY_SIZE(sh4_defs); i++)
        (*cpu_fprintf)(f, "%s\n", sh4_defs[i].name);
 }
 
@@ -785,8 +785,8 @@ static void _decode_opc(DisasContext * ctx)
        {
            int label1 = gen_new_label();
            int label2 = gen_new_label();
-           TCGv cmp1 = tcg_temp_local_new(TCG_TYPE_I32);
-           TCGv cmp2 = tcg_temp_local_new(TCG_TYPE_I32);
+           TCGv cmp1 = tcg_temp_local_new();
+           TCGv cmp2 = tcg_temp_local_new();
            tcg_gen_xor_i32(cmp1, REG(B7_4), REG(B11_8));
            tcg_gen_andi_i32(cmp2, cmp1, 0xff000000);
            tcg_gen_brcondi_i32(TCG_COND_EQ, cmp2, 0, label1);
@@ -935,7 +935,7 @@ static void _decode_opc(DisasContext * ctx)
            int label2 = gen_new_label();
            int label3 = gen_new_label();
            int label4 = gen_new_label();
-           TCGv shift = tcg_temp_local_new(TCG_TYPE_I32);
+           TCGv shift = tcg_temp_local_new();
            tcg_gen_brcondi_i32(TCG_COND_LT, REG(B7_4), 0, label1);
            /* Rm positive, shift to the left */
            tcg_gen_andi_i32(shift, REG(B7_4), 0x1f);
@@ -966,7 +966,7 @@ static void _decode_opc(DisasContext * ctx)
            int label1 = gen_new_label();
            int label2 = gen_new_label();
            int label3 = gen_new_label();
-           TCGv shift = tcg_temp_local_new(TCG_TYPE_I32);
+           TCGv shift = tcg_temp_local_new();
            tcg_gen_brcondi_i32(TCG_COND_LT, REG(B7_4), 0, label1);
            /* Rm positive, shift to the left */
            tcg_gen_andi_i32(shift, REG(B7_4), 0x1f);
@@ -1645,9 +1645,9 @@ static void _decode_opc(DisasContext * ctx)
     case 0x401b:               /* tas.b @Rn */
        {
            TCGv addr, val;
-           addr = tcg_temp_local_new(TCG_TYPE_I32);
+           addr = tcg_temp_local_new();
            tcg_gen_mov_i32(addr, REG(B11_8));
-           val = tcg_temp_local_new(TCG_TYPE_I32);
+           val = tcg_temp_local_new();
            tcg_gen_qemu_ld8u(val, addr, ctx->memidx);
            gen_cmp_imm(TCG_COND_EQ, val, 0);
            tcg_gen_ori_i32(val, val, 0x80);