From: David Gibson <david@gibson.dropbear.id.au>
To: peter.maydell@linaro.org
Cc: agraf@suse.de, thuth@redhat.com, lvivier@redhat.com,
benh@kernel.crashing.org, qemu-devel@nongnu.org,
qemu-ppc@nongnu.org, Vivek Andrew Sha <vivekandrewsha@gmail.com>,
Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>,
David Gibson <david@gibson.dropbear.id.au>
Subject: [Qemu-devel] [PULL 49/64] target-ppc: add vslv instruction
Date: Wed, 7 Sep 2016 20:29:28 +1000 [thread overview]
Message-ID: <1473244183-31510-50-git-send-email-david@gibson.dropbear.id.au> (raw)
In-Reply-To: <1473244183-31510-1-git-send-email-david@gibson.dropbear.id.au>
From: Vivek Andrew Sha <vivekandrewsha@gmail.com>
vslv: Vector Shift Left Variable
Signed-off-by: Vivek Andrew Sha <vivekandrewsha@gmail.com>
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
---
target-ppc/helper.h | 1 +
target-ppc/int_helper.c | 14 ++++++++++++++
target-ppc/translate/vmx-impl.c | 1 +
target-ppc/translate/vmx-ops.c | 4 ++++
4 files changed, 20 insertions(+)
diff --git a/target-ppc/helper.h b/target-ppc/helper.h
index e93b84b..9703f85 100644
--- a/target-ppc/helper.h
+++ b/target-ppc/helper.h
@@ -211,6 +211,7 @@ DEF_HELPER_3(vslw, void, avr, avr, avr)
DEF_HELPER_3(vsld, void, avr, avr, avr)
DEF_HELPER_3(vslo, void, avr, avr, avr)
DEF_HELPER_3(vsro, void, avr, avr, avr)
+DEF_HELPER_3(vslv, void, avr, avr, avr)
DEF_HELPER_3(vaddcuw, void, avr, avr, avr)
DEF_HELPER_3(vsubcuw, void, avr, avr, avr)
DEF_HELPER_2(lvsl, void, avr, tl)
diff --git a/target-ppc/int_helper.c b/target-ppc/int_helper.c
index 9b4de69..12fe144 100644
--- a/target-ppc/int_helper.c
+++ b/target-ppc/int_helper.c
@@ -1696,6 +1696,20 @@ VSL(w, u32, 0x1F)
VSL(d, u64, 0x3F)
#undef VSL
+void helper_vslv(ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b)
+{
+ int i;
+ unsigned int shift, bytes, size;
+
+ size = ARRAY_SIZE(r->u8);
+ for (i = 0; i < size; i++) {
+ shift = b->u8[i] & 0x7; /* extract shift value */
+ bytes = (a->u8[i] << 8) + /* extract adjacent bytes */
+ (((i + 1) < size) ? a->u8[i + 1] : 0);
+ r->u8[i] = (bytes << shift) >> 8; /* shift and store result */
+ }
+}
+
void helper_vsldoi(ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b, uint32_t shift)
{
int sh = shift & 0xf;
diff --git a/target-ppc/translate/vmx-impl.c b/target-ppc/translate/vmx-impl.c
index 5cd007e..e979668 100644
--- a/target-ppc/translate/vmx-impl.c
+++ b/target-ppc/translate/vmx-impl.c
@@ -383,6 +383,7 @@ GEN_VXFORM(vsrab, 2, 12);
GEN_VXFORM(vsrah, 2, 13);
GEN_VXFORM(vsraw, 2, 14);
GEN_VXFORM(vsrad, 2, 15);
+GEN_VXFORM(vslv, 2, 29);
GEN_VXFORM(vslo, 6, 16);
GEN_VXFORM(vsro, 6, 17);
GEN_VXFORM(vaddcuw, 0, 6);
diff --git a/target-ppc/translate/vmx-ops.c b/target-ppc/translate/vmx-ops.c
index 0be6989..61e08b2 100644
--- a/target-ppc/translate/vmx-ops.c
+++ b/target-ppc/translate/vmx-ops.c
@@ -38,6 +38,9 @@ GEN_HANDLER(name, 0x04, opc2, opc3, 0x00000000, PPC_ALTIVEC)
#define GEN_VXFORM_207(name, opc2, opc3) \
GEN_HANDLER_E(name, 0x04, opc2, opc3, 0x00000000, PPC_NONE, PPC2_ALTIVEC_207)
+#define GEN_VXFORM_300(name, opc2, opc3) \
+GEN_HANDLER_E(name, 0x04, opc2, opc3, 0x00000000, PPC_NONE, PPC2_ISA300)
+
#define GEN_VXFORM_DUAL(name0, name1, opc2, opc3, type0, type1) \
GEN_HANDLER_E(name0##_##name1, 0x4, opc2, opc3, 0x00000000, type0, type1)
@@ -107,6 +110,7 @@ GEN_VXFORM(vsrab, 2, 12),
GEN_VXFORM(vsrah, 2, 13),
GEN_VXFORM(vsraw, 2, 14),
GEN_VXFORM_207(vsrad, 2, 15),
+GEN_VXFORM_300(vslv, 2, 29),
GEN_VXFORM(vslo, 6, 16),
GEN_VXFORM(vsro, 6, 17),
GEN_VXFORM(vaddcuw, 0, 6),
--
2.7.4
next prev parent reply other threads:[~2016-09-07 10:28 UTC|newest]
Thread overview: 72+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-07 10:28 [Qemu-devel] [PULL 00/64] ppc-for-2.8 queue 20160907 David Gibson
2016-09-07 10:28 ` [Qemu-devel] [PULL 01/64] xics_kvm: drop extra checking of kernel_xics_fd David Gibson
2016-09-07 10:28 ` [Qemu-devel] [PULL 02/64] hw/ppc: include fdt helper routine in a common file David Gibson
2016-09-07 10:28 ` [Qemu-devel] [PULL 03/64] target-ppc: Introduce Power9 family David Gibson
2016-09-07 10:28 ` [Qemu-devel] [PULL 04/64] target-ppc: Introduce POWER ISA 3.0 flag David Gibson
2016-09-07 10:28 ` [Qemu-devel] [PULL 05/64] target-ppc: adding addpcis instruction David Gibson
2016-09-07 10:28 ` [Qemu-devel] [PULL 06/64] target-ppc: add cmprb instruction David Gibson
2016-09-07 10:28 ` [Qemu-devel] [PULL 07/64] target-ppc: add modulo word operations David Gibson
2016-09-07 10:28 ` [Qemu-devel] [PULL 08/64] target-ppc: add modulo dword operations David Gibson
2016-09-07 10:28 ` [Qemu-devel] [PULL 09/64] target-ppc: add cnttzd[.] instruction David Gibson
2016-09-07 10:28 ` [Qemu-devel] [PULL 10/64] target-ppc: add cnttzw[.] instruction David Gibson
2016-09-07 10:28 ` [Qemu-devel] [PULL 11/64] target-ppc: add cmpeqb instruction David Gibson
2016-09-07 10:28 ` [Qemu-devel] [PULL 12/64] target-ppc: add setb instruction David Gibson
2016-09-07 10:28 ` [Qemu-devel] [PULL 13/64] target-ppc: add maddld instruction David Gibson
2016-09-07 10:28 ` [Qemu-devel] [PULL 14/64] target-ppc: add maddhd and maddhdu instruction David Gibson
2016-09-07 10:28 ` [Qemu-devel] [PULL 15/64] target-ppc: introduce opc4 for Expanded Opcode David Gibson
2016-09-07 10:28 ` [Qemu-devel] [PULL 16/64] ppc: Provide basic raise_exception_* functions David Gibson
2016-09-07 10:28 ` [Qemu-devel] [PULL 17/64] ppc: Move classic fp ops out of translate.c David Gibson
2016-09-07 10:28 ` [Qemu-devel] [PULL 18/64] ppc: Move embedded spe " David Gibson
2016-09-07 10:28 ` [Qemu-devel] [PULL 19/64] ppc: Move DFP " David Gibson
2016-09-07 10:28 ` [Qemu-devel] [PULL 20/64] ppc: Move VMX " David Gibson
2016-09-07 10:29 ` [Qemu-devel] [PULL 21/64] ppc: Move VSX " David Gibson
2016-09-07 10:29 ` [Qemu-devel] [PULL 22/64] ppc: Rename fload_invalid_op_excp to float_invalid_op_excp David Gibson
2016-09-07 10:29 ` [Qemu-devel] [PULL 23/64] ppc: Make float_invalid_op_excp() pass the return address David Gibson
2016-09-07 10:29 ` [Qemu-devel] [PULL 24/64] ppc: Make float_check_status() " David Gibson
2016-09-07 10:29 ` [Qemu-devel] [PULL 25/64] ppc: Don't update the NIP in floating point generated code David Gibson
2016-09-07 10:29 ` [Qemu-devel] [PULL 26/64] ppc: FP exceptions are always precise David Gibson
2016-09-07 10:29 ` [Qemu-devel] [PULL 27/64] ppc: Don't update NIP in lswi/lswx/stswi/stswx David Gibson
2016-09-07 10:29 ` [Qemu-devel] [PULL 28/64] ppc: Don't update NIP in lmw/stmw/icbi David Gibson
2016-09-07 10:29 ` [Qemu-devel] [PULL 29/64] ppc: Make tlb_fill() use new exception helper David Gibson
2016-09-07 10:29 ` [Qemu-devel] [PULL 30/64] ppc: Fix source NIP on SLB related interrupts David Gibson
2016-09-07 10:29 ` [Qemu-devel] [PULL 31/64] ppc: Don't update NIP in DCR access routines David Gibson
2016-09-07 10:29 ` [Qemu-devel] [PULL 32/64] ppc: Don't update NIP in facility unavailable interrupts David Gibson
2016-09-07 10:29 ` [Qemu-devel] [PULL 33/64] ppc: Don't update NIP BookE 2.06 tlbwe David Gibson
2016-09-07 10:29 ` [Qemu-devel] [PULL 34/64] ppc: Don't update NIP on conditional trap instructions David Gibson
2016-09-07 10:29 ` [Qemu-devel] [PULL 35/64] ppc: Don't update NIP if not taking alignment exceptions David Gibson
2016-09-07 10:29 ` [Qemu-devel] [PULL 36/64] ppc: Don't update NIP in dcbz and lscbx David Gibson
2016-09-07 10:29 ` [Qemu-devel] [PULL 37/64] ppc: Make alignment exceptions suck less David Gibson
2016-09-07 10:29 ` [Qemu-devel] [PULL 38/64] ppc: Handle unconditional (always/never) traps at translation time David Gibson
2016-09-07 10:29 ` [Qemu-devel] [PULL 39/64] ppc: Speed up dcbz David Gibson
2016-09-07 10:29 ` [Qemu-devel] [PULL 40/64] ppc: Fix CFAR updates David Gibson
2016-09-07 10:29 ` [Qemu-devel] [PULL 41/64] ppc: Don't set access_type on all load/stores on hash64 David Gibson
2016-09-07 10:29 ` [Qemu-devel] [PULL 42/64] ppc: Use a helper to generate "LE unsupported" alignment interrupts David Gibson
2016-09-07 10:29 ` [Qemu-devel] [PULL 43/64] ppc: load/store multiple and string insns don't do LE David Gibson
2016-09-07 10:29 ` [Qemu-devel] [PULL 44/64] target-ppc: implement branch-less divw[o][.] David Gibson
2016-09-07 10:29 ` [Qemu-devel] [PULL 45/64] target-ppc: implement branch-less divd[o][.] David Gibson
2016-09-07 10:29 ` [Qemu-devel] [PULL 46/64] target-ppc: add dtstsfi[q] instructions David Gibson
2016-09-07 10:29 ` [Qemu-devel] [PULL 47/64] target-ppc: add vabsdu[b, h, w] instructions David Gibson
2016-09-07 10:29 ` [Qemu-devel] [PULL 48/64] target-ppc: add vcmpnez[b, h, w][.] instructions David Gibson
2016-09-07 10:29 ` David Gibson [this message]
2016-09-07 10:29 ` [Qemu-devel] [PULL 50/64] target-ppc: add vsrv instruction David Gibson
2016-09-07 10:29 ` [Qemu-devel] [PULL 51/64] target-ppc: add extswsli[.] instruction David Gibson
2016-09-07 10:29 ` [Qemu-devel] [PULL 52/64] ppc: Rename #include'd .c files to .inc.c David Gibson
2016-09-07 10:29 ` [Qemu-devel] [PULL 53/64] hw/ppc: use error_report instead of fprintf David Gibson
2016-09-07 10:29 ` [Qemu-devel] [PULL 54/64] hw/ppc: add a ppc_create_page_sizes_prop() helper routine David Gibson
2016-09-14 13:59 ` Alex Bennée
2016-09-14 14:33 ` Cédric Le Goater
2016-09-14 14:40 ` Cédric Le Goater
2016-09-07 10:29 ` [Qemu-devel] [PULL 55/64] ppc: Fix macio ESCC legacy mapping David Gibson
2016-09-07 10:29 ` [Qemu-devel] [PULL 56/64] ppc: Fix catching some segfaults in user mode David Gibson
2016-09-07 10:29 ` [Qemu-devel] [PULL 57/64] ppc: Stop dumping state on all exceptions in linux-user David Gibson
2016-09-07 10:29 ` [Qemu-devel] [PULL 58/64] ppc: Don't generate dead code on unconditional branches David Gibson
2016-09-07 10:29 ` [Qemu-devel] [PULL 59/64] ppc: Improve flags for helpers loading/writing the time facilities David Gibson
2016-09-07 10:29 ` [Qemu-devel] [PULL 60/64] ppc: Improve the exception helpers flags David Gibson
2016-09-07 10:29 ` [Qemu-devel] [PULL 61/64] ppc: Improve a few more helper flags David Gibson
2016-09-07 10:29 ` [Qemu-devel] [PULL 62/64] spapr: implement H_CHANGE_LOGICAL_LAN_MAC h_call David Gibson
2016-09-07 10:29 ` [Qemu-devel] [PULL 63/64] tests: Resort check-qtest entries in Makefile.include David Gibson
2016-09-07 10:29 ` [Qemu-devel] [PULL 64/64] tests: Check serial output of firmware boot of some machines David Gibson
2016-09-07 12:02 ` [Qemu-devel] [PULL 00/64] ppc-for-2.8 queue 20160907 no-reply
2016-09-08 11:07 ` Peter Maydell
2016-09-14 14:00 ` Alex Bennée
2016-09-14 14:21 ` Paolo Bonzini
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=1473244183-31510-50-git-send-email-david@gibson.dropbear.id.au \
--to=david@gibson.dropbear.id.au \
--cc=agraf@suse.de \
--cc=benh@kernel.crashing.org \
--cc=lvivier@redhat.com \
--cc=nikunj@linux.vnet.ibm.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=thuth@redhat.com \
--cc=vivekandrewsha@gmail.com \
/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).