[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PATCH 26/30] target-ppc: emulate fcpsgn instruction
From: |
Alexander Graf |
Subject: |
[Qemu-ppc] [PATCH 26/30] target-ppc: emulate fcpsgn instruction |
Date: |
Fri, 26 Apr 2013 20:21:45 +0200 |
From: Aurelien Jarno <address@hidden>
Needed for Power ISA version 2.05 compliance.
Reviewed-by: Richard Henderson <address@hidden>
Signed-off-by: Aurelien Jarno <address@hidden>
Signed-off-by: Alexander Graf <address@hidden>
---
target-ppc/translate.c | 14 ++++++++++++++
1 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/target-ppc/translate.c b/target-ppc/translate.c
index 2fabbaf..1989818 100644
--- a/target-ppc/translate.c
+++ b/target-ppc/translate.c
@@ -2258,6 +2258,19 @@ static void gen_fneg(DisasContext *ctx)
gen_compute_fprf(cpu_fpr[rD(ctx->opcode)], 0, Rc(ctx->opcode) != 0);
}
+/* fcpsgn: PowerPC 2.05 specification */
+/* XXX: beware that fcpsgn never checks for NaNs nor update FPSCR */
+static void gen_fcpsgn(DisasContext *ctx)
+{
+ if (unlikely(!ctx->fpu_enabled)) {
+ gen_exception(ctx, POWERPC_EXCP_FPU);
+ return;
+ }
+ tcg_gen_deposit_i64(cpu_fpr[rD(ctx->opcode)], cpu_fpr[rA(ctx->opcode)],
+ cpu_fpr[rB(ctx->opcode)], 0, 63);
+ gen_compute_fprf(cpu_fpr[rD(ctx->opcode)], 0, Rc(ctx->opcode) != 0);
+}
+
/*** Floating-Point status & ctrl register ***/
/* mcrfs */
@@ -8559,6 +8572,7 @@ GEN_HANDLER(fabs, 0x3F, 0x08, 0x08, 0x001F0000,
PPC_FLOAT),
GEN_HANDLER(fmr, 0x3F, 0x08, 0x02, 0x001F0000, PPC_FLOAT),
GEN_HANDLER(fnabs, 0x3F, 0x08, 0x04, 0x001F0000, PPC_FLOAT),
GEN_HANDLER(fneg, 0x3F, 0x08, 0x01, 0x001F0000, PPC_FLOAT),
+GEN_HANDLER_E(fcpsgn, 0x3F, 0x08, 0x00, 0x00000000, PPC_NONE, PPC2_ISA205),
GEN_HANDLER(mcrfs, 0x3F, 0x00, 0x02, 0x0063F801, PPC_FLOAT),
GEN_HANDLER(mffs, 0x3F, 0x07, 0x12, 0x001FF800, PPC_FLOAT),
GEN_HANDLER(mtfsb0, 0x3F, 0x06, 0x02, 0x001FF800, PPC_FLOAT),
--
1.6.0.2
- [Qemu-ppc] [PATCH 10/30] PPC: mac newworld: fix cpu NIP reset value, (continued)
- [Qemu-ppc] [PATCH 10/30] PPC: mac newworld: fix cpu NIP reset value, Alexander Graf, 2013/04/26
- [Qemu-ppc] [PATCH 07/30] target-ppc: Fix narrow-mode add/sub carry output, Alexander Graf, 2013/04/26
- [Qemu-ppc] [PATCH 11/30] PPC: Fix compile with profiling enabled, Alexander Graf, 2013/04/26
- [Qemu-ppc] [PATCH 05/30] PPC: fix hreset_vector for 60x, 7x0, 7x5, G2, MPC8xx, MPC5xx, 7400 and 7450, Alexander Graf, 2013/04/26
- [Qemu-ppc] [PATCH 20/30] PPC: Fix dcbz for linux-user on 970, Alexander Graf, 2013/04/26
- [Qemu-ppc] [PATCH 22/30] disas: Disassemble all ppc insns for the guest, Alexander Graf, 2013/04/26
- [Qemu-ppc] [PATCH 23/30] target-ppc: add instruction flags for Book I 2.05, Alexander Graf, 2013/04/26
- [Qemu-ppc] [PATCH 29/30] target-ppc: emulate store doubleword pair instructions, Alexander Graf, 2013/04/26
- [Qemu-ppc] [PATCH 24/30] target-ppc: emulate cmpb instruction, Alexander Graf, 2013/04/26
- [Qemu-ppc] [PATCH 28/30] target-ppc: emulate load doubleword pair instructions, Alexander Graf, 2013/04/26
- [Qemu-ppc] [PATCH 26/30] target-ppc: emulate fcpsgn instruction,
Alexander Graf <=
- [Qemu-ppc] [PATCH 25/30] target-ppc: emulate prtyw and prtyd instructions, Alexander Graf, 2013/04/26
- [Qemu-ppc] [PATCH 21/30] target-ppc: optimize fabs, fnabs, fneg, Alexander Graf, 2013/04/26
- [Qemu-ppc] [PATCH 19/30] powerpc: correctly handle fpu exceptions., Alexander Graf, 2013/04/26
- [Qemu-ppc] [PATCH 27/30] target-ppc: emulate lfiwax instruction, Alexander Graf, 2013/04/26
- [Qemu-ppc] [PATCH 15/30] pseries: Fix some small errors in XICS logic, Alexander Graf, 2013/04/26
- [Qemu-ppc] [PATCH 14/30] target-ppc: Add more stubs for POWER7 PMU registers, Alexander Graf, 2013/04/26
- [Qemu-ppc] [PATCH 18/30] pseries: Generate device paths for VIO devices, Alexander Graf, 2013/04/26
- [Qemu-ppc] [PATCH 09/30] Enable kvm emulated watchdog, Alexander Graf, 2013/04/26
- [Qemu-ppc] [PATCH 12/30] pseries: Fix incorrect calculation of RMA size in certain configurations, Alexander Graf, 2013/04/26
- [Qemu-ppc] [PATCH 03/30] PPC: Remove env->hreset_excp_prefix, Alexander Graf, 2013/04/26