target-ppc: convert dcbz instruction to TCG

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5826 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
aurel32 2008-11-30 16:24:05 +00:00
parent ff4a62cd81
commit 799a8c8d0a
7 changed files with 55 additions and 360 deletions

View file

@ -56,7 +56,6 @@ void helper_raise_debug (void)
raise_exception(env, EXCP_DEBUG);
}
/*****************************************************************************/
/* Registers load and stores */
target_ulong helper_load_cr (void)
@ -171,6 +170,46 @@ void helper_stmw (target_ulong addr, uint32_t reg)
}
}
static void do_dcbz(target_ulong addr, int dcache_line_size)
{
target_long mask = get_addr(~(dcache_line_size - 1));
int i;
#ifdef CONFIG_USER_ONLY
#define stfun stl_raw
#else
void (*stfun)(target_ulong, int);
switch (env->mmu_idx) {
default:
case 0: stfun = stl_user;
break;
case 1: stfun = stl_kernel;
break;
case 2: stfun = stl_hypv;
break;
}
#endif
addr &= mask;
for (i = 0 ; i < dcache_line_size ; i += 4) {
stfun(addr + i , 0);
}
if ((env->reserve & mask) == addr)
env->reserve = (target_ulong)-1ULL;
}
void helper_dcbz(target_ulong addr)
{
do_dcbz(addr, env->dcache_line_size);
}
void helper_dcbz_970(target_ulong addr)
{
if (((env->spr[SPR_970_HID5] >> 7) & 0x3) == 1)
do_dcbz(addr, 32);
else
do_dcbz(addr, env->dcache_line_size);
}
/*****************************************************************************/
/* Fixed point operations helpers */
#if defined(TARGET_PPC64)
@ -1219,7 +1258,6 @@ uint64_t helper_fnmsub (uint64_t arg1, uint64_t arg2, uint64_t arg3)
return farg1.ll;
}
/* frsp - frsp. */
uint64_t helper_frsp (uint64_t arg)
{