aboutsummaryrefslogtreecommitdiff
path: root/target-ppc/op_helper.c
diff options
context:
space:
mode:
authoraurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162>2008-10-21 11:31:14 +0000
committeraurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162>2008-10-21 11:31:14 +0000
commite1571908a28b1707f63392541be30990160af31c (patch)
tree9ccdcf0c78a25dbf272dc1f7d66991dee6144a6e /target-ppc/op_helper.c
parentbdffd4a9d7254a765e56132587bc814195e094a2 (diff)
target-ppc: convert crf related instructions to TCG
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5505 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'target-ppc/op_helper.c')
-rw-r--r--target-ppc/op_helper.c48
1 files changed, 27 insertions, 21 deletions
diff --git a/target-ppc/op_helper.c b/target-ppc/op_helper.c
index ad52e0d679..e0b6f4efdb 100644
--- a/target-ppc/op_helper.c
+++ b/target-ppc/op_helper.c
@@ -62,25 +62,25 @@ void do_raise_exception (uint32_t exception)
/*****************************************************************************/
/* Registers load and stores */
-void do_load_cr (void)
+uint32_t helper_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)
+void helper_store_cr (target_ulong val, uint32_t mask)
{
int i, sh;
for (i = 0, sh = 7; i < 8; i++, sh--) {
if (mask & (1 << sh))
- env->crf[i] = (T0 >> (sh * 4)) & 0xFUL;
+ env->crf[i] = (val >> (sh * 4)) & 0xFUL;
}
}
@@ -1364,27 +1364,32 @@ void do_fsel (void)
FT0 = FT2;
}
-void do_fcmpu (void)
+uint32_t helper_fcmpu (void)
{
+ uint32_t ret = 0;
+
if (unlikely(float64_is_signaling_nan(FT0) ||
float64_is_signaling_nan(FT1))) {
/* sNaN comparison */
fload_invalid_op_excp(POWERPC_EXCP_FP_VXSNAN);
} else {
if (float64_lt(FT0, FT1, &env->fp_status)) {
- T0 = 0x08UL;
+ ret = 0x08UL;
} else if (!float64_le(FT0, FT1, &env->fp_status)) {
- T0 = 0x04UL;
+ ret = 0x04UL;
} else {
- T0 = 0x02UL;
+ ret = 0x02UL;
}
}
env->fpscr &= ~(0x0F << FPSCR_FPRF);
- env->fpscr |= T0 << FPSCR_FPRF;
+ env->fpscr |= ret << FPSCR_FPRF;
+ return ret;
}
-void do_fcmpo (void)
+uint32_t helper_fcmpo (void)
{
+ uint32_t ret = 0;
+
if (unlikely(float64_is_nan(FT0) ||
float64_is_nan(FT1))) {
if (float64_is_signaling_nan(FT0) ||
@@ -1398,15 +1403,16 @@ void do_fcmpo (void)
}
} else {
if (float64_lt(FT0, FT1, &env->fp_status)) {
- T0 = 0x08UL;
+ ret = 0x08UL;
} else if (!float64_le(FT0, FT1, &env->fp_status)) {
- T0 = 0x04UL;
+ ret = 0x04UL;
} else {
- T0 = 0x02UL;
+ ret = 0x02UL;
}
}
env->fpscr &= ~(0x0F << FPSCR_FPRF);
- env->fpscr |= T0 << FPSCR_FPRF;
+ env->fpscr |= ret << FPSCR_FPRF;
+ return ret;
}
#if !defined (CONFIG_USER_ONLY)