From: Tom Musta <tommusta@gmail.com>
To: qemu-devel@nongnu.org
Cc: Tom Musta <tommusta@gmail.com>, qemu-ppc@nongnu.org
Subject: [Qemu-devel] [PATCH 28/28] target-ppc: Altivec 2.07: Vector Permute and Exclusive OR
Date: Wed, 12 Feb 2014 15:23:19 -0600 [thread overview]
Message-ID: <1392240199-2454-29-git-send-email-tommusta@gmail.com> (raw)
In-Reply-To: <1392240199-2454-1-git-send-email-tommusta@gmail.com>
This patch adds the Vector Permuate and Exclusive OR (vpermxor)
instruction introduced in Power ISA Version 2.07.
Signed-off-by: Tom Musta <tommusta@gmail.com>
---
target-ppc/helper.h | 1 +
target-ppc/int_helper.c | 14 ++++++++++++++
target-ppc/translate.c | 7 ++++++-
3 files changed, 21 insertions(+), 1 deletions(-)
diff --git a/target-ppc/helper.h b/target-ppc/helper.h
index dc0527b..99f10de 100644
--- a/target-ppc/helper.h
+++ b/target-ppc/helper.h
@@ -323,6 +323,7 @@ DEF_HELPER_3(vncipher, void, avr, avr, avr)
DEF_HELPER_3(vncipherlast, void, avr, avr, avr)
DEF_HELPER_3(vshasigmaw, void, avr, avr, i32)
DEF_HELPER_3(vshasigmad, void, avr, avr, i32)
+DEF_HELPER_4(vpermxor, void, avr, avr, avr, avr)
DEF_HELPER_4(bcdadd, i32, avr, avr, avr, i32)
DEF_HELPER_4(bcdsub, i32, avr, avr, avr, i32)
diff --git a/target-ppc/int_helper.c b/target-ppc/int_helper.c
index e6a7ad0..63dde94 100644
--- a/target-ppc/int_helper.c
+++ b/target-ppc/int_helper.c
@@ -2700,6 +2700,20 @@ void helper_vshasigmad(ppc_avr_t *r, ppc_avr_t *a, uint32_t st_six)
#undef ROTRu64
#undef EL_IDX
+void helper_vpermxor(ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b, ppc_avr_t *c)
+{
+ int i;
+ VECTOR_FOR_INORDER_I(i, u8) {
+ int indexA = c->u8[i] >> 4;
+ int indexB = c->u8[i] & 0xF;
+#if defined(HOST_WORDS_BIGENDIAN)
+ r->u8[i] = a->u8[indexA] ^ b->u8[indexB];
+#else
+ r->u8[i] = a->u8[15-indexA] ^ b->u8[15-indexB];
+#endif
+ }
+}
+
#undef VECTOR_FOR_INORDER_I
#undef HI_IDX
#undef LO_IDX
diff --git a/target-ppc/translate.c b/target-ppc/translate.c
index e48d756..3e2b434 100644
--- a/target-ppc/translate.c
+++ b/target-ppc/translate.c
@@ -7457,6 +7457,10 @@ static void gen_##op(DisasContext *ctx) \
VSHASIGMA(vshasigmaw)
VSHASIGMA(vshasigmad)
+GEN_VXFORM3(vpermxor, 22, 0xFF)
+GEN_VXFORM_DUAL(vsldoi, PPC_ALTIVEC, PPC_NONE,
+ vpermxor, PPC_NONE, PPC2_ALTIVEC_207)
+
/*** VSX extension ***/
static inline TCGv_i64 cpu_vsrh(int n)
@@ -10084,7 +10088,6 @@ GEN_HANDLER(lvsl, 0x1f, 0x06, 0x00, 0x00000001, PPC_ALTIVEC),
GEN_HANDLER(lvsr, 0x1f, 0x06, 0x01, 0x00000001, PPC_ALTIVEC),
GEN_HANDLER(mfvscr, 0x04, 0x2, 0x18, 0x001ff800, PPC_ALTIVEC),
GEN_HANDLER(mtvscr, 0x04, 0x2, 0x19, 0x03ff0000, PPC_ALTIVEC),
-GEN_HANDLER(vsldoi, 0x04, 0x16, 0xFF, 0x00000400, PPC_ALTIVEC),
GEN_HANDLER(vmladduhm, 0x04, 0x11, 0xFF, 0x00000000, PPC_ALTIVEC),
GEN_HANDLER2(evsel0, "evsel", 0x04, 0x1c, 0x09, 0x00000000, PPC_SPE),
GEN_HANDLER2(evsel1, "evsel", 0x04, 0x1d, 0x09, 0x00000000, PPC_SPE),
@@ -10695,6 +10698,8 @@ GEN_VXFORM_DUAL(vncipher, vncipherlast, 4, 21, PPC_NONE, PPC2_ALTIVEC_207),
GEN_VXFORM_207(vshasigmaw, 1, 26),
GEN_VXFORM_207(vshasigmad, 1, 27),
+GEN_VXFORM_DUAL(vsldoi, vpermxor, 22, 0xFF, PPC_ALTIVEC, PPC_NONE),
+
GEN_HANDLER_E(lxsdx, 0x1F, 0x0C, 0x12, 0, PPC_NONE, PPC2_VSX),
GEN_HANDLER_E(lxsiwax, 0x1F, 0x0C, 0x02, 0, PPC_NONE, PPC2_VSX207),
GEN_HANDLER_E(lxsiwzx, 0x1F, 0x0C, 0x00, 0, PPC_NONE, PPC2_VSX207),
--
1.7.1
next prev parent reply other threads:[~2014-02-12 21:25 UTC|newest]
Thread overview: 55+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-12 21:22 [Qemu-devel] [PATCH 00/28] target-ppc: Altivec 2.07 Tom Musta
2014-02-12 21:22 ` [Qemu-devel] [PATCH 01/28] target-ppc: Altivec 2.07: Add Instruction Flag Tom Musta
2014-02-12 21:22 ` [Qemu-devel] [PATCH 02/28] target-ppc: Altivec 2.07: Update AVR Structure Tom Musta
2014-02-12 21:22 ` [Qemu-devel] [PATCH 03/28] target-ppc: Altivec 2.07: Add GEN_VXFORM3 Tom Musta
2014-02-12 21:22 ` [Qemu-devel] [PATCH 04/28] target-ppc: Altivec 2.07: Add Support for Dual Altivec Instructions Tom Musta
2014-02-12 21:22 ` [Qemu-devel] [PATCH 05/28] target-ppc: Altivec 2.07: Add Opcode Macro for VX Form Instructions Tom Musta
2014-02-12 21:22 ` [Qemu-devel] [PATCH 06/28] target-ppc: Altivec 2.07: Add Support for R-Form Dual Instructions Tom Musta
2014-02-12 21:22 ` [Qemu-devel] [PATCH 07/28] target-ppc: Altivec 2.07: Vector Logical Instructions Tom Musta
2014-02-12 21:22 ` [Qemu-devel] [PATCH 08/28] target-ppc: Altivec 2.07: Add/Subtract Unsigned Doubleword Modulo Tom Musta
2014-02-12 21:23 ` [Qemu-devel] [PATCH 09/28] target-ppc: Altivec 2.07: Change VMUL_DO to Support 64-bit Integers Tom Musta
2014-02-12 21:23 ` [Qemu-devel] [PATCH 10/28] target-ppc: Altivec 2.07: Multiply Even/Odd Word Instructions Tom Musta
2014-02-12 21:23 ` [Qemu-devel] [PATCH 11/28] target-ppc: Altivec 2.07: vmuluw Instruction Tom Musta
2014-02-12 21:23 ` [Qemu-devel] [PATCH 12/28] target-ppc: Altivec 2.07: Add Vector Count Leading Zeroes Tom Musta
2014-02-12 21:23 ` [Qemu-devel] [PATCH 13/28] target-ppc: Altivec 2.07: Vector Population Count Instructions Tom Musta
2014-02-12 21:23 ` [Qemu-devel] [PATCH 14/28] target-ppc: Altivec 2.07: Vector Min/Max Doubleword Instructions Tom Musta
2014-02-12 21:23 ` [Qemu-devel] [PATCH 15/28] target-ppc: Altivec 2.07: Pack " Tom Musta
2014-02-12 21:23 ` [Qemu-devel] [PATCH 16/28] target-ppc: Altivec 2.07: Unpack Signed Word Instructions Tom Musta
2014-02-12 21:23 ` [Qemu-devel] [PATCH 17/28] target-ppc: Altivec 2.07: Vector Merge Instructions Tom Musta
2014-02-12 21:23 ` [Qemu-devel] [PATCH 18/28] target-ppc: Altivec 2.07: Change Bit Masks to Support 64-bit Rotates and Shifts Tom Musta
2014-02-12 21:23 ` [Qemu-devel] [PATCH 19/28] target-ppc: Altivec 2.07: Vector Doubleword Rotate and Shift Instructions Tom Musta
2014-02-12 21:23 ` [Qemu-devel] [PATCH 20/28] target-ppc: Altivec 2.07: Quadword Addition and Subtracation Tom Musta
2014-02-12 21:23 ` [Qemu-devel] [PATCH 21/28] target-ppc: Altivec 2.07: vbpermq Instruction Tom Musta
2014-02-12 21:23 ` [Qemu-devel] [PATCH 22/28] target-ppc: Altivec 2.07: Doubleword Compares Tom Musta
2014-02-12 21:23 ` [Qemu-devel] [PATCH 23/28] target-ppc: Altivec 2.07: Vector Gather Bits by Bytes Tom Musta
2014-02-24 17:16 ` Richard Henderson
2014-02-12 21:23 ` [Qemu-devel] [PATCH 24/28] target-ppc: Altivec 2.07: Vector Polynomial Multiply Sum Tom Musta
2014-02-24 18:11 ` Richard Henderson
2014-02-12 21:23 ` [Qemu-devel] [PATCH 25/28] target-ppc: Altivec 2.07: Binary Coded Decimal Instructions Tom Musta
2014-02-12 21:23 ` [Qemu-devel] [PATCH 26/28] target-ppc: Altivec 2.07: AES Instructions Tom Musta
2014-02-24 17:59 ` Richard Henderson
2014-02-24 18:11 ` Peter Maydell
2014-02-24 18:22 ` Richard Henderson
2014-02-26 19:22 ` Tom Musta
2014-02-26 22:06 ` Tom Musta
2014-02-26 22:26 ` Richard Henderson
2014-02-12 21:23 ` [Qemu-devel] [PATCH 27/28] target-ppc: Altivec 2.07: Vector SHA Sigma Instructions Tom Musta
2014-02-12 21:23 ` Tom Musta [this message]
2014-02-18 18:52 ` [Qemu-devel] [PATCH 00/28] target-ppc: Altivec 2.07 Richard W.M. Jones
2014-02-18 23:27 ` Tom Musta
2014-02-20 10:23 ` Richard W.M. Jones
2014-02-20 12:34 ` Richard W.M. Jones
2014-02-20 12:36 ` [Qemu-devel] [Qemu-ppc] " Alexander Graf
2014-02-20 12:47 ` Richard W.M. Jones
2014-02-21 10:55 ` Aneesh Kumar K.V
2014-02-21 11:21 ` Avik Sil
2014-02-21 11:48 ` Alexander Graf
2014-02-21 11:53 ` Peter Maydell
2014-02-21 12:04 ` Alexander Graf
2014-02-21 12:20 ` Peter Maydell
2014-02-26 11:50 ` Nikunj A Dadhania
2014-02-26 11:58 ` Nikunj A Dadhania
2014-02-20 14:44 ` [Qemu-devel] " Thomas Huth
2014-02-20 14:52 ` Richard W.M. Jones
2014-02-24 6:32 ` [Qemu-devel] [Qemu-ppc] " Nikunj A Dadhania
2014-02-20 15:00 ` 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=1392240199-2454-29-git-send-email-tommusta@gmail.com \
--to=tommusta@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).