From: Alexander Graf <agraf@suse.de>
To: qemu-ppc@nongnu.org
Cc: Blue Swirl <blauwirbel@gmail.com>,
qemu-devel@nongnu.org, Aurelien Jarno <aurelien@aurel32.net>
Subject: [Qemu-devel] [PATCH 28/30] target-ppc: emulate load doubleword pair instructions
Date: Fri, 26 Apr 2013 20:21:47 +0200 [thread overview]
Message-ID: <1367000509-8833-29-git-send-email-agraf@suse.de> (raw)
In-Reply-To: <1367000509-8833-1-git-send-email-agraf@suse.de>
From: Aurelien Jarno <aurelien@aurel32.net>
Needed for Power ISA version 2.05 compliance. The check for odd register
pairs is done using the invalid bits.
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Alexander Graf <agraf@suse.de>
---
target-ppc/translate.c | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 48 insertions(+), 0 deletions(-)
diff --git a/target-ppc/translate.c b/target-ppc/translate.c
index 4f92d8f..62f9309 100644
--- a/target-ppc/translate.c
+++ b/target-ppc/translate.c
@@ -3298,6 +3298,52 @@ GEN_LDFS(lfd, ld64, 0x12, PPC_FLOAT);
/* lfs lfsu lfsux lfsx */
GEN_LDFS(lfs, ld32fs, 0x10, PPC_FLOAT);
+/* lfdp */
+static void gen_lfdp(DisasContext *ctx)
+{
+ TCGv EA;
+ if (unlikely(!ctx->fpu_enabled)) {
+ gen_exception(ctx, POWERPC_EXCP_FPU);
+ return;
+ }
+ gen_set_access_type(ctx, ACCESS_FLOAT);
+ EA = tcg_temp_new();
+ gen_addr_imm_index(ctx, EA, 0); \
+ if (unlikely(ctx->le_mode)) {
+ gen_qemu_ld64(ctx, cpu_fpr[rD(ctx->opcode) + 1], EA);
+ tcg_gen_addi_tl(EA, EA, 8);
+ gen_qemu_ld64(ctx, cpu_fpr[rD(ctx->opcode)], EA);
+ } else {
+ gen_qemu_ld64(ctx, cpu_fpr[rD(ctx->opcode)], EA);
+ tcg_gen_addi_tl(EA, EA, 8);
+ gen_qemu_ld64(ctx, cpu_fpr[rD(ctx->opcode) + 1], EA);
+ }
+ tcg_temp_free(EA);
+}
+
+/* lfdpx */
+static void gen_lfdpx(DisasContext *ctx)
+{
+ TCGv EA;
+ if (unlikely(!ctx->fpu_enabled)) {
+ gen_exception(ctx, POWERPC_EXCP_FPU);
+ return;
+ }
+ gen_set_access_type(ctx, ACCESS_FLOAT);
+ EA = tcg_temp_new();
+ gen_addr_reg_index(ctx, EA);
+ if (unlikely(ctx->le_mode)) {
+ gen_qemu_ld64(ctx, cpu_fpr[rD(ctx->opcode) + 1], EA);
+ tcg_gen_addi_tl(EA, EA, 8);
+ gen_qemu_ld64(ctx, cpu_fpr[rD(ctx->opcode)], EA);
+ } else {
+ gen_qemu_ld64(ctx, cpu_fpr[rD(ctx->opcode)], EA);
+ tcg_gen_addi_tl(EA, EA, 8);
+ gen_qemu_ld64(ctx, cpu_fpr[rD(ctx->opcode) + 1], EA);
+ }
+ tcg_temp_free(EA);
+}
+
/* lfiwax */
static void gen_lfiwax(DisasContext *ctx)
{
@@ -9028,6 +9074,8 @@ GEN_LDXF(name, ldop, 0x17, op | 0x00, type)
GEN_LDFS(lfd, ld64, 0x12, PPC_FLOAT)
GEN_LDFS(lfs, ld32fs, 0x10, PPC_FLOAT)
GEN_HANDLER_E(lfiwax, 0x1f, 0x17, 0x1a, 0x00000001, PPC_NONE, PPC2_ISA205),
+GEN_HANDLER_E(lfdp, 0x39, 0xFF, 0xFF, 0x00200003, PPC_NONE, PPC2_ISA205),
+GEN_HANDLER_E(lfdpx, 0x1F, 0x17, 0x18, 0x00200001, PPC_NONE, PPC2_ISA205),
#undef GEN_STF
#undef GEN_STUF
--
1.6.0.2
next prev parent reply other threads:[~2013-04-26 18:22 UTC|newest]
Thread overview: 51+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-26 18:21 [Qemu-devel] [PULL 00/30] ppc patch queue 2013-04-26 Alexander Graf
2013-04-26 18:21 ` [Qemu-devel] [PATCH 01/30] target-ppc: Enable ISEL on POWER7 Alexander Graf
2013-04-26 18:21 ` [Qemu-devel] [PATCH 02/30] PPC: e500: advertise 4.2 MPIC only if KVM supports EPR Alexander Graf
2013-04-26 18:21 ` [Qemu-devel] [PATCH 03/30] PPC: Remove env->hreset_excp_prefix Alexander Graf
2013-04-26 18:21 ` [Qemu-devel] [PATCH 04/30] target-ppc: fix nego and subf*o instructions Alexander Graf
2013-04-26 18:21 ` [Qemu-devel] [PATCH 05/30] PPC: fix hreset_vector for 60x, 7x0, 7x5, G2, MPC8xx, MPC5xx, 7400 and 7450 Alexander Graf
2013-04-28 13:59 ` Andreas Färber
2013-04-29 10:38 ` Fabien Chouteau
2013-04-29 11:37 ` Andreas Färber
2013-04-29 13:05 ` Aurelien Jarno
2013-04-30 15:07 ` [Qemu-devel] [PATCH] Fix PReP NIP reset value Fabien Chouteau
2013-04-30 15:24 ` Alexander Graf
2013-04-30 16:00 ` Fabien Chouteau
2013-04-30 16:06 ` Alexander Graf
2013-04-30 16:23 ` Fabien Chouteau
2013-04-30 16:36 ` Alexander Graf
2013-04-30 19:55 ` Hervé Poussineau
2013-05-02 8:23 ` Fabien Chouteau
2013-05-01 11:16 ` Andreas Färber
2013-04-26 18:21 ` [Qemu-devel] [PATCH 06/30] PPC: Add breakpoint registers for 603 and e300 Alexander Graf
2013-04-26 18:21 ` [Qemu-devel] [PATCH 07/30] target-ppc: Fix narrow-mode add/sub carry output Alexander Graf
2013-04-26 18:21 ` [Qemu-devel] [PATCH 08/30] linux-headers: Update to kvm/queue Alexander Graf
2013-04-26 18:21 ` [Qemu-devel] [PATCH 09/30] Enable kvm emulated watchdog Alexander Graf
2013-04-26 18:21 ` [Qemu-devel] [PATCH 10/30] PPC: mac newworld: fix cpu NIP reset value Alexander Graf
2013-04-26 18:21 ` [Qemu-devel] [PATCH 11/30] PPC: Fix compile with profiling enabled Alexander Graf
2013-04-26 18:21 ` [Qemu-devel] [PATCH 12/30] pseries: Fix incorrect calculation of RMA size in certain configurations Alexander Graf
2013-04-26 18:21 ` [Qemu-devel] [PATCH 13/30] pseries: Fixes and enhancements to L1 cache properties Alexander Graf
2013-04-26 18:21 ` [Qemu-devel] [PATCH 14/30] target-ppc: Add more stubs for POWER7 PMU registers Alexander Graf
2013-04-26 18:21 ` [Qemu-devel] [PATCH 15/30] pseries: Fix some small errors in XICS logic Alexander Graf
2013-04-26 18:21 ` [Qemu-devel] [PATCH 16/30] target-ppc: Synchronize VPA state with KVM Alexander Graf
2013-04-26 18:21 ` [Qemu-devel] [PATCH 17/30] pseries: Convert VIO code to QOM style type safe(ish) casts Alexander Graf
2013-04-26 18:21 ` [Qemu-devel] [PATCH 18/30] pseries: Generate device paths for VIO devices Alexander Graf
2013-04-26 18:21 ` [Qemu-devel] [PATCH 19/30] powerpc: correctly handle fpu exceptions Alexander Graf
2013-04-26 18:21 ` [Qemu-devel] [PATCH 20/30] PPC: Fix dcbz for linux-user on 970 Alexander Graf
2013-04-26 18:21 ` [Qemu-devel] [PATCH 21/30] target-ppc: optimize fabs, fnabs, fneg Alexander Graf
2013-04-26 18:21 ` [Qemu-devel] [PATCH 22/30] disas: Disassemble all ppc insns for the guest Alexander Graf
2013-04-26 18:21 ` [Qemu-devel] [PATCH 23/30] target-ppc: add instruction flags for Book I 2.05 Alexander Graf
2013-04-26 18:21 ` [Qemu-devel] [PATCH 24/30] target-ppc: emulate cmpb instruction Alexander Graf
2013-04-26 18:21 ` [Qemu-devel] [PATCH 25/30] target-ppc: emulate prtyw and prtyd instructions Alexander Graf
2013-04-26 18:21 ` [Qemu-devel] [PATCH 26/30] target-ppc: emulate fcpsgn instruction Alexander Graf
2013-04-26 18:21 ` [Qemu-devel] [PATCH 27/30] target-ppc: emulate lfiwax instruction Alexander Graf
2013-04-26 18:21 ` Alexander Graf [this message]
2013-04-26 18:21 ` [Qemu-devel] [PATCH 29/30] target-ppc: emulate store doubleword pair instructions Alexander Graf
2013-04-26 18:21 ` [Qemu-devel] [PATCH 30/30] target-ppc: add support for extended mtfsf/mtfsfi forms Alexander Graf
2013-04-26 20:09 ` [Qemu-devel] [PULL 00/30] ppc patch queue 2013-04-26 Blue Swirl
2013-04-26 21:03 ` Alexander Graf
2013-04-26 21:17 ` Aurelien Jarno
2013-04-26 21:42 ` Alexander Graf
2013-04-26 23:01 ` Aurelien Jarno
2013-04-26 20:12 ` Blue Swirl
2013-04-26 20:13 ` Blue Swirl
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=1367000509-8833-29-git-send-email-agraf@suse.de \
--to=agraf@suse.de \
--cc=aurelien@aurel32.net \
--cc=blauwirbel@gmail.com \
--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).