Convert exception ops to TCG
authorblueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162>
Thu, 6 Mar 2008 20:09:54 +0000 (20:09 +0000)
committerblueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162>
Thu, 6 Mar 2008 20:09:54 +0000 (20:09 +0000)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4022 c046a42c-6fe2-441c-8c8c-71466251a162

target-sparc/cpu.h
target-sparc/exec.h
target-sparc/helper.h
target-sparc/op.c
target-sparc/translate.c

index 79870f5..08366e8 100644 (file)
@@ -321,7 +321,6 @@ void cpu_set_cwp(CPUSPARCState *env1, int new_cwp);
 #endif
 
 int cpu_sparc_signal_handler(int host_signum, void *pinfo, void *puc);
-void raise_exception(int tt);
 void do_unassigned_access(target_phys_addr_t addr, int is_write, int is_exec,
                           int is_asi);
 void cpu_check_irqs(CPUSPARCState *env);
index fce472b..2f1169b 100644 (file)
@@ -66,7 +66,6 @@ void do_fxtoq(void);
 #endif
 #endif
 void do_interrupt(int intno);
-void raise_exception(int tt);
 void memcpy32(target_ulong *dst, const target_ulong *src);
 target_ulong mmu_probe(CPUState *env, target_ulong address, int mmulev);
 void dump_mmu(CPUState *env);
index 94232b3..88b56e2 100644 (file)
@@ -72,3 +72,4 @@ void TCG_HELPER_PROTO helper_fcmpeq_fcc2(void);
 void TCG_HELPER_PROTO helper_fcmpeq_fcc3(void);
 #endif
 #endif
+void TCG_HELPER_PROTO raise_exception(int tt);
index 0e1423b..ce4c878 100644 (file)
@@ -857,22 +857,6 @@ void OPPROTO op_restore(void)
 }
 #endif
 
-void OPPROTO op_exception(void)
-{
-    env->exception_index = PARAM1;
-    cpu_loop_exit();
-    FORCE_RET();
-}
-
-void OPPROTO op_fpexception_im(void)
-{
-    env->exception_index = TT_FP_EXCP;
-    env->fsr &= ~FSR_FTT_MASK;
-    env->fsr |= PARAM1;
-    cpu_loop_exit();
-    FORCE_RET();
-}
-
 void OPPROTO op_eval_ba(void)
 {
     T2 = 1;
index 60d88ff..1089082 100644 (file)
@@ -807,6 +807,24 @@ static inline void gen_op_fcmpeq(int fccno)
 
 #endif
 
+static inline void gen_op_exception(int exception)
+{
+    TCGv r_except;
+
+    r_except = tcg_temp_new(TCG_TYPE_I32);
+    tcg_gen_movi_i32(r_except, exception);
+    tcg_gen_helper_0_1(raise_exception, r_except);
+}
+
+static inline void gen_op_fpexception_im(int fsr_flags)
+{
+    tcg_gen_ld_tl(cpu_tmp0, cpu_env, offsetof(CPUSPARCState, fsr));
+    tcg_gen_andi_tl(cpu_tmp0, cpu_tmp0, ~FSR_FTT_MASK);
+    tcg_gen_ori_tl(cpu_tmp0, cpu_tmp0, fsr_flags);
+    tcg_gen_st_tl(cpu_tmp0, cpu_env, offsetof(CPUSPARCState, fsr));
+    gen_op_exception(TT_FP_EXCP);
+}
+
 static int gen_trap_ifnofpu(DisasContext * dc)
 {
 #if !defined(CONFIG_USER_ONLY)