From: David Gibson <david@gibson.dropbear.id.au>
To: Rajalakshmi Srinivasaraghavan <raji@linux.vnet.ibm.com>
Cc: qemu-ppc@nongnu.org, rth@twiddle.net, qemu-devel@nongnu.org,
nikunj@linux.vnet.ibm.com, benh@kernel.crashing.org
Subject: Re: [Qemu-devel] [PATCH 5/6] target-ppc: add vector compare not equal instructions
Date: Thu, 29 Sep 2016 12:22:51 +1000 [thread overview]
Message-ID: <20160929022251.GG8390@umbus.fritz.box> (raw)
In-Reply-To: <1475041518-9757-6-git-send-email-raji@linux.vnet.ibm.com>
[-- Attachment #1: Type: text/plain, Size: 7802 bytes --]
On Wed, Sep 28, 2016 at 11:15:17AM +0530, Rajalakshmi Srinivasaraghavan wrote:
> The following vector compare not equal instructions are added from ISA 3.0.
>
> vcmpneb - Vector Compare Not Equal Byte
> vcmpneh - Vector Compare Not Equal Halfword
> vcmpnew - Vector Compare Not Equal Word
>
> Signed-off-by: Rajalakshmi Srinivasaraghavan
> <raji@linux.vnet.ibm.com>
Applied to ppc-for-2.8.
> ---
> target-ppc/helper.h | 6 ++++++
> target-ppc/int_helper.c | 31 +++++++++++++++++++------------
> target-ppc/translate/vmx-impl.inc.c | 11 ++++++++++-
> target-ppc/translate/vmx-ops.inc.c | 6 +++---
> 4 files changed, 38 insertions(+), 16 deletions(-)
>
> diff --git a/target-ppc/helper.h b/target-ppc/helper.h
> index aef2f30..9c3095f 100644
> --- a/target-ppc/helper.h
> +++ b/target-ppc/helper.h
> @@ -147,6 +147,9 @@ DEF_HELPER_4(vcmpequb, void, env, avr, avr, avr)
> DEF_HELPER_4(vcmpequh, void, env, avr, avr, avr)
> DEF_HELPER_4(vcmpequw, void, env, avr, avr, avr)
> DEF_HELPER_4(vcmpequd, void, env, avr, avr, avr)
> +DEF_HELPER_4(vcmpneb, void, env, avr, avr, avr)
> +DEF_HELPER_4(vcmpneh, void, env, avr, avr, avr)
> +DEF_HELPER_4(vcmpnew, void, env, avr, avr, avr)
> DEF_HELPER_4(vcmpnezb, void, env, avr, avr, avr)
> DEF_HELPER_4(vcmpnezh, void, env, avr, avr, avr)
> DEF_HELPER_4(vcmpnezw, void, env, avr, avr, avr)
> @@ -166,6 +169,9 @@ DEF_HELPER_4(vcmpequb_dot, void, env, avr, avr, avr)
> DEF_HELPER_4(vcmpequh_dot, void, env, avr, avr, avr)
> DEF_HELPER_4(vcmpequw_dot, void, env, avr, avr, avr)
> DEF_HELPER_4(vcmpequd_dot, void, env, avr, avr, avr)
> +DEF_HELPER_4(vcmpneb_dot, void, env, avr, avr, avr)
> +DEF_HELPER_4(vcmpneh_dot, void, env, avr, avr, avr)
> +DEF_HELPER_4(vcmpnew_dot, void, env, avr, avr, avr)
> DEF_HELPER_4(vcmpnezb_dot, void, env, avr, avr, avr)
> DEF_HELPER_4(vcmpnezh_dot, void, env, avr, avr, avr)
> DEF_HELPER_4(vcmpnezw_dot, void, env, avr, avr, avr)
> diff --git a/target-ppc/int_helper.c b/target-ppc/int_helper.c
> index 09a1799..f132f7b 100644
> --- a/target-ppc/int_helper.c
> +++ b/target-ppc/int_helper.c
> @@ -735,20 +735,24 @@ VCMP(gtsd, >, s64)
> #undef VCMP_DO
> #undef VCMP
>
> -#define VCMPNEZ_DO(suffix, element, etype, record) \
> -void helper_vcmpnez##suffix(CPUPPCState *env, ppc_avr_t *r, \
> +#define VCMPNE_DO(suffix, element, etype, cmpzero, record) \
> +void helper_vcmpne##suffix(CPUPPCState *env, ppc_avr_t *r, \
> ppc_avr_t *a, ppc_avr_t *b) \
> { \
> etype ones = (etype)-1; \
> etype all = ones; \
> - etype none = 0; \
> + etype result, none = 0; \
> int i; \
> \
> for (i = 0; i < ARRAY_SIZE(r->element); i++) { \
> - etype result = ((a->element[i] == 0) \
> + if (cmpzero) { \
> + result = ((a->element[i] == 0) \
> || (b->element[i] == 0) \
> || (a->element[i] != b->element[i]) ? \
> ones : 0x0); \
> + } else { \
> + result = (a->element[i] != b->element[i]) ? ones : 0x0; \
> + } \
> r->element[i] = result; \
> all &= result; \
> none |= result; \
> @@ -762,14 +766,17 @@ void helper_vcmpnez##suffix(CPUPPCState *env, ppc_avr_t *r, \
> * suffix - instruction mnemonic suffix (b: byte, h: halfword, w: word)
> * element - element type to access from vector
> */
> -#define VCMPNEZ(suffix, element, etype) \
> - VCMPNEZ_DO(suffix, element, etype, 0) \
> - VCMPNEZ_DO(suffix##_dot, element, etype, 1)
> -VCMPNEZ(b, u8, uint8_t)
> -VCMPNEZ(h, u16, uint16_t)
> -VCMPNEZ(w, u32, uint32_t)
> -#undef VCMPNEZ_DO
> -#undef VCMPNEZ
> +#define VCMPNE(suffix, element, etype, cmpzero) \
> + VCMPNE_DO(suffix, element, etype, cmpzero, 0) \
> + VCMPNE_DO(suffix##_dot, element, etype, cmpzero, 1)
> +VCMPNE(zb, u8, uint8_t, 1)
> +VCMPNE(zh, u16, uint16_t, 1)
> +VCMPNE(zw, u32, uint32_t, 1)
> +VCMPNE(b, u8, uint8_t, 0)
> +VCMPNE(h, u16, uint16_t, 0)
> +VCMPNE(w, u32, uint32_t, 0)
> +#undef VCMPNE_DO
> +#undef VCMPNE
>
> #define VCMPFP_DO(suffix, compare, order, record) \
> void helper_vcmp##suffix(CPUPPCState *env, ppc_avr_t *r, \
> diff --git a/target-ppc/translate/vmx-impl.inc.c b/target-ppc/translate/vmx-impl.inc.c
> index 10641dc..0bc7188 100644
> --- a/target-ppc/translate/vmx-impl.inc.c
> +++ b/target-ppc/translate/vmx-impl.inc.c
> @@ -608,7 +608,16 @@ GEN_VXRFORM(vcmpeqfp, 3, 3)
> GEN_VXRFORM(vcmpgefp, 3, 7)
> GEN_VXRFORM(vcmpgtfp, 3, 11)
> GEN_VXRFORM(vcmpbfp, 3, 15)
> -
> +GEN_VXRFORM(vcmpneb, 3, 0)
> +GEN_VXRFORM(vcmpneh, 3, 1)
> +GEN_VXRFORM(vcmpnew, 3, 2)
> +
> +GEN_VXRFORM_DUAL(vcmpequb, PPC_NONE, PPC2_ALTIVEC_207, \
> + vcmpneb, PPC_NONE, PPC2_ISA300)
> +GEN_VXRFORM_DUAL(vcmpequh, PPC_NONE, PPC2_ALTIVEC_207, \
> + vcmpneh, PPC_NONE, PPC2_ISA300)
> +GEN_VXRFORM_DUAL(vcmpequw, PPC_NONE, PPC2_ALTIVEC_207, \
> + vcmpnew, PPC_NONE, PPC2_ISA300)
> GEN_VXRFORM_DUAL(vcmpeqfp, PPC_ALTIVEC, PPC_NONE, \
> vcmpequd, PPC_NONE, PPC2_ALTIVEC_207)
> GEN_VXRFORM_DUAL(vcmpbfp, PPC_ALTIVEC, PPC_NONE, \
> diff --git a/target-ppc/translate/vmx-ops.inc.c b/target-ppc/translate/vmx-ops.inc.c
> index 87be6c6..009e9b1 100644
> --- a/target-ppc/translate/vmx-ops.inc.c
> +++ b/target-ppc/translate/vmx-ops.inc.c
> @@ -185,9 +185,6 @@ GEN_HANDLER2_E(name, str, 0x4, opc2, opc3, 0x00000000, PPC_NONE, PPC2_ISA300),
> GEN_VXRFORM1_300(name, name, #name, opc2, opc3) \
> GEN_VXRFORM1_300(name##_dot, name##_, #name ".", opc2, (opc3 | (0x1 << 4)))
>
> -GEN_VXRFORM(vcmpequb, 3, 0)
> -GEN_VXRFORM(vcmpequh, 3, 1)
> -GEN_VXRFORM(vcmpequw, 3, 2)
> GEN_VXRFORM_300(vcmpnezb, 3, 4)
> GEN_VXRFORM_300(vcmpnezh, 3, 5)
> GEN_VXRFORM_300(vcmpnezw, 3, 6)
> @@ -201,6 +198,9 @@ GEN_VXRFORM_DUAL(vcmpeqfp, vcmpequd, 3, 3, PPC_ALTIVEC, PPC_NONE)
> GEN_VXRFORM(vcmpgefp, 3, 7)
> GEN_VXRFORM_DUAL(vcmpgtfp, vcmpgtud, 3, 11, PPC_ALTIVEC, PPC_NONE)
> GEN_VXRFORM_DUAL(vcmpbfp, vcmpgtsd, 3, 15, PPC_ALTIVEC, PPC_NONE)
> +GEN_VXRFORM_DUAL(vcmpequb, vcmpneb, 3, 0, PPC_NONE, PPC2_ALTIVEC_207)
> +GEN_VXRFORM_DUAL(vcmpequh, vcmpneh, 3, 1, PPC_NONE, PPC2_ALTIVEC_207)
> +GEN_VXRFORM_DUAL(vcmpequw, vcmpnew, 3, 2, PPC_NONE, PPC2_ALTIVEC_207)
>
> #define GEN_VXFORM_DUAL_INV(name0, name1, opc2, opc3, inval0, inval1, type) \
> GEN_OPCODE_DUAL(name0##_##name1, 0x04, opc2, opc3, inval0, inval1, type, \
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2016-09-29 2:26 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-28 5:45 [Qemu-devel] [PATCH 0/6] POWER9 TCG enablement - part5 Rajalakshmi Srinivasaraghavan
2016-09-28 5:45 ` [Qemu-devel] [PATCH 1/6] target-ppc: add vmul10[u, eu, cu, ecu]q instructions Rajalakshmi Srinivasaraghavan
2016-09-28 16:42 ` Richard Henderson
2016-10-05 5:23 ` Rajalakshmi Srinivasaraghavan
2016-09-29 2:07 ` David Gibson
2016-09-29 4:00 ` Richard Henderson
2016-09-29 4:24 ` [Qemu-devel] [Qemu-ppc] " David Gibson
2016-09-28 5:45 ` [Qemu-devel] [PATCH 2/6] target-ppc: add vextu[bhw]lx instructions Rajalakshmi Srinivasaraghavan
2016-09-28 16:54 ` Richard Henderson
2016-10-05 5:21 ` Rajalakshmi Srinivasaraghavan
2016-10-25 4:31 ` Rajalakshmi Srinivasaraghavan
2016-09-28 5:45 ` [Qemu-devel] [PATCH 3/6] target-ppc: add vextu[bhw]rx instructions Rajalakshmi Srinivasaraghavan
2016-10-25 4:32 ` Rajalakshmi Srinivasaraghavan
2016-09-28 5:45 ` [Qemu-devel] [PATCH 4/6] target-ppc: fix invalid mask - cmpl, bctar Rajalakshmi Srinivasaraghavan
2016-09-29 2:22 ` David Gibson
2016-09-28 5:45 ` [Qemu-devel] [PATCH 5/6] target-ppc: add vector compare not equal instructions Rajalakshmi Srinivasaraghavan
2016-09-28 17:01 ` Richard Henderson
2016-09-29 2:22 ` David Gibson [this message]
2016-09-28 5:45 ` [Qemu-devel] [PATCH 6/6] target-ppc: add vclzlsbb/vctzlsbb instructions Rajalakshmi Srinivasaraghavan
2016-09-28 17:08 ` Richard Henderson
2016-09-29 2:23 ` David Gibson
2016-09-29 2:25 ` 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=20160929022251.GG8390@umbus.fritz.box \
--to=david@gibson.dropbear.id.au \
--cc=benh@kernel.crashing.org \
--cc=nikunj@linux.vnet.ibm.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=raji@linux.vnet.ibm.com \
--cc=rth@twiddle.net \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.