Received: from eggs.gnu.org ([208.118.235.92]:44707) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UQzro-0002uZ-RG for qemu-devel@nongnu.org; Sat, 13 Apr 2013 08:47:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UQzrl-0005Ss-HC for qemu-devel@nongnu.org; Sat, 13 Apr 2013 08:47:40 -0400 Received: from hall.aurel32.net ([2001:470:1f15:c4f::1]:40485) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UQzrl-0005S8-A2 for qemu-devel@nongnu.org; Sat, 13 Apr 2013 08:47:37 -0400 From: Aurelien Jarno Date: Sat, 13 Apr 2013 14:47:27 +0200 Message-Id: <1365857251-28173-7-git-send-email-aurelien@aurel32.net> In-Reply-To: <1365857251-28173-1-git-send-email-aurelien@aurel32.net> References: <1365857251-28173-1-git-send-email-aurelien@aurel32.net> Subject: [Qemu-devel] [PATCH 06/10] target-ppc: emulate fcpsgn instruction List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, Alexander Graf , Aurelien Jarno Needed for Power ISA version 2.05 compliance. Cc: Alexander Graf Signed-off-by: Aurelien Jarno --- target-ppc/translate.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/target-ppc/translate.c b/target-ppc/translate.c index 1286ad2..e928f6b 100644 --- a/target-ppc/translate.c +++ b/target-ppc/translate.c @@ -2253,6 +2253,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 */ @@ -8554,6 +8567,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.7.10.4