aboutsummaryrefslogtreecommitdiff
path: root/target-ppc/op_helper.c
diff options
context:
space:
mode:
authorj_mayer <j_mayer@c046a42c-6fe2-441c-8c8c-71466251a162>2007-03-23 09:45:27 +0000
committerj_mayer <j_mayer@c046a42c-6fe2-441c-8c8c-71466251a162>2007-03-23 09:45:27 +0000
commit426613dbf8cd1120f9e47fb636c4c03bc1ef586c (patch)
treeefc43a2a28033f82155c30d618f9b0b8c18b4b02 /target-ppc/op_helper.c
parent1b9eb036b9cd2d8b671f59030e8522c64ccea703 (diff)
Add missing PowerPC 64 instructions
PowerPC 64 fixes. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2530 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'target-ppc/op_helper.c')
-rw-r--r--target-ppc/op_helper.c64
1 files changed, 63 insertions, 1 deletions
diff --git a/target-ppc/op_helper.c b/target-ppc/op_helper.c
index 45e4dde9d3..55b5ca5653 100644
--- a/target-ppc/op_helper.c
+++ b/target-ppc/op_helper.c
@@ -642,6 +642,42 @@ void do_fctiwz (void)
FT0 = p.d;
}
+#if defined(TARGET_PPC64)
+void do_fcfid (void)
+{
+ union {
+ double d;
+ uint64_t i;
+ } p;
+
+ p.d = FT0;
+ FT0 = int64_to_float64(p.i, &env->fp_status);
+}
+
+void do_fctid (void)
+{
+ union {
+ double d;
+ uint64_t i;
+ } p;
+
+ p.i = float64_to_int64(FT0, &env->fp_status);
+ FT0 = p.d;
+}
+
+void do_fctidz (void)
+{
+ union {
+ double d;
+ uint64_t i;
+ } p;
+
+ p.i = float64_to_int64_round_to_zero(FT0, &env->fp_status);
+ FT0 = p.d;
+}
+
+#endif
+
#if USE_PRECISE_EMULATION
void do_fmadd (void)
{
@@ -846,8 +882,12 @@ void do_fcmpo (void)
void do_rfi (void)
{
env->nip = (target_ulong)(env->spr[SPR_SRR0] & ~0x00000003);
- T0 = (target_ulong)(env->spr[SPR_SRR1] & ~0xFFFF0000UL);
+ T0 = (uint32_t)(env->spr[SPR_SRR1] & ~0xFFFF0000UL);
+#if defined(TARGET_PPC64)
+ ppc_store_msr_32(env, T0);
+#else
do_store_msr(env, T0);
+#endif
#if defined (DEBUG_OP)
dump_rfi();
#endif
@@ -859,6 +899,28 @@ void do_rfi_32 (void)
{
env->nip = (uint32_t)(env->spr[SPR_SRR0] & ~0x00000003);
T0 = (uint32_t)(env->spr[SPR_SRR1] & ~0xFFFF0000UL);
+ ppc_store_msr_32(env, T0);
+#if defined (DEBUG_OP)
+ dump_rfi();
+#endif
+ env->interrupt_request |= CPU_INTERRUPT_EXITTB;
+}
+
+void do_rfid (void)
+{
+ env->nip = (target_ulong)(env->spr[SPR_SRR0] & ~0x00000003);
+ T0 = (uint64_t)(env->spr[SPR_SRR1] & ~0xFFFF0000UL);
+ do_store_msr(env, T0);
+#if defined (DEBUG_OP)
+ dump_rfi();
+#endif
+ env->interrupt_request |= CPU_INTERRUPT_EXITTB;
+}
+
+void do_rfid_32 (void)
+{
+ env->nip = (uint32_t)(env->spr[SPR_SRR0] & ~0x00000003);
+ T0 = (uint64_t)(env->spr[SPR_SRR1] & ~0xFFFF0000UL);
do_store_msr(env, T0);
#if defined (DEBUG_OP)
dump_rfi();