ARM TCG conversion 2/16.

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4139 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
pbrook 2008-03-31 03:45:13 +00:00
parent b26eefb68e
commit f51bbbfefe
4 changed files with 12 additions and 9 deletions

View File

@ -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)

View File

@ -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))

View File

@ -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)

View File

@ -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;