[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PATCH 28/28] target-ppc: Altivec 2.07: Vector Permute and Ex
From: |
Tom Musta |
Subject: |
[Qemu-ppc] [PATCH 28/28] target-ppc: Altivec 2.07: Vector Permute and Exclusive OR |
Date: |
Wed, 12 Feb 2014 15:23:19 -0600 |
This patch adds the Vector Permuate and Exclusive OR (vpermxor)
instruction introduced in Power ISA Version 2.07.
Signed-off-by: Tom Musta <address@hidden>
---
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
- [Qemu-ppc] [PATCH 17/28] target-ppc: Altivec 2.07: Vector Merge Instructions, (continued)
- [Qemu-ppc] [PATCH 17/28] target-ppc: Altivec 2.07: Vector Merge Instructions, Tom Musta, 2014/02/12
- [Qemu-ppc] [PATCH 16/28] target-ppc: Altivec 2.07: Unpack Signed Word Instructions, Tom Musta, 2014/02/12
- [Qemu-ppc] [PATCH 20/28] target-ppc: Altivec 2.07: Quadword Addition and Subtracation, Tom Musta, 2014/02/12
- [Qemu-ppc] [PATCH 21/28] target-ppc: Altivec 2.07: vbpermq Instruction, Tom Musta, 2014/02/12
- [Qemu-ppc] [PATCH 22/28] target-ppc: Altivec 2.07: Doubleword Compares, Tom Musta, 2014/02/12
- [Qemu-ppc] [PATCH 23/28] target-ppc: Altivec 2.07: Vector Gather Bits by Bytes, Tom Musta, 2014/02/12
- [Qemu-ppc] [PATCH 24/28] target-ppc: Altivec 2.07: Vector Polynomial Multiply Sum, Tom Musta, 2014/02/12
- [Qemu-ppc] [PATCH 25/28] target-ppc: Altivec 2.07: Binary Coded Decimal Instructions, Tom Musta, 2014/02/12
- [Qemu-ppc] [PATCH 26/28] target-ppc: Altivec 2.07: AES Instructions, Tom Musta, 2014/02/12
- [Qemu-ppc] [PATCH 27/28] target-ppc: Altivec 2.07: Vector SHA Sigma Instructions, Tom Musta, 2014/02/12
- [Qemu-ppc] [PATCH 28/28] target-ppc: Altivec 2.07: Vector Permute and Exclusive OR,
Tom Musta <=
- [Qemu-ppc] [PATCH 19/28] target-ppc: Altivec 2.07: Vector Doubleword Rotate and Shift Instructions, Tom Musta, 2014/02/12
- [Qemu-ppc] [PATCH 18/28] target-ppc: Altivec 2.07: Change Bit Masks to Support 64-bit Rotates and Shifts, Tom Musta, 2014/02/12
- Re: [Qemu-ppc] [Qemu-devel] [PATCH 00/28] target-ppc: Altivec 2.07, Richard W.M. Jones, 2014/02/18
- Re: [Qemu-ppc] [Qemu-devel] [PATCH 00/28] target-ppc: Altivec 2.07, Tom Musta, 2014/02/18
- Re: [Qemu-ppc] [Qemu-devel] [PATCH 00/28] target-ppc: Altivec 2.07, Richard W.M. Jones, 2014/02/20
- Re: [Qemu-ppc] [Qemu-devel] [PATCH 00/28] target-ppc: Altivec 2.07, Richard W.M. Jones, 2014/02/20
- Re: [Qemu-ppc] [Qemu-devel] [PATCH 00/28] target-ppc: Altivec 2.07, Alexander Graf, 2014/02/20
- Re: [Qemu-ppc] [Qemu-devel] [PATCH 00/28] target-ppc: Altivec 2.07, Richard W.M. Jones, 2014/02/20
- Re: [Qemu-ppc] [Qemu-devel] [PATCH 00/28] target-ppc: Altivec 2.07, Aneesh Kumar K.V, 2014/02/21
- Re: [Qemu-ppc] [Qemu-devel] [PATCH 00/28] target-ppc: Altivec 2.07, Avik Sil, 2014/02/21