public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Christophe Lyon <christophe.lyon@linaro.org>
To: James Greenhalgh <james.greenhalgh@arm.com>
Cc: "gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>, nd <nd@arm.com>
Subject: Re: [Patch ARM/AArch64 06/11] Add missing vtst_p8 and vtstq_p8 tests.
Date: Thu, 19 May 2016 11:54:00 -0000	[thread overview]
Message-ID: <CAKdteOauFoe5rummTGjaHcLSQ45TpZv8hNPw32oE7ZHD_QdrAA@mail.gmail.com> (raw)
In-Reply-To: <20160513144748.GD12266@arm.com>

[-- Attachment #1: Type: text/plain, Size: 1778 bytes --]

On 13 May 2016 at 16:47, James Greenhalgh <james.greenhalgh@arm.com> wrote:
> On Fri, May 13, 2016 at 04:41:33PM +0200, Christophe Lyon wrote:
>> On 13 May 2016 at 16:37, James Greenhalgh <james.greenhalgh@arm.com> wrote:
>> > On Wed, May 11, 2016 at 03:23:56PM +0200, Christophe Lyon wrote:
>> >> 2016-05-02  Christophe Lyon  <christophe.lyon@linaro.org>
>> >>
>> >>       * gcc.target/aarch64/advsimd-intrinsics/vtst.c: Add tests
>> >>       for vtst_p8 and vtstq_p8.
>> >
>> > And vtst_p16 and vtstq_p16 too please.
>> >
>> > vtst_s64
>> > vtstq_s64
>> > vtst_u64
>> > vtstq_u64 are also missing (AArch64 only).
>> >
>> vtst_p16/vtstq_p16 are AArch64 only too, right?
>
> Not in my copy of:
>
>   http://infocenter.arm.com/help/topic/com.arm.doc.ihi0073a/IHI0073A_arm_neon_intrinsics_ref.pdf
>
> I see it is missing from config/arm/arm_neon.h so that's a bug in the GCC
> implementation. It should be easy to resolve, map it to the same place
> as vtst_u16 and vtst_s16 - this is just a bit operation which takes no
> semantics from the data-type.
>
Maybe you have a way of automatically checking that the doc and arm_neon.h
contents match? I mean:
- are there other intrinsics documented, but not defined in arm_neon.h ?
- are there intrinsics in arm_neon.h, but not in the doc?

> Would you mind spinning the fix for that and committing it before this
> patch?
>

I've attached an updated patch which contains the definition for the
missing vtst_p16 and vtstq_p16,
as well as tests for vtst_p8, vtstq_p8, vtst_p16 and vtstq_p16.

>> My introduction message was not clear enough: this series
>> only attempts to fully cover AArch32 intrinsics.
>
> Understood, sorry for the extra noise.
>
Coverage of AArch64 intrinsics will require another effort :)

> Thanks,
> James
>
>

[-- Attachment #2: vtst_poly.log.txt --]
[-- Type: text/plain, Size: 249 bytes --]

2016-05-19  Christophe Lyon  <christophe.lyon@linaro.org>

	gcc/
	* config/arm/arm_neon.h (vtst_p16, vtstq_p16): New.

	gcc/testsuite/
	* gcc.target/aarch64/advsimd-intrinsics/vtst.c: Add tests
        for vtst_p8, vtstq_p8, vtst_p16 and vtstq_p16.

[-- Attachment #3: vtst_poly.patch.txt --]
[-- Type: text/plain, Size: 3653 bytes --]

diff --git a/gcc/config/arm/arm_neon.h b/gcc/config/arm/arm_neon.h
index 07503d7..7997cb4 100644
--- a/gcc/config/arm/arm_neon.h
+++ b/gcc/config/arm/arm_neon.h
@@ -2607,6 +2607,12 @@ vtst_p8 (poly8x8_t __a, poly8x8_t __b)
   return (uint8x8_t)__builtin_neon_vtstv8qi ((int8x8_t) __a, (int8x8_t) __b);
 }
 
+__extension__ static __inline uint16x4_t __attribute__ ((__always_inline__))
+vtst_p16 (poly16x4_t __a, poly16x4_t __b)
+{
+  return (uint16x4_t)__builtin_neon_vtstv4hi ((int16x4_t) __a, (int16x4_t) __b);
+}
+
 __extension__ static __inline uint8x16_t __attribute__ ((__always_inline__))
 vtstq_s8 (int8x16_t __a, int8x16_t __b)
 {
@@ -2649,6 +2655,12 @@ vtstq_p8 (poly8x16_t __a, poly8x16_t __b)
   return (uint8x16_t)__builtin_neon_vtstv16qi ((int8x16_t) __a, (int8x16_t) __b);
 }
 
+__extension__ static __inline uint16x8_t __attribute__ ((__always_inline__))
+vtstq_p16 (poly16x8_t __a, poly16x8_t __b)
+{
+  return (uint16x8_t)__builtin_neon_vtstv8hi ((int16x8_t) __a, (int16x8_t) __b);
+}
+
 __extension__ static __inline int8x8_t __attribute__ ((__always_inline__))
 vabd_s8 (int8x8_t __a, int8x8_t __b)
 {
diff --git a/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vtst.c b/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vtst.c
index 9e74ffb..8f9e651 100644
--- a/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vtst.c
+++ b/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vtst.c
@@ -32,6 +32,19 @@ VECT_VAR_DECL(expected_unsigned,uint,16,8) [] = { 0x0, 0xffff,
 VECT_VAR_DECL(expected_unsigned,uint,32,4) [] = { 0x0, 0xffffffff,
 						  0x0, 0xffffffff };
 
+/* Expected results with poly input.  */
+VECT_VAR_DECL(expected_poly,uint,8,8) [] = { 0x0, 0xff, 0xff, 0xff,
+					     0xff, 0xff, 0xff, 0xff };
+VECT_VAR_DECL(expected_poly,uint,8,16) [] = { 0x0, 0xff, 0xff, 0xff,
+					      0xff, 0xff, 0xff, 0xff,
+					      0xff, 0xff, 0xff, 0xff,
+					      0xff, 0xff, 0xff, 0xff };
+VECT_VAR_DECL(expected_poly,uint,16,4) [] = { 0x0, 0xffff, 0x0, 0xffff };
+VECT_VAR_DECL(expected_poly,uint,16,8) [] = { 0x0, 0xffff,
+					      0x0, 0xffff,
+					      0xffff, 0xffff,
+					      0xffff, 0xffff };
+
 #define INSN_NAME vtst
 #define TEST_MSG "VTST/VTSTQ"
 
@@ -71,12 +84,16 @@ FNNAME (INSN_NAME)
   VDUP(vector2, , uint, u, 8, 8, 15);
   VDUP(vector2, , uint, u, 16, 4, 5);
   VDUP(vector2, , uint, u, 32, 2, 1);
+  VDUP(vector2, , poly, p, 8, 8, 15);
+  VDUP(vector2, , poly, p, 16, 4, 5);
   VDUP(vector2, q, int, s, 8, 16, 15);
   VDUP(vector2, q, int, s, 16, 8, 5);
   VDUP(vector2, q, int, s, 32, 4, 1);
   VDUP(vector2, q, uint, u, 8, 16, 15);
   VDUP(vector2, q, uint, u, 16, 8, 5);
   VDUP(vector2, q, uint, u, 32, 4, 1);
+  VDUP(vector2, q, poly, p, 8, 16, 15);
+  VDUP(vector2, q, poly, p, 16, 8, 5);
 
 #define TEST_MACRO_NO64BIT_VARIANT_1_5(MACRO, VAR, T1, T2)	\
   MACRO(VAR, , T1, T2, 8, 8);					\
@@ -109,6 +126,18 @@ FNNAME (INSN_NAME)
   CHECK(TEST_MSG, uint, 8, 16, PRIx8, expected_unsigned, CMT);
   CHECK(TEST_MSG, uint, 16, 8, PRIx16, expected_unsigned, CMT);
   CHECK(TEST_MSG, uint, 32, 4, PRIx32, expected_unsigned, CMT);
+
+  /* Now, test the variants with poly8 and poly16 as input.  */
+#undef CMT
+#define CMT " (poly input)"
+  TEST_BINARY_OP(INSN_NAME, , poly, p, 8, 8);
+  TEST_BINARY_OP(INSN_NAME, , poly, p, 16, 4);
+  TEST_BINARY_OP(INSN_NAME, q, poly, p, 8, 16);
+  TEST_BINARY_OP(INSN_NAME, q, poly, p, 16, 8);
+  CHECK(TEST_MSG, uint, 8, 8, PRIx8, expected_poly, CMT);
+  CHECK(TEST_MSG, uint, 16, 4, PRIx16, expected_poly, CMT);
+  CHECK(TEST_MSG, uint, 8, 16, PRIx8, expected_poly, CMT);
+  CHECK(TEST_MSG, uint, 16, 8, PRIx16, expected_poly, CMT);
 }
 
 int main (void)

  reply	other threads:[~2016-05-19 11:54 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-11 13:24 [Patch ARM/AArch64 00/11][testsuite] AdvSIMD intrinsics update Christophe Lyon
2016-05-11 13:24 ` [Patch ARM/AArch64 08/11] Add missing vstX_lane fp16 tests Christophe Lyon
2016-05-13 14:53   ` James Greenhalgh
2016-05-19 16:20   ` Kyrill Tkachov
2016-05-11 13:24 ` [Patch ARM/AArch64 06/11] Add missing vtst_p8 and vtstq_p8 tests Christophe Lyon
2016-05-13 14:37   ` James Greenhalgh
2016-05-13 14:41     ` Christophe Lyon
2016-05-13 14:48       ` James Greenhalgh
2016-05-19 11:54         ` Christophe Lyon [this message]
2016-05-20 13:49           ` Kyrill Tkachov
2016-05-11 13:24 ` [Patch ARM/AArch64 09/11] Add missing vrnd{,a,m,n,p,x} tests Christophe Lyon
2016-05-12  8:45   ` Jiong Wang
2016-05-12 12:56     ` Christophe Lyon
2016-05-13  8:39       ` Jiong Wang
2016-05-13 14:56   ` James Greenhalgh
2016-05-19 16:22   ` Kyrill Tkachov
2016-05-11 13:24 ` [Patch ARM/AArch64 03/11] AdvSIMD tests: be more verbose Christophe Lyon
2016-05-13 14:03   ` James Greenhalgh
2016-05-16 13:26   ` Kyrill Tkachov
2016-05-11 13:24 ` [Patch ARM/AArch64 05/11] Add missing vreinterpretq_p{8,16} tests Christophe Lyon
2016-05-13 14:15   ` James Greenhalgh
2016-05-16 13:31   ` Kyrill Tkachov
2016-05-11 13:24 ` [Patch ARM/AArch64 01/11] Fix typo in vreinterpret.c test comment Christophe Lyon
2016-05-13 13:53   ` James Greenhalgh
2016-05-16 13:25   ` Kyrill Tkachov
2016-05-11 13:24 ` [Patch ARM/AArch64 02/11] We can remove useless #ifdefs from these tests: vmul, vshl and vtst Christophe Lyon
2016-05-13 13:56   ` James Greenhalgh
2016-05-16 13:25   ` Kyrill Tkachov
2016-05-11 13:24 ` [Patch ARM/AArch64 10/11] Add missing tests for intrinsics operating on poly64 and poly128 types Christophe Lyon
2016-05-13 15:16   ` James Greenhalgh
2016-05-19 16:23     ` Kyrill Tkachov
2016-05-23  9:12     ` Christophe Lyon
2016-05-11 13:24 ` [Patch ARM/AArch64 11/11] Add missing tests for vreinterpret, operating of fp16 type Christophe Lyon
2016-05-13 15:17   ` James Greenhalgh
2016-05-19 16:24   ` Kyrill Tkachov
2016-05-11 13:24 ` [Patch ARM/AArch64 07/11] Add missing vget_lane fp16 tests Christophe Lyon
2016-05-13 14:38   ` James Greenhalgh
2016-05-16 13:41   ` Kyrill Tkachov
2016-05-11 13:24 ` [Patch ARM/AArch64 04/11] Add forgotten vsliq_n_u64 test Christophe Lyon
2016-05-13 14:09   ` James Greenhalgh
2016-05-13 14:22     ` Christophe Lyon
2016-05-16 13:27       ` Kyrill Tkachov
2016-05-13 15:32 ` [Patch ARM/AArch64 00/11][testsuite] AdvSIMD intrinsics update James Greenhalgh

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=CAKdteOauFoe5rummTGjaHcLSQ45TpZv8hNPw32oE7ZHD_QdrAA@mail.gmail.com \
    --to=christophe.lyon@linaro.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=james.greenhalgh@arm.com \
    --cc=nd@arm.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 read-only IMAP folder(s) and NNTP newsgroup(s).