* [PATCH][AArch64 Testsuite] Add test of vld[234]q? intrinsic
@ 2014-09-08 10:35 Alan Lawrence
2014-09-09 10:20 ` Marcus Shawcroft
0 siblings, 1 reply; 5+ messages in thread
From: Alan Lawrence @ 2014-09-08 10:35 UTC (permalink / raw)
To: gcc-patches
[-- Attachment #1: Type: text/plain, Size: 411 bytes --]
This adds a test of all the variants of vld2, vld2q, vld3, vld3q, vld4, and
vld4q. These all use typexNxM structs and the OI/CI/XImode mechanism, so the
test cross-checks this against plain ol' vst1(q?).
Cross-tested on aarch64-none-elf (passing), also on aarch64_be-none-elf
(https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59810).
gcc/testsuite/ChangeLog:
* gcc.target/aarch64/vldN_1.c: New test.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: test_vldN.patch --]
[-- Type: text/x-patch; name=test_vldN.patch, Size: 2520 bytes --]
diff --git a/gcc/testsuite/gcc.target/aarch64/vldN_1.c b/gcc/testsuite/gcc.target/aarch64/vldN_1.c
new file mode 100644
index 0000000000000000000000000000000000000000..b64de16a1658da166175288bc1378a57d220801f
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/vldN_1.c
@@ -0,0 +1,79 @@
+/* { dg-do run } */
+/* { dg-options "-O3" } */
+
+#include <arm_neon.h>
+
+extern void abort (void);
+
+#define TESTMETH(BASE, ELTS, STRUCT, SUFFIX) \
+int __attribute__ ((noinline)) \
+test_vld##STRUCT##SUFFIX () \
+{ \
+ BASE##_t data[ELTS * STRUCT]; \
+ BASE##_t temp[ELTS]; \
+ BASE##x##ELTS##x##STRUCT##_t vectors; \
+ int i,j; \
+ for (i = 0; i < STRUCT * ELTS; i++) \
+ data [i] = (BASE##_t) 2*i + 1; \
+ asm volatile ("" : : : "memory"); \
+ vectors = vld##STRUCT##SUFFIX (data); \
+ for (i = 0; i < STRUCT; i++) \
+ { \
+ vst1##SUFFIX (temp, vectors.val[i]); \
+ asm volatile ("" : : : "memory"); \
+ for (j = 0; j < ELTS; j++) \
+ if (temp[j] != data[i + STRUCT*j]) \
+ return 1; \
+ } \
+ return 0; \
+}
+
+#define VARIANTS(VARIANT, STRUCT) \
+VARIANT (uint8, 8, STRUCT, _u8) \
+VARIANT (uint16, 4, STRUCT, _u16) \
+VARIANT (uint32, 2, STRUCT, _u32) \
+VARIANT (uint64, 1, STRUCT, _u64) \
+VARIANT (int8, 8, STRUCT, _s8) \
+VARIANT (int16, 4, STRUCT, _s16) \
+VARIANT (int32, 2, STRUCT, _s32) \
+VARIANT (int64, 1, STRUCT, _s64) \
+VARIANT (poly8, 8, STRUCT, _p8) \
+VARIANT (poly16, 4, STRUCT, _p16) \
+VARIANT (float32, 2, STRUCT, _f32) \
+VARIANT (float64, 1, STRUCT, _f64) \
+VARIANT (uint8, 16, STRUCT, q_u8) \
+VARIANT (uint16, 8, STRUCT, q_u16) \
+VARIANT (uint32, 4, STRUCT, q_u32) \
+VARIANT (uint64, 2, STRUCT, q_u64) \
+VARIANT (int8, 16, STRUCT, q_s8) \
+VARIANT (int16, 8, STRUCT, q_s16) \
+VARIANT (int32, 4, STRUCT, q_s32) \
+VARIANT (int64, 2, STRUCT, q_s64) \
+VARIANT (poly8, 16, STRUCT, q_p8) \
+VARIANT (poly16, 8, STRUCT, q_p16) \
+VARIANT (float32, 4, STRUCT, q_f32) \
+VARIANT (float64, 2, STRUCT, q_f64)
+
+/* Tests of vld2 and vld2q. */
+VARIANTS (TESTMETH, 2)
+
+/* Tests of vld3 and vld3q. */
+VARIANTS (TESTMETH, 3)
+
+/* Tests of vld4 and vld4q. */
+VARIANTS (TESTMETH, 4)
+
+#define CHECK(BASE, ELTS, STRUCT, SUFFIX) \
+ if (test_vld##STRUCT##SUFFIX () != 0) \
+ abort ();
+
+int
+main (int argc, char **argv)
+{
+ VARIANTS (CHECK, 2)
+ VARIANTS (CHECK, 3)
+ VARIANTS (CHECK, 4)
+
+ return 0;
+}
+
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH][AArch64 Testsuite] Add test of vld[234]q? intrinsic
2014-09-08 10:35 [PATCH][AArch64 Testsuite] Add test of vld[234]q? intrinsic Alan Lawrence
@ 2014-09-09 10:20 ` Marcus Shawcroft
2014-09-11 13:53 ` Christophe Lyon
0 siblings, 1 reply; 5+ messages in thread
From: Marcus Shawcroft @ 2014-09-09 10:20 UTC (permalink / raw)
To: Alan Lawrence; +Cc: gcc-patches
On 8 September 2014 11:35, Alan Lawrence <alan.lawrence@arm.com> wrote:
> This adds a test of all the variants of vld2, vld2q, vld3, vld3q, vld4, and
> vld4q. These all use typexNxM structs and the OI/CI/XImode mechanism, so the
> test cross-checks this against plain ol' vst1(q?).
>
> Cross-tested on aarch64-none-elf (passing), also on aarch64_be-none-elf
> (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59810).
>
> gcc/testsuite/ChangeLog:
>
> * gcc.target/aarch64/vldN_1.c: New test.
OK /Marcus
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH][AArch64 Testsuite] Add test of vld[234]q? intrinsic
2014-09-09 10:20 ` Marcus Shawcroft
@ 2014-09-11 13:53 ` Christophe Lyon
2014-09-11 13:56 ` Alan Lawrence
0 siblings, 1 reply; 5+ messages in thread
From: Christophe Lyon @ 2014-09-11 13:53 UTC (permalink / raw)
To: Alan Lawrence; +Cc: gcc-patches
On 9 September 2014 12:19, Marcus Shawcroft <marcus.shawcroft@gmail.com> wrote:
> On 8 September 2014 11:35, Alan Lawrence <alan.lawrence@arm.com> wrote:
>> This adds a test of all the variants of vld2, vld2q, vld3, vld3q, vld4, and
>> vld4q. These all use typexNxM structs and the OI/CI/XImode mechanism, so the
>> test cross-checks this against plain ol' vst1(q?).
>>
>> Cross-tested on aarch64-none-elf (passing), also on aarch64_be-none-elf
>> (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59810).
>>
Hi Alan,
On my side, your new test fails at execution on aarch64_be-none-elf:
http://cbuild.validation.linaro.org/build/cross-validation/gcc/trunk/215072/report-build-info.html
This seems strange since you tested it too.
I am using the Foundation Model.
Christophe.
>> gcc/testsuite/ChangeLog:
>>
>> * gcc.target/aarch64/vldN_1.c: New test.
>
> OK /Marcus
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH][AArch64 Testsuite] Add test of vld[234]q? intrinsic
2014-09-11 13:53 ` Christophe Lyon
@ 2014-09-11 13:56 ` Alan Lawrence
2014-09-11 15:11 ` Christophe Lyon
0 siblings, 1 reply; 5+ messages in thread
From: Alan Lawrence @ 2014-09-11 13:56 UTC (permalink / raw)
To: Christophe Lyon; +Cc: gcc-patches
Yes, I had seen that, and the failure is expected. AFAICT the test is correct;
but the implementation of vld[234] is incorrect on bigendian, because of
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59810 .
HTH, Alan.
Christophe Lyon wrote:
> On 9 September 2014 12:19, Marcus Shawcroft <marcus.shawcroft@gmail.com> wrote:
>> On 8 September 2014 11:35, Alan Lawrence <alan.lawrence@arm.com> wrote:
>>> This adds a test of all the variants of vld2, vld2q, vld3, vld3q, vld4, and
>>> vld4q. These all use typexNxM structs and the OI/CI/XImode mechanism, so the
>>> test cross-checks this against plain ol' vst1(q?).
>>>
>>> Cross-tested on aarch64-none-elf (passing), also on aarch64_be-none-elf
>>> (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59810).
>>>
>
> Hi Alan,
>
> On my side, your new test fails at execution on aarch64_be-none-elf:
> http://cbuild.validation.linaro.org/build/cross-validation/gcc/trunk/215072/report-build-info.html
>
> This seems strange since you tested it too.
> I am using the Foundation Model.
>
> Christophe.
>
>>> gcc/testsuite/ChangeLog:
>>>
>>> * gcc.target/aarch64/vldN_1.c: New test.
>> OK /Marcus
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH][AArch64 Testsuite] Add test of vld[234]q? intrinsic
2014-09-11 13:56 ` Alan Lawrence
@ 2014-09-11 15:11 ` Christophe Lyon
0 siblings, 0 replies; 5+ messages in thread
From: Christophe Lyon @ 2014-09-11 15:11 UTC (permalink / raw)
To: Alan Lawrence; +Cc: gcc-patches
Ha OK, I had misunderstood your first email, and thought you had the
test also pass in big endian.
Thanks for the clarification.
On 11 September 2014 15:56, Alan Lawrence <alan.lawrence@arm.com> wrote:
> Yes, I had seen that, and the failure is expected. AFAICT the test is
> correct; but the implementation of vld[234] is incorrect on bigendian,
> because of https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59810 .
>
> HTH, Alan.
>
>
>
>
> Christophe Lyon wrote:
>>
>> On 9 September 2014 12:19, Marcus Shawcroft <marcus.shawcroft@gmail.com>
>> wrote:
>>>
>>> On 8 September 2014 11:35, Alan Lawrence <alan.lawrence@arm.com> wrote:
>>>>
>>>> This adds a test of all the variants of vld2, vld2q, vld3, vld3q, vld4,
>>>> and
>>>> vld4q. These all use typexNxM structs and the OI/CI/XImode mechanism, so
>>>> the
>>>> test cross-checks this against plain ol' vst1(q?).
>>>>
>>>> Cross-tested on aarch64-none-elf (passing), also on aarch64_be-none-elf
>>>> (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59810).
>>>>
>>
>> Hi Alan,
>>
>> On my side, your new test fails at execution on aarch64_be-none-elf:
>>
>> http://cbuild.validation.linaro.org/build/cross-validation/gcc/trunk/215072/report-build-info.html
>>
>> This seems strange since you tested it too.
>> I am using the Foundation Model.
>>
>> Christophe.
>>
>>>> gcc/testsuite/ChangeLog:
>>>>
>>>> * gcc.target/aarch64/vldN_1.c: New test.
>>>
>>> OK /Marcus
>>
>>
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2014-09-11 15:11 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-08 10:35 [PATCH][AArch64 Testsuite] Add test of vld[234]q? intrinsic Alan Lawrence
2014-09-09 10:20 ` Marcus Shawcroft
2014-09-11 13:53 ` Christophe Lyon
2014-09-11 13:56 ` Alan Lawrence
2014-09-11 15:11 ` Christophe Lyon
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).