target-ppc: Use clz and ctz opcodes

Signed-off-by: Richard Henderson <rth@twiddle.net>
This commit is contained in:
Richard Henderson 2016-11-16 11:27:03 +01:00
parent 555baef8d0
commit 9b8514e56e
3 changed files with 16 additions and 28 deletions

View file

@ -141,16 +141,6 @@ uint64_t helper_divde(CPUPPCState *env, uint64_t rau, uint64_t rbu, uint32_t oe)
#endif
target_ulong helper_cntlzw(target_ulong t)
{
return clz32(t);
}
target_ulong helper_cnttzw(target_ulong t)
{
return ctz32(t);
}
#if defined(TARGET_PPC64)
/* if x = 0xab, returns 0xababababababababa */
#define pattern(x) (((x) & 0xff) * (~(target_ulong)0 / 0xff))
@ -174,16 +164,6 @@ uint32_t helper_cmpeqb(target_ulong ra, target_ulong rb)
#undef haszero
#undef hasvalue
target_ulong helper_cntlzd(target_ulong t)
{
return clz64(t);
}
target_ulong helper_cnttzd(target_ulong t)
{
return ctz64(t);
}
/* Return invalid random number.
*
* FIXME: Add rng backend or other mechanism to get cryptographically suitable