diff options
author | aurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162> | 2008-08-24 19:05:35 +0000 |
---|---|---|
committer | aurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162> | 2008-08-24 19:05:35 +0000 |
commit | 61c0480722bd86380e396db537bd8fea403b37db (patch) | |
tree | 969e3d2e3775d886c21d053e5f2c8fb1cb1f9b67 /target-ppc/op_helper.c | |
parent | c0692e3c65ee4811390e22d2996f6d8b53fcd2c1 (diff) |
PPC: Switch a few instructions to TCG
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5083 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'target-ppc/op_helper.c')
-rw-r--r-- | target-ppc/op_helper.c | 46 |
1 files changed, 27 insertions, 19 deletions
diff --git a/target-ppc/op_helper.c b/target-ppc/op_helper.c index 1c08172807..19fa6ac6ea 100644 --- a/target-ppc/op_helper.c +++ b/target-ppc/op_helper.c @@ -68,16 +68,16 @@ void do_print_mem_EA (target_ulong EA) /*****************************************************************************/ /* Registers load and stores */ -void do_load_cr (void) +target_ulong do_load_cr (void) { - T0 = (env->crf[0] << 28) | - (env->crf[1] << 24) | - (env->crf[2] << 20) | - (env->crf[3] << 16) | - (env->crf[4] << 12) | - (env->crf[5] << 8) | - (env->crf[6] << 4) | - (env->crf[7] << 0); + return (env->crf[0] << 28) | + (env->crf[1] << 24) | + (env->crf[2] << 20) | + (env->crf[3] << 16) | + (env->crf[4] << 12) | + (env->crf[5] << 8) | + (env->crf[6] << 4) | + (env->crf[7] << 0); } void do_store_cr (uint32_t mask) @@ -429,27 +429,27 @@ void do_srad (void) } #endif -void do_popcntb (void) +target_ulong do_popcntb (target_ulong t0) { uint32_t ret; int i; ret = 0; for (i = 0; i < 32; i += 8) - ret |= ctpop8((T0 >> i) & 0xFF) << i; - T0 = ret; + ret |= ctpop8((t0 >> i) & 0xFF) << i; + return ret; } #if defined(TARGET_PPC64) -void do_popcntb_64 (void) +target_ulong do_popcntb_64 (target_ulong t0) { uint64_t ret; int i; ret = 0; for (i = 0; i < 64; i += 8) - ret |= ctpop8((T0 >> i) & 0xFF) << i; - T0 = ret; + ret |= ctpop8((t0 >> i) & 0xFF) << i; + return ret; } #endif @@ -1404,15 +1404,23 @@ void do_fcmpo (void) #if !defined (CONFIG_USER_ONLY) void cpu_dump_rfi (target_ulong RA, target_ulong msr); -void do_store_msr (void) +void do_store_msr (target_ulong t0) { - T0 = hreg_store_msr(env, T0, 0); - if (T0 != 0) { + t0 = hreg_store_msr(env, t0, 0); + if (t0 != 0) { env->interrupt_request |= CPU_INTERRUPT_EXITTB; - do_raise_exception(T0); + do_raise_exception(t0); } } +#if defined (TARGET_PPC64) +void do_store_msr_32 (target_ulong t0) +{ + t0 = (env->msr & ~0xFFFFFFFFULL) | (t0 & 0xFFFFFFFF); + do_store_msr(t0); +} +#endif + static always_inline void __do_rfi (target_ulong nip, target_ulong msr, target_ulong msrm, int keep_msrh) { |