From: Aurelien Jarno <aurelien@aurel32.net>
To: qemu-devel@nongnu.org
Cc: qemu-ppc@nongnu.org, Alexander Graf <agraf@suse.de>,
Aurelien Jarno <aurelien@aurel32.net>
Subject: [Qemu-devel] [PATCH 06/10] target-ppc: emulate fcpsgn instruction
Date: Sat, 13 Apr 2013 14:47:27 +0200 [thread overview]
Message-ID: <1365857251-28173-7-git-send-email-aurelien@aurel32.net> (raw)
In-Reply-To: <1365857251-28173-1-git-send-email-aurelien@aurel32.net>
Needed for Power ISA version 2.05 compliance.
Cc: Alexander Graf <agraf@suse.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
---
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
next prev parent reply other threads:[~2013-04-13 12:47 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-13 12:47 [Qemu-devel] [PATCH 00/10] target-ppc: emulate Power ISA 2.05 instructions Aurelien Jarno
2013-04-13 12:47 ` [Qemu-devel] [PATCH 01/10] target-ppc: optimize fabs, fnabs, fneg Aurelien Jarno
2013-04-13 13:20 ` Peter Maydell
2013-04-15 6:16 ` Aurelien Jarno
2013-04-13 12:47 ` [Qemu-devel] [PATCH 02/10] disas: Disassemble all ppc insns for the guest Aurelien Jarno
2013-04-17 14:15 ` Richard Henderson
2013-04-13 12:47 ` [Qemu-devel] [PATCH 03/10] target-ppc: add instruction flags for Book I 2.05 Aurelien Jarno
2013-04-17 14:16 ` Richard Henderson
2013-04-13 12:47 ` [Qemu-devel] [PATCH 04/10] target-ppc: emulate cmpb instruction Aurelien Jarno
2013-04-17 14:17 ` Richard Henderson
2013-04-13 12:47 ` [Qemu-devel] [PATCH 05/10] target-ppc: emulate prtyw and prtyd instructions Aurelien Jarno
2013-04-17 14:19 ` Richard Henderson
2013-04-13 12:47 ` Aurelien Jarno [this message]
2013-04-17 14:21 ` [Qemu-devel] [PATCH 06/10] target-ppc: emulate fcpsgn instruction Richard Henderson
2013-04-13 12:47 ` [Qemu-devel] [PATCH 07/10] target-ppc: emulate lfiwax instruction Aurelien Jarno
2013-04-17 14:22 ` Richard Henderson
2013-04-13 12:47 ` [Qemu-devel] [PATCH 08/10] target-ppc: emulate load doubleword pair instructions Aurelien Jarno
2013-04-17 14:25 ` Richard Henderson
2013-04-13 12:47 ` [Qemu-devel] [PATCH 09/10] target-ppc: emulate store " Aurelien Jarno
2013-04-17 14:26 ` Richard Henderson
2013-04-19 18:54 ` Aurelien Jarno
2013-04-13 12:47 ` [Qemu-devel] [PATCH 10/10] target-ppc: add support for extended mtfsf/mtfsfi forms Aurelien Jarno
2013-04-19 15:35 ` [Qemu-devel] [PATCH 00/10] target-ppc: emulate Power ISA 2.05 instructions Alexander Graf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1365857251-28173-7-git-send-email-aurelien@aurel32.net \
--to=aurelien@aurel32.net \
--cc=agraf@suse.de \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).