]> git.proxmox.com Git - qemu.git/blobdiff - target-sh4/translate.c
configure: Copy test data to build directory
[qemu.git] / target-sh4 / translate.c
index 743d76a5758bc9b75cd0d1070cd2850affb975b7..569bc738cb26a8e2bbfeb21dc009b4a4fa939a81 100644 (file)
@@ -27,7 +27,6 @@
 //#define SH4_SINGLE_STEP
 
 #include "cpu.h"
-#include "exec-all.h"
 #include "disas.h"
 #include "tcg-op.h"
 #include "qemu-common.h"
@@ -302,7 +301,7 @@ static void gen_goto_tb(DisasContext * ctx, int n, target_ulong dest)
        /* Use a direct jump if in same page and singlestep not enabled */
         tcg_gen_goto_tb(n);
         tcg_gen_movi_i32(cpu_pc, dest);
-        tcg_gen_exit_tb((long) tb + n);
+        tcg_gen_exit_tb((tcg_target_long)tb + n);
     } else {
         tcg_gen_movi_i32(cpu_pc, dest);
         if (ctx->singlestep_enabled)
@@ -952,7 +951,21 @@ static void _decode_opc(DisasContext * ctx)
        tcg_gen_neg_i32(REG(B11_8), REG(B7_4));
        return;
     case 0x600a:               /* negc Rm,Rn */
-       gen_helper_negc(REG(B11_8), REG(B7_4));
+        {
+           TCGv t0, t1;
+            t0 = tcg_temp_new();
+            tcg_gen_neg_i32(t0, REG(B7_4));
+            t1 = tcg_temp_new();
+            tcg_gen_andi_i32(t1, cpu_sr, SR_T);
+            tcg_gen_sub_i32(REG(B11_8), t0, t1);
+            tcg_gen_andi_i32(cpu_sr, cpu_sr, ~SR_T);
+            tcg_gen_setcondi_i32(TCG_COND_GTU, t1, t0, 0);
+            tcg_gen_or_i32(cpu_sr, cpu_sr, t1);
+            tcg_gen_setcond_i32(TCG_COND_GTU, t1, REG(B11_8), t0);
+            tcg_gen_or_i32(cpu_sr, cpu_sr, t1);
+            tcg_temp_free(t0);
+            tcg_temp_free(t1);
+        }
        return;
     case 0x6007:               /* not Rm,Rn */
        tcg_gen_not_i32(REG(B11_8), REG(B7_4));
@@ -2055,8 +2068,7 @@ void gen_intermediate_code_pc(CPUState * env, struct TranslationBlock *tb)
     gen_intermediate_code_internal(env, tb, 1);
 }
 
-void gen_pc_load(CPUState *env, TranslationBlock *tb,
-                unsigned long searched_pc, int pc_pos, void *puc)
+void restore_state_to_opc(CPUState *env, TranslationBlock *tb, int pc_pos)
 {
     env->pc = gen_opc_pc[pc_pos];
     env->flags = gen_opc_hflags[pc_pos];