aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorblueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162>2008-03-06 20:09:54 +0000
committerblueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162>2008-03-06 20:09:54 +0000
commit134d77a14b969edf77117f34d9859bb667f9c922 (patch)
tree56a5bdfaca0ec1ea0a7b7bca2fb8436c386adc20
parenta3ffaf3060e70b036ac082f0772eb7b814f865ed (diff)
downloadqemu-134d77a14b969edf77117f34d9859bb667f9c922.zip
qemu-134d77a14b969edf77117f34d9859bb667f9c922.tar.gz
qemu-134d77a14b969edf77117f34d9859bb667f9c922.tar.bz2
Convert exception ops to TCG
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4022 c046a42c-6fe2-441c-8c8c-71466251a162
-rw-r--r--target-sparc/cpu.h1
-rw-r--r--target-sparc/exec.h1
-rw-r--r--target-sparc/helper.h1
-rw-r--r--target-sparc/op.c16
-rw-r--r--target-sparc/translate.c18
5 files changed, 19 insertions, 18 deletions
diff --git a/target-sparc/cpu.h b/target-sparc/cpu.h
index 79870f5..08366e8 100644
--- a/target-sparc/cpu.h
+++ b/target-sparc/cpu.h
@@ -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);
diff --git a/target-sparc/exec.h b/target-sparc/exec.h
index fce472b..2f1169b 100644
--- a/target-sparc/exec.h
+++ b/target-sparc/exec.h
@@ -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);
diff --git a/target-sparc/helper.h b/target-sparc/helper.h
index 94232b3..88b56e2 100644
--- a/target-sparc/helper.h
+++ b/target-sparc/helper.h
@@ -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);
diff --git a/target-sparc/op.c b/target-sparc/op.c
index 0e1423b..ce4c878 100644
--- a/target-sparc/op.c
+++ b/target-sparc/op.c
@@ -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;
diff --git a/target-sparc/translate.c b/target-sparc/translate.c
index 60d88ff..1089082 100644
--- a/target-sparc/translate.c
+++ b/target-sparc/translate.c
@@ -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)