From: David Gibson <david@gibson.dropbear.id.au>
To: peter.maydell@linaro.org
Cc: lvivier@redhat.com,
Richard Henderson <richard.henderson@linaro.org>,
qemu-devel@nongnu.org, groug@kaod.org, qemu-ppc@nongnu.org,
clg@kaod.org, David Gibson <david@gibson.dropbear.id.au>
Subject: [Qemu-devel] [PULL 22/38] target/ppc: Use vector variable shifts for VSL, VSR, VSRA
Date: Wed, 22 May 2019 14:45:44 +1000 [thread overview]
Message-ID: <20190522044600.16534-23-david@gibson.dropbear.id.au> (raw)
In-Reply-To: <20190522044600.16534-1-david@gibson.dropbear.id.au>
From: Richard Henderson <richard.henderson@linaro.org>
The gvec expanders take care of masking the shift amount
against the element width.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20190518191430.21686-2-richard.henderson@linaro.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
---
target/ppc/helper.h | 12 ----------
target/ppc/int_helper.c | 37 -----------------------------
target/ppc/translate/vmx-impl.inc.c | 24 +++++++++----------
3 files changed, 12 insertions(+), 61 deletions(-)
diff --git a/target/ppc/helper.h b/target/ppc/helper.h
index 638a6e99c4..02b67a333e 100644
--- a/target/ppc/helper.h
+++ b/target/ppc/helper.h
@@ -180,18 +180,6 @@ DEF_HELPER_3(vmuloub, void, avr, avr, avr)
DEF_HELPER_3(vmulouh, void, avr, avr, avr)
DEF_HELPER_3(vmulouw, void, avr, avr, avr)
DEF_HELPER_3(vmuluwm, void, avr, avr, avr)
-DEF_HELPER_3(vsrab, void, avr, avr, avr)
-DEF_HELPER_3(vsrah, void, avr, avr, avr)
-DEF_HELPER_3(vsraw, void, avr, avr, avr)
-DEF_HELPER_3(vsrad, void, avr, avr, avr)
-DEF_HELPER_3(vsrb, void, avr, avr, avr)
-DEF_HELPER_3(vsrh, void, avr, avr, avr)
-DEF_HELPER_3(vsrw, void, avr, avr, avr)
-DEF_HELPER_3(vsrd, void, avr, avr, avr)
-DEF_HELPER_3(vslb, void, avr, avr, avr)
-DEF_HELPER_3(vslh, void, avr, avr, avr)
-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(vsrv, void, avr, avr, avr)
diff --git a/target/ppc/int_helper.c b/target/ppc/int_helper.c
index f5c81acd53..0b22774a9d 100644
--- a/target/ppc/int_helper.c
+++ b/target/ppc/int_helper.c
@@ -1776,23 +1776,6 @@ VSHIFT(l, 1)
VSHIFT(r, 0)
#undef VSHIFT
-#define VSL(suffix, element, mask) \
- void helper_vsl##suffix(ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) \
- { \
- int i; \
- \
- for (i = 0; i < ARRAY_SIZE(r->element); i++) { \
- unsigned int shift = b->element[i] & mask; \
- \
- r->element[i] = a->element[i] << shift; \
- } \
- }
-VSL(b, u8, 0x7)
-VSL(h, u16, 0x0F)
-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;
@@ -1965,26 +1948,6 @@ VNEG(vnegw, s32)
VNEG(vnegd, s64)
#undef VNEG
-#define VSR(suffix, element, mask) \
- void helper_vsr##suffix(ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) \
- { \
- int i; \
- \
- for (i = 0; i < ARRAY_SIZE(r->element); i++) { \
- unsigned int shift = b->element[i] & mask; \
- r->element[i] = a->element[i] >> shift; \
- } \
- }
-VSR(ab, s8, 0x7)
-VSR(ah, s16, 0xF)
-VSR(aw, s32, 0x1F)
-VSR(ad, s64, 0x3F)
-VSR(b, u8, 0x7)
-VSR(h, u16, 0xF)
-VSR(w, u32, 0x1F)
-VSR(d, u64, 0x3F)
-#undef VSR
-
void helper_vsro(ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b)
{
int sh = (b->VsrB(0xf) >> 3) & 0xf;
diff --git a/target/ppc/translate/vmx-impl.inc.c b/target/ppc/translate/vmx-impl.inc.c
index 6861f4c5b9..663275b729 100644
--- a/target/ppc/translate/vmx-impl.inc.c
+++ b/target/ppc/translate/vmx-impl.inc.c
@@ -530,21 +530,21 @@ GEN_VXFORM(vmuleuw, 4, 10);
GEN_VXFORM(vmulesb, 4, 12);
GEN_VXFORM(vmulesh, 4, 13);
GEN_VXFORM(vmulesw, 4, 14);
-GEN_VXFORM(vslb, 2, 4);
-GEN_VXFORM(vslh, 2, 5);
-GEN_VXFORM(vslw, 2, 6);
+GEN_VXFORM_V(vslb, MO_8, tcg_gen_gvec_shlv, 2, 4);
+GEN_VXFORM_V(vslh, MO_16, tcg_gen_gvec_shlv, 2, 5);
+GEN_VXFORM_V(vslw, MO_32, tcg_gen_gvec_shlv, 2, 6);
GEN_VXFORM(vrlwnm, 2, 6);
GEN_VXFORM_DUAL(vslw, PPC_ALTIVEC, PPC_NONE, \
vrlwnm, PPC_NONE, PPC2_ISA300)
-GEN_VXFORM(vsld, 2, 23);
-GEN_VXFORM(vsrb, 2, 8);
-GEN_VXFORM(vsrh, 2, 9);
-GEN_VXFORM(vsrw, 2, 10);
-GEN_VXFORM(vsrd, 2, 27);
-GEN_VXFORM(vsrab, 2, 12);
-GEN_VXFORM(vsrah, 2, 13);
-GEN_VXFORM(vsraw, 2, 14);
-GEN_VXFORM(vsrad, 2, 15);
+GEN_VXFORM_V(vsld, MO_64, tcg_gen_gvec_shlv, 2, 23);
+GEN_VXFORM_V(vsrb, MO_8, tcg_gen_gvec_shrv, 2, 8);
+GEN_VXFORM_V(vsrh, MO_16, tcg_gen_gvec_shrv, 2, 9);
+GEN_VXFORM_V(vsrw, MO_32, tcg_gen_gvec_shrv, 2, 10);
+GEN_VXFORM_V(vsrd, MO_64, tcg_gen_gvec_shrv, 2, 27);
+GEN_VXFORM_V(vsrab, MO_8, tcg_gen_gvec_sarv, 2, 12);
+GEN_VXFORM_V(vsrah, MO_16, tcg_gen_gvec_sarv, 2, 13);
+GEN_VXFORM_V(vsraw, MO_32, tcg_gen_gvec_sarv, 2, 14);
+GEN_VXFORM_V(vsrad, MO_64, tcg_gen_gvec_sarv, 2, 15);
GEN_VXFORM(vsrv, 2, 28);
GEN_VXFORM(vslv, 2, 29);
GEN_VXFORM(vslo, 6, 16);
--
2.21.0
next prev parent reply other threads:[~2019-05-22 5:18 UTC|newest]
Thread overview: 47+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-22 4:45 [Qemu-devel] [PULL 00/38] ppc-for-4.1 queue 20190522 David Gibson
2019-05-22 4:45 ` [Qemu-devel] [PULL 01/38] target/ppc/kvm: Fix trace typo David Gibson
2019-05-22 4:45 ` [Qemu-devel] [PULL 02/38] configure: Distinguish ppc64 and ppc64le hosts David Gibson
2019-05-22 4:45 ` [Qemu-devel] [PULL 03/38] configure: Use quotes around uses of $CPU_CFLAGS David Gibson
2019-05-22 4:45 ` [Qemu-devel] [PULL 04/38] hw/ppc/prep: use TYPE_MC146818_RTC instead of a hardcoded string David Gibson
2019-05-22 4:45 ` [Qemu-devel] [PULL 05/38] hw/ppc/40p: Move the MC146818 RTC to the board where it belongs David Gibson
2019-05-22 4:45 ` [Qemu-devel] [PULL 06/38] hw/ppc/40p: use 1900 as a base year David Gibson
2019-05-22 4:45 ` [Qemu-devel] [PULL 07/38] target/ppc: Add ibm, purr and ibm, spurr device-tree properties David Gibson
2019-05-22 4:45 ` [Qemu-devel] [PULL 08/38] target/ppc: Fix xvxsigdp David Gibson
2019-05-22 4:45 ` [Qemu-devel] [PULL 09/38] target/ppc: Fix xxbrq, xxbrw David Gibson
2019-05-22 4:45 ` [Qemu-devel] [PULL 10/38] target/ppc: Fix vslv and vsrv David Gibson
2019-05-22 4:45 ` [Qemu-devel] [PULL 11/38] target/ppc: Fix vsum2sws David Gibson
2019-05-22 4:45 ` [Qemu-devel] [PULL 12/38] target/ppc: Fix xxspltib David Gibson
2019-05-22 4:45 ` [Qemu-devel] [PULL 13/38] spapr/xive: EQ page should be naturally aligned David Gibson
2019-05-22 4:45 ` [Qemu-devel] [PULL 14/38] spapr/xive: fix EQ page addresses above 64GB David Gibson
2019-05-22 4:45 ` [Qemu-devel] [PULL 15/38] spapr/xive: print out the EQ page address in the monitor David Gibson
2019-05-22 4:45 ` [Qemu-devel] [PULL 16/38] Fix typo on "info pic" monitor cmd output for xive David Gibson
2019-05-22 4:45 ` [Qemu-devel] [PULL 17/38] target/ppc: Optimise VSX_LOAD_SCALAR_DS and VSX_VECTOR_LOAD_STORE David Gibson
2019-05-22 4:45 ` [Qemu-devel] [PULL 18/38] target/ppc: Fix xvabs[sd]p, xvnabs[sd]p, xvneg[sd]p, xvcpsgn[sd]p David Gibson
2019-05-22 4:45 ` [Qemu-devel] [PULL 19/38] spapr/xive: Sanity checks of OV5 during CAS David Gibson
2019-05-22 4:45 ` [Qemu-devel] [PULL 20/38] target/ppc: Set PSSCR_EC on cpu halt to prevent spurious wakeup David Gibson
2019-05-22 4:45 ` [Qemu-devel] [PULL 21/38] spapr: Add forgotten capability to migration stream David Gibson
2019-05-22 7:58 ` Greg Kurz
2019-05-22 11:10 ` David Gibson
2019-05-22 12:22 ` Greg Kurz
2019-05-22 4:45 ` David Gibson [this message]
2019-05-22 4:45 ` [Qemu-devel] [PULL 23/38] spapr: Fix phb_placement backwards compatibility David Gibson
2019-05-22 4:45 ` [Qemu-devel] [PULL 24/38] spapr: Print out extra hints when CAS negotiation of interrupt mode fails David Gibson
2019-05-22 4:45 ` [Qemu-devel] [PULL 25/38] spapr/xive: add KVM support David Gibson
2019-05-22 4:45 ` [Qemu-devel] [PULL 26/38] spapr/xive: add hcall support when under KVM David Gibson
2019-05-22 4:45 ` [Qemu-devel] [PULL 27/38] spapr/xive: add state synchronization with KVM David Gibson
2019-05-22 4:45 ` [Qemu-devel] [PULL 28/38] spapr/xive: introduce a VM state change handler David Gibson
2019-05-22 4:45 ` [Qemu-devel] [PULL 29/38] spapr/xive: add migration support for KVM David Gibson
2019-05-22 4:45 ` [Qemu-devel] [PULL 30/38] spapr/xive: activate KVM support David Gibson
2019-05-22 4:45 ` [Qemu-devel] [PULL 31/38] sysbus: add a sysbus_mmio_unmap() helper David Gibson
2019-05-22 4:45 ` [Qemu-devel] [PULL 32/38] spapr: introduce routines to delete the KVM IRQ device David Gibson
2019-05-22 4:45 ` [Qemu-devel] [PULL 33/38] spapr: check for the activation of " David Gibson
2019-05-22 4:45 ` [Qemu-devel] [PULL 34/38] spapr/irq: introduce a spapr_irq_init_device() helper David Gibson
2019-05-22 4:45 ` [Qemu-devel] [PULL 35/38] spapr/irq: initialize the IRQ device only once David Gibson
2019-05-22 4:45 ` [Qemu-devel] [PULL 36/38] ppc/xics: fix irq priority in ics_set_irq_type() David Gibson
2019-05-22 4:45 ` [Qemu-devel] [PULL 37/38] spapr/irq: add KVM support to the 'dual' machine David Gibson
2019-05-22 4:46 ` [Qemu-devel] [PULL 38/38] docs: provide documentation on the POWER9 XIVE interrupt controller David Gibson
2019-05-23 9:29 ` [Qemu-devel] [PULL 00/38] ppc-for-4.1 queue 20190522 Peter Maydell
2019-05-24 0:46 ` David Gibson
2019-05-24 2:17 ` David Gibson
2019-05-24 6:30 ` David Gibson
-- strict thread matches above, loose matches on Subject: below --
2019-05-21 6:28 [Qemu-devel] [PULL 00/38] ppc-for-4.1 queue 20190521 David Gibson
2019-05-21 6:29 ` [Qemu-devel] [PULL 22/38] target/ppc: Use vector variable shifts for VSL, VSR, VSRA David Gibson
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=20190522044600.16534-23-david@gibson.dropbear.id.au \
--to=david@gibson.dropbear.id.au \
--cc=clg@kaod.org \
--cc=groug@kaod.org \
--cc=lvivier@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=richard.henderson@linaro.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).