aboutsummaryrefslogtreecommitdiff
path: root/target-sparc/translate.c
diff options
context:
space:
mode:
authorblueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162>2008-03-18 18:10:42 +0000
committerblueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162>2008-03-18 18:10:42 +0000
commit3b89f26c11e4060a203518d8bc203b6fb0b6cf96 (patch)
tree1d6356549f5aa54d550a6de60cfb32b4f0a06ac7 /target-sparc/translate.c
parent2483386a6e77b7e480e8019bd1250694f146bdb1 (diff)
Convert udiv and sdiv ops to TCG
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4088 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'target-sparc/translate.c')
-rw-r--r--target-sparc/translate.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/target-sparc/translate.c b/target-sparc/translate.c
index 5d87ef8d5d..1ab4d7e956 100644
--- a/target-sparc/translate.c
+++ b/target-sparc/translate.c
@@ -807,6 +807,16 @@ static inline void gen_op_smul_T1_T0(void)
tcg_gen_discard_i64(r_temp2);
}
+static inline void gen_op_udiv_T1_T0(void)
+{
+ tcg_gen_helper_1_2(helper_udiv, cpu_T[0], cpu_T[0], cpu_T[1]);
+}
+
+static inline void gen_op_sdiv_T1_T0(void)
+{
+ tcg_gen_helper_1_2(helper_sdiv, cpu_T[0], cpu_T[0], cpu_T[1]);
+}
+
#ifdef TARGET_SPARC64
static inline void gen_trap_ifdivzero_i64(TCGv divisor)
{
@@ -842,7 +852,8 @@ static inline void gen_op_div_cc(void)
gen_cc_clear();
gen_cc_NZ(cpu_T[0]);
l1 = gen_new_label();
- tcg_gen_brcond_i32(TCG_COND_EQ, cpu_T[1], tcg_const_i32(0), l1);
+ tcg_gen_ld_tl(cpu_tmp0, cpu_env, offsetof(CPUSPARCState, cc_src2));
+ tcg_gen_brcond_tl(TCG_COND_EQ, cpu_tmp0, tcg_const_tl(0), l1);
tcg_gen_ori_i32(cpu_psr, cpu_psr, PSR_OVF);
gen_set_label(l1);
}