diff options
author | blueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162> | 2008-03-06 20:09:54 +0000 |
---|---|---|
committer | blueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162> | 2008-03-06 20:09:54 +0000 |
commit | 134d77a14b969edf77117f34d9859bb667f9c922 (patch) | |
tree | 56a5bdfaca0ec1ea0a7b7bca2fb8436c386adc20 /target-sparc/translate.c | |
parent | a3ffaf3060e70b036ac082f0772eb7b814f865ed (diff) | |
download | qemu-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
Diffstat (limited to 'target-sparc/translate.c')
-rw-r--r-- | target-sparc/translate.c | 18 |
1 files changed, 18 insertions, 0 deletions
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) |