提交 f51bbbfe 编写于 作者: P pbrook

ARM TCG conversion 2/16.

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4139 c046a42c-6fe2-441c-8c8c-71466251a162
上级 b26eefb6
......@@ -340,6 +340,14 @@ uint32_t HELPER(uxtb16)(uint32_t x)
return res;
}
uint32_t HELPER(clz)(uint32_t x)
{
int count;
for (count = 32; x; count--)
x >>= 1;
return count;
}
#if defined(CONFIG_USER_ONLY)
void do_interrupt (CPUState *env)
......
......@@ -2,5 +2,6 @@
#define DEF_HELPER(name, ret, args) ret helper_##name args;
#endif
DEF_HELPER(clz, uint32_t, (uint32_t))
DEF_HELPER(sxtb16, uint32_t, (uint32_t))
DEF_HELPER(uxtb16, uint32_t, (uint32_t))
......@@ -475,15 +475,6 @@ void OPPROTO op_rorl_T1_T0_cc(void)
}
/* misc */
void OPPROTO op_clz_T0(void)
{
int count;
for (count = 32; T0 > 0; count--)
T0 = T0 >> 1;
T0 = count;
FORCE_RET();
}
#define SIGNBIT (uint32_t)0x80000000
/* saturating arithmetic */
void OPPROTO op_addl_T0_T1_setq(void)
......
......@@ -205,6 +205,9 @@ static void store_reg(DisasContext *s, int reg, TCGv var)
#define gen_sxtb16(var) tcg_gen_helper_1_1(HELPER_ADDR(sxtb16), var, var)
#define gen_uxtb16(var) tcg_gen_helper_1_1(HELPER_ADDR(uxtb16), var, var)
#define gen_op_clz_T0(var) \
tcg_gen_helper_1_1(HELPER_ADDR(clz), cpu_T[0], cpu_T[0])
/* Dual 16-bit add. Result placed in t0 and t1 is marked as dead.
tmp = (t0 ^ t1) & 0x8000;
t0 &= ~0x8000;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册