From patchwork Thu Oct 6 16:47:11 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 118133 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id C5034B6FAF for ; Fri, 7 Oct 2011 03:49:03 +1100 (EST) Received: (qmail 20798 invoked by alias); 6 Oct 2011 16:48:48 -0000 Received: (qmail 19329 invoked by uid 22791); 6 Oct 2011 16:48:32 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, TW_CB, TW_XC, TW_XD, TW_XF, T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: sourceware.org Received: from mail-ww0-f51.google.com (HELO mail-ww0-f51.google.com) (74.125.82.51) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 06 Oct 2011 16:48:01 +0000 Received: by wwf10 with SMTP id 10so3937583wwf.8 for ; Thu, 06 Oct 2011 09:47:59 -0700 (PDT) Received: by 10.227.58.144 with SMTP id g16mr1263113wbh.11.1317919679346; Thu, 06 Oct 2011 09:47:59 -0700 (PDT) Received: from localhost.localdomain (c-71-227-161-214.hsd1.wa.comcast.net. [71.227.161.214]) by mx.google.com with ESMTPS id gg21sm11132659wbb.15.2011.10.06.09.47.56 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 06 Oct 2011 09:47:58 -0700 (PDT) From: Richard Henderson To: gcc-patches@gcc.gnu.org Cc: Georg-Johann Lay Subject: [PATCH] Rework vector shuffle tests. Date: Thu, 6 Oct 2011 09:47:11 -0700 Message-Id: <1317919633-17991-2-git-send-email-rth@redhat.com> X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Test vector sizes 8, 16, and 32. Test most data types for each size. This should also solve the problem that Georg reported for AVR. Indeed, I hope that except for the DImode/DFmode tests, these actually execute on that target. r~ Cc: Georg-Johann Lay --- gcc/testsuite/ChangeLog | 29 ++++++ .../gcc.c-torture/execute/vect-shuffle-1.c | 68 ------------- .../gcc.c-torture/execute/vect-shuffle-2.c | 68 ------------- .../gcc.c-torture/execute/vect-shuffle-3.c | 58 ----------- .../gcc.c-torture/execute/vect-shuffle-4.c | 51 ---------- .../gcc.c-torture/execute/vect-shuffle-5.c | 64 ------------ .../gcc.c-torture/execute/vect-shuffle-6.c | 64 ------------ .../gcc.c-torture/execute/vect-shuffle-7.c | 70 -------------- .../gcc.c-torture/execute/vect-shuffle-8.c | 55 ----------- gcc/testsuite/gcc.c-torture/execute/vshuf-16.inc | 81 ++++++++++++++++ gcc/testsuite/gcc.c-torture/execute/vshuf-2.inc | 38 ++++++++ gcc/testsuite/gcc.c-torture/execute/vshuf-4.inc | 39 ++++++++ gcc/testsuite/gcc.c-torture/execute/vshuf-8.inc | 101 ++++++++++++++++++++ gcc/testsuite/gcc.c-torture/execute/vshuf-main.inc | 26 +++++ gcc/testsuite/gcc.c-torture/execute/vshuf-v16qi.c | 5 + gcc/testsuite/gcc.c-torture/execute/vshuf-v2df.c | 15 +++ gcc/testsuite/gcc.c-torture/execute/vshuf-v2di.c | 15 +++ gcc/testsuite/gcc.c-torture/execute/vshuf-v2sf.c | 21 ++++ gcc/testsuite/gcc.c-torture/execute/vshuf-v2si.c | 18 ++++ gcc/testsuite/gcc.c-torture/execute/vshuf-v4df.c | 19 ++++ gcc/testsuite/gcc.c-torture/execute/vshuf-v4di.c | 19 ++++ gcc/testsuite/gcc.c-torture/execute/vshuf-v4hi.c | 15 +++ gcc/testsuite/gcc.c-torture/execute/vshuf-v4sf.c | 25 +++++ gcc/testsuite/gcc.c-torture/execute/vshuf-v4si.c | 22 ++++ gcc/testsuite/gcc.c-torture/execute/vshuf-v8hi.c | 23 +++++ gcc/testsuite/gcc.c-torture/execute/vshuf-v8qi.c | 23 +++++ gcc/testsuite/gcc.c-torture/execute/vshuf-v8si.c | 30 ++++++ 27 files changed, 564 insertions(+), 498 deletions(-) delete mode 100644 gcc/testsuite/gcc.c-torture/execute/vect-shuffle-1.c delete mode 100644 gcc/testsuite/gcc.c-torture/execute/vect-shuffle-2.c delete mode 100644 gcc/testsuite/gcc.c-torture/execute/vect-shuffle-3.c delete mode 100644 gcc/testsuite/gcc.c-torture/execute/vect-shuffle-4.c delete mode 100644 gcc/testsuite/gcc.c-torture/execute/vect-shuffle-5.c delete mode 100644 gcc/testsuite/gcc.c-torture/execute/vect-shuffle-6.c delete mode 100644 gcc/testsuite/gcc.c-torture/execute/vect-shuffle-7.c delete mode 100644 gcc/testsuite/gcc.c-torture/execute/vect-shuffle-8.c create mode 100644 gcc/testsuite/gcc.c-torture/execute/vshuf-16.inc create mode 100644 gcc/testsuite/gcc.c-torture/execute/vshuf-2.inc create mode 100644 gcc/testsuite/gcc.c-torture/execute/vshuf-4.inc create mode 100644 gcc/testsuite/gcc.c-torture/execute/vshuf-8.inc create mode 100644 gcc/testsuite/gcc.c-torture/execute/vshuf-main.inc create mode 100644 gcc/testsuite/gcc.c-torture/execute/vshuf-v16qi.c create mode 100644 gcc/testsuite/gcc.c-torture/execute/vshuf-v2df.c create mode 100644 gcc/testsuite/gcc.c-torture/execute/vshuf-v2di.c create mode 100644 gcc/testsuite/gcc.c-torture/execute/vshuf-v2sf.c create mode 100644 gcc/testsuite/gcc.c-torture/execute/vshuf-v2si.c create mode 100644 gcc/testsuite/gcc.c-torture/execute/vshuf-v4df.c create mode 100644 gcc/testsuite/gcc.c-torture/execute/vshuf-v4di.c create mode 100644 gcc/testsuite/gcc.c-torture/execute/vshuf-v4hi.c create mode 100644 gcc/testsuite/gcc.c-torture/execute/vshuf-v4sf.c create mode 100644 gcc/testsuite/gcc.c-torture/execute/vshuf-v4si.c create mode 100644 gcc/testsuite/gcc.c-torture/execute/vshuf-v8hi.c create mode 100644 gcc/testsuite/gcc.c-torture/execute/vshuf-v8qi.c create mode 100644 gcc/testsuite/gcc.c-torture/execute/vshuf-v8si.c + * gcc.c-torture/execute/vect-shuffle-1.c: Remove. + * gcc.c-torture/execute/vect-shuffle-2.c: Remove. + * gcc.c-torture/execute/vect-shuffle-3.c: Remove. + * gcc.c-torture/execute/vect-shuffle-4.c: Remove. + * gcc.c-torture/execute/vect-shuffle-5.c: Remove. + * gcc.c-torture/execute/vect-shuffle-6.c: Remove. + * gcc.c-torture/execute/vect-shuffle-7.c: Remove. + * gcc.c-torture/execute/vect-shuffle-8.c: Remove. + * gcc.c-torture/execute/vshuf-16.inc: New file. + * gcc.c-torture/execute/vshuf-2.inc: New file. + * gcc.c-torture/execute/vshuf-4.inc: New file. + * gcc.c-torture/execute/vshuf-8.inc: New file. + * gcc.c-torture/execute/vshuf-main.inc: New file. + * gcc.c-torture/execute/vshuf-v16qi.c: New test. + * gcc.c-torture/execute/vshuf-v2df.c: New test. + * gcc.c-torture/execute/vshuf-v2di.c: New test. + * gcc.c-torture/execute/vshuf-v2sf.c: New test. + * gcc.c-torture/execute/vshuf-v2si.c: New test. + * gcc.c-torture/execute/vshuf-v4df.c: New test. + * gcc.c-torture/execute/vshuf-v4di.c: New test. + * gcc.c-torture/execute/vshuf-v4hi.c: New test. + * gcc.c-torture/execute/vshuf-v4sf.c: New test. + * gcc.c-torture/execute/vshuf-v4si.c: New test. + * gcc.c-torture/execute/vshuf-v8hi.c: New test. + * gcc.c-torture/execute/vshuf-v8qi.c: New test. + * gcc.c-torture/execute/vshuf-v8si.c: New test. diff --git a/gcc/testsuite/gcc.c-torture/execute/vect-shuffle-1.c b/gcc/testsuite/gcc.c-torture/execute/vect-shuffle-1.c deleted file mode 100644 index 3b83636..0000000 --- a/gcc/testsuite/gcc.c-torture/execute/vect-shuffle-1.c +++ /dev/null @@ -1,68 +0,0 @@ -#if __SIZEOF_INT__ == 4 -typedef unsigned int V __attribute__((vector_size(16), may_alias)); - -struct S -{ - V in, mask, out; -}; - -struct S tests[] = { - { - { 0x11111111, 0x22222222, 0x33333333, 0x44444444 }, - { 0, 1, 2, 3 }, - { 0x11111111, 0x22222222, 0x33333333, 0x44444444 }, - }, - { - { 0x11111111, 0x22222222, 0x33333333, 0x44444444 }, - { 0+1*4, 1+2*4, 2+3*4, 3+4*4 }, - { 0x11111111, 0x22222222, 0x33333333, 0x44444444 }, - }, - { - { 0x11111111, 0x22222222, 0x33333333, 0x44444444 }, - { 3, 2, 1, 0 }, - { 0x44444444, 0x33333333, 0x22222222, 0x11111111 }, - }, - { - { 0x11111111, 0x22222222, 0x33333333, 0x44444444 }, - { 0, 3, 2, 1 }, - { 0x11111111, 0x44444444, 0x33333333, 0x22222222 }, - }, - { - { 0x11111111, 0x22222222, 0x33333333, 0x44444444 }, - { 0, 2, 1, 3 }, - { 0x11111111, 0x33333333, 0x22222222, 0x44444444 }, - }, - { - { 0x11223344, 0x55667788, 0x99aabbcc, 0xddeeff00 }, - { 3, 1, 2, 0 }, - { 0xddeeff00, 0x55667788, 0x99aabbcc, 0x11223344 }, - }, - { - { 0x11223344, 0x55667788, 0x99aabbcc, 0xddeeff00 }, - { 0, 0, 0, 0 }, - { 0x11223344, 0x11223344, 0x11223344, 0x11223344 }, - }, - { - { 0x11223344, 0x55667788, 0x99aabbcc, 0xddeeff00 }, - { 1, 2, 1, 2 }, - { 0x55667788, 0x99aabbcc, 0x55667788, 0x99aabbcc }, - } -}; - -extern void abort(void); - -int main() -{ - int i; - - for (i = 0; i < sizeof(tests)/sizeof(tests[0]); ++i) - { - V r = __builtin_shuffle(tests[i].in, tests[i].mask); - if (__builtin_memcmp(&r, &tests[i].out, sizeof(V)) != 0) - abort(); - } - - return 0; -} - -#endif /* SIZEOF_INT */ diff --git a/gcc/testsuite/gcc.c-torture/execute/vect-shuffle-2.c b/gcc/testsuite/gcc.c-torture/execute/vect-shuffle-2.c deleted file mode 100644 index 68ae225..0000000 --- a/gcc/testsuite/gcc.c-torture/execute/vect-shuffle-2.c +++ /dev/null @@ -1,68 +0,0 @@ -#if __SIZEOF_SHORT__ == 2 -typedef unsigned short V __attribute__((vector_size(16), may_alias)); - -struct S -{ - V in, mask, out; -}; - -struct S tests[] = { - { - { 0x1111, 0x2222, 0x3333, 0x4444, 0x5555, 0x6666, 0x7777, 0x8888 }, - { 0, 1, 2, 3, 4, 5, 6, 7 }, - { 0x1111, 0x2222, 0x3333, 0x4444, 0x5555, 0x6666, 0x7777, 0x8888 }, - }, - { - { 0x1111, 0x2222, 0x3333, 0x4444, 0x5555, 0x6666, 0x7777, 0x8888 }, - { 0x10, 0x21, 0x32, 0x43, 0x54, 0x65, 0x76, 0x87 }, - { 0x1111, 0x2222, 0x3333, 0x4444, 0x5555, 0x6666, 0x7777, 0x8888 }, - }, - { - { 0x1111, 0x2222, 0x3333, 0x4444, 0x5555, 0x6666, 0x7777, 0x8888 }, - { 7, 6, 5, 4, 3, 2, 1, 0 }, - { 0x8888, 0x7777, 0x6666, 0x5555, 0x4444, 0x3333, 0x2222, 0x1111 }, - }, - { - { 0x1111, 0x2222, 0x3333, 0x4444, 0x5555, 0x6666, 0x7777, 0x8888 }, - { 7, 0, 5, 3, 2, 4, 1, 6 }, - { 0x8888, 0x1111, 0x6666, 0x4444, 0x3333, 0x5555, 0x2222, 0x7777 }, - }, - { - { 0x1111, 0x2222, 0x3333, 0x4444, 0x5555, 0x6666, 0x7777, 0x8888 }, - { 0, 2, 1, 3, 4, 6, 5, 7 }, - { 0x1111, 0x3333, 0x2222, 0x4444, 0x5555, 0x7777, 0x6666, 0x8888 }, - }, - { - { 0x1122, 0x3344, 0x5566, 0x7788, 0x99aa, 0xbbcc, 0xddee, 0xff00 }, - { 3, 1, 2, 0, 7, 5, 6, 4 }, - { 0x7788, 0x3344, 0x5566, 0x1122, 0xff00, 0xbbcc, 0xddee, 0x99aa }, - }, - { - { 0x1122, 0x3344, 0x5566, 0x7788, 0x99aa, 0xbbcc, 0xddee, 0xff00 }, - { 0, 0, 0, 0 }, - { 0x1122, 0x1122, 0x1122, 0x1122, 0x1122, 0x1122, 0x1122, 0x1122 }, - }, - { - { 0x1122, 0x3344, 0x5566, 0x7788, 0x99aa, 0xbbcc, 0xddee, 0xff00 }, - { 1, 6, 1, 6, 1, 6, 1, 6 }, - { 0x3344, 0xddee, 0x3344, 0xddee, 0x3344, 0xddee, 0x3344, 0xddee }, - } -}; - -extern void abort(void); - -int main() -{ - int i; - - for (i = 0; i < sizeof(tests)/sizeof(tests[0]); ++i) - { - V r = __builtin_shuffle(tests[i].in, tests[i].mask); - if (memcmp(&r, &tests[i].out, sizeof(V)) != 0) - abort(); - } - - return 0; -} - -#endif /* SIZEOF_SHORT */ diff --git a/gcc/testsuite/gcc.c-torture/execute/vect-shuffle-3.c b/gcc/testsuite/gcc.c-torture/execute/vect-shuffle-3.c deleted file mode 100644 index 96aee65..0000000 --- a/gcc/testsuite/gcc.c-torture/execute/vect-shuffle-3.c +++ /dev/null @@ -1,58 +0,0 @@ -#if __SIZEOF_LONG_LONG__ == 8 -typedef unsigned long long V __attribute__((vector_size(16), may_alias)); - -struct S -{ - V in, mask, out; -}; - -struct S tests[] = { - { - { 0x1111111111111111, 0x2222222222222222 }, - { 0, 1 }, - { 0x1111111111111111, 0x2222222222222222 }, - }, - { - { 0x1111111111111111, 0x2222222222222222 }, - { 0x0102030405060700, 0xffeeddccbbaa99f1 }, - { 0x1111111111111111, 0x2222222222222222 }, - }, - { - { 0x1111111111111111, 0x2222222222222222 }, - { 1, 0 }, - { 0x2222222222222222, 0x1111111111111111 }, - }, - { - { 0x1111111111111111, 0x2222222222222222 }, - { 0, 0 }, - { 0x1111111111111111, 0x1111111111111111 }, - }, - { - { 0x1122334455667788, 0x99aabbccddeeff00 }, - { 1, 1 }, - { 0x99aabbccddeeff00, 0x99aabbccddeeff00 }, - }, - { - { 0x1122334455667788, 0x99aabbccddeeff00 }, - { 1, 0 }, - { 0x99aabbccddeeff00, 0x1122334455667788 }, - }, -}; - -extern void abort(void); - -int main() -{ - int i; - - for (i = 0; i < sizeof(tests)/sizeof(tests[0]); ++i) - { - V r = __builtin_shuffle(tests[i].in, tests[i].mask); - if (__builtin_memcmp(&r, &tests[i].out, sizeof(V)) != 0) - abort(); - } - - return 0; -} - -#endif /* SIZEOF_LONG_LONG */ diff --git a/gcc/testsuite/gcc.c-torture/execute/vect-shuffle-4.c b/gcc/testsuite/gcc.c-torture/execute/vect-shuffle-4.c deleted file mode 100644 index fa036eb..0000000 --- a/gcc/testsuite/gcc.c-torture/execute/vect-shuffle-4.c +++ /dev/null @@ -1,51 +0,0 @@ -typedef unsigned char V __attribute__((vector_size(16), may_alias)); - -struct S -{ - V in, mask, out; -}; - -struct S tests[] = { - { - { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 }, - { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, }, - { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 }, - }, - { - { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 }, - { 0x10, 0x21, 0x32, 0x43, 0x54, 0x65, 0x76, 0x87, - 0x98, 0xa9, 0xba, 0xcb, 0xdc, 0xed, 0xfe, 0xff }, - { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 }, - }, - { - { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 }, - { 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 }, - { 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1 }, - }, - { - { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 }, - { 0, 2, 4, 6, 8, 10, 12, 14, 1, 3, 5, 7, 9, 11, 13, 15 }, - { 1, 3, 5, 7, 9, 11, 13, 15, 2, 4, 6, 8, 10, 12, 14, 16 }, - }, - { - { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 }, - { 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 }, - { 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 }, - }, -}; - -extern void abort(void); - -int main() -{ - int i; - - for (i = 0; i < sizeof(tests)/sizeof(tests[0]); ++i) - { - V r = __builtin_shuffle(tests[i].in, tests[i].mask); - if (memcmp(&r, &tests[i].out, sizeof(V)) != 0) - abort(); - } - - return 0; -} diff --git a/gcc/testsuite/gcc.c-torture/execute/vect-shuffle-5.c b/gcc/testsuite/gcc.c-torture/execute/vect-shuffle-5.c deleted file mode 100644 index f07025d..0000000 --- a/gcc/testsuite/gcc.c-torture/execute/vect-shuffle-5.c +++ /dev/null @@ -1,64 +0,0 @@ -#if __SIZEOF_INT__ == 4 -typedef unsigned int V __attribute__((vector_size(16), may_alias)); - -struct S -{ - V in1, in2, mask, out; -}; - -struct S tests[] = { - { - { 0x11111111, 0x22222222, 0x33333333, 0x44444444 }, - { 0x55555555, 0x66666666, 0x77777777, 0x88888888 }, - { 0, 1, 2, 3 }, - { 0x11111111, 0x22222222, 0x33333333, 0x44444444 }, - }, - { - { 0x11111111, 0x22222222, 0x33333333, 0x44444444 }, - { 0x55555555, 0x66666666, 0x77777777, 0x88888888 }, - { 4, 5, 6, 7 }, - { 0x55555555, 0x66666666, 0x77777777, 0x88888888 }, - }, - { - { 0x11111111, 0x22222222, 0x33333333, 0x44444444 }, - { 0x55555555, 0x66666666, 0x77777777, 0x88888888 }, - { 0, 4, 1, 5 }, - { 0x11111111, 0x55555555, 0x22222222, 0x66666666 }, - }, - { - { 0x11111111, 0x22222222, 0x33333333, 0x44444444 }, - { 0x55555555, 0x66666666, 0x77777777, 0x88888888 }, - { 0, 7, 4, 3 }, - { 0x11111111, 0x88888888, 0x55555555, 0x44444444 }, - }, - { - { 0x11111111, 0x22222222, 0x33333333, 0x44444444 }, - { 0x55555555, 0x66666666, 0x77777777, 0x88888888 }, - { 0, 0, 0, 0 }, - { 0x11111111, 0x11111111, 0x11111111, 0x11111111 }, - }, - { - { 0x11111111, 0x22222222, 0x33333333, 0x44444444 }, - { 0x55555555, 0x66666666, 0x77777777, 0x88888888 }, - { 7, 7, 7, 7 }, - { 0x88888888, 0x88888888, 0x88888888, 0x88888888 }, - }, -}; - -extern void abort(void); - -int main() -{ - int i; - - for (i = 0; i < sizeof(tests)/sizeof(tests[0]); ++i) - { - V r = __builtin_shuffle(tests[i].in1, tests[i].in2, tests[i].mask); - if (__builtin_memcmp(&r, &tests[i].out, sizeof(V)) != 0) - abort(); - } - - return 0; -} - -#endif /* SIZEOF_INT */ diff --git a/gcc/testsuite/gcc.c-torture/execute/vect-shuffle-6.c b/gcc/testsuite/gcc.c-torture/execute/vect-shuffle-6.c deleted file mode 100644 index 63eaf96..0000000 --- a/gcc/testsuite/gcc.c-torture/execute/vect-shuffle-6.c +++ /dev/null @@ -1,64 +0,0 @@ -#if __SIZEOF_SHORT__ == 2 -typedef unsigned short V __attribute__((vector_size(16), may_alias)); - -struct S -{ - V in1, in2, mask, out; -}; - -struct S tests[] = { - { - { 0x1010, 0x2121, 0x3232, 0x4343, 0x5454, 0x6565, 0x7676, 0x8787 }, - { 0x9898, 0xa9a9, 0xbaba, 0xcbcb, 0xdcdc, 0xeded, 0xfefe, 0x0f0f }, - { 0, 1, 2, 3, 4, 5, 6, 7 }, - { 0x1010, 0x2121, 0x3232, 0x4343, 0x5454, 0x6565, 0x7676, 0x8787 }, - }, - { - { 0x1010, 0x2121, 0x3232, 0x4343, 0x5454, 0x6565, 0x7676, 0x8787 }, - { 0x9898, 0xa9a9, 0xbaba, 0xcbcb, 0xdcdc, 0xeded, 0xfefe, 0x0f0f }, - { 8, 9, 10, 11, 12, 13, 14, 15 }, - { 0x9898, 0xa9a9, 0xbaba, 0xcbcb, 0xdcdc, 0xeded, 0xfefe, 0x0f0f }, - }, - { - { 0x1010, 0x2121, 0x3232, 0x4343, 0x5454, 0x6565, 0x7676, 0x8787 }, - { 0x9898, 0xa9a9, 0xbaba, 0xcbcb, 0xdcdc, 0xeded, 0xfefe, 0x0f0f }, - { 0, 8, 1, 9, 2, 10, 3, 11 }, - { 0x1010, 0x9898, 0x2121, 0xa9a9, 0x3232, 0xbaba, 0x4343, 0xcbcb }, - }, - { - { 0x1010, 0x2121, 0x3232, 0x4343, 0x5454, 0x6565, 0x7676, 0x8787 }, - { 0x9898, 0xa9a9, 0xbaba, 0xcbcb, 0xdcdc, 0xeded, 0xfefe, 0x0f0f }, - { 0, 15, 4, 11, 12, 3, 7, 8 }, - { 0x1010, 0x0f0f, 0x5454, 0xcbcb, 0xdcdc, 0x4343, 0x8787, 0x9898 }, - }, - { - { 0x1010, 0x2121, 0x3232, 0x4343, 0x5454, 0x6565, 0x7676, 0x8787 }, - { 0x9898, 0xa9a9, 0xbaba, 0xcbcb, 0xdcdc, 0xeded, 0xfefe, 0x0f0f }, - { 0, 0, 0, 0, 0, 0, 0, 0 }, - { 0x1010, 0x1010, 0x1010, 0x1010, 0x1010, 0x1010, 0x1010, 0x1010 }, - }, - { - { 0x1010, 0x2121, 0x3232, 0x4343, 0x5454, 0x6565, 0x7676, 0x8787 }, - { 0x9898, 0xa9a9, 0xbaba, 0xcbcb, 0xdcdc, 0xeded, 0xfefe, 0x0f0f }, - { 14, 14, 14, 14, 14, 14, 14, 14 }, - { 0xfefe, 0xfefe, 0xfefe, 0xfefe, 0xfefe, 0xfefe, 0xfefe, 0xfefe }, - }, -}; - -extern void abort(void); - -int main() -{ - int i; - - for (i = 0; i < sizeof(tests)/sizeof(tests[0]); ++i) - { - V r = __builtin_shuffle(tests[i].in1, tests[i].in2, tests[i].mask); - if (__builtin_memcmp(&r, &tests[i].out, sizeof(V)) != 0) - abort(); - } - - return 0; -} - -#endif /* SIZEOF_SHORT */ diff --git a/gcc/testsuite/gcc.c-torture/execute/vect-shuffle-7.c b/gcc/testsuite/gcc.c-torture/execute/vect-shuffle-7.c deleted file mode 100644 index 3336c6f..0000000 --- a/gcc/testsuite/gcc.c-torture/execute/vect-shuffle-7.c +++ /dev/null @@ -1,70 +0,0 @@ -#if __SIZEOF_LONG_LONG__ == 8 -typedef unsigned long long V __attribute__((vector_size(16), may_alias)); - -struct S -{ - V in1, in2, mask, out; -}; - -struct S tests[] = { - { - { 0x1112131415161718, 0x2122232425262728 }, - { 0x3132333435363738, 0x4142434445464748 }, - { 0, 1 }, - { 0x1112131415161718, 0x2122232425262728 }, - }, - { - { 0x1112131415161718, 0x2122232425262728 }, - { 0x3132333435363738, 0x4142434445464748 }, - { 2, 3 }, - { 0x3132333435363738, 0x4142434445464748 }, - }, - { - { 0x1112131415161718, 0x2122232425262728 }, - { 0x3132333435363738, 0x4142434445464748 }, - { 0, 2 }, - { 0x1112131415161718, 0x3132333435363738 }, - }, - { - { 0x1112131415161718, 0x2122232425262728 }, - { 0x3132333435363738, 0x4142434445464748 }, - { 2, 1 }, - { 0x3132333435363738, 0x2122232425262728 }, - }, - { - { 0x1112131415161718, 0x2122232425262728 }, - { 0x3132333435363738, 0x4142434445464748 }, - { 3, 0 }, - { 0x4142434445464748, 0x1112131415161718 }, - }, - { - { 0x1112131415161718, 0x2122232425262728 }, - { 0x3132333435363738, 0x4142434445464748 }, - { 0, 0 }, - { 0x1112131415161718, 0x1112131415161718 }, - }, - { - { 0x1112131415161718, 0x2122232425262728 }, - { 0x3132333435363738, 0x4142434445464748 }, - { 3, 3 }, - { 0x4142434445464748, 0x4142434445464748 }, - }, -}; - -extern void abort(void); - -int main() -{ - int i; - - for (i = 0; i < sizeof(tests)/sizeof(tests[0]); ++i) - { - V r = __builtin_shuffle(tests[i].in1, tests[i].in2, tests[i].mask); - if (__builtin_memcmp(&r, &tests[i].out, sizeof(V)) != 0) - abort(); - } - - return 0; -} - -#endif /* SIZEOF_LONG_LONG */ diff --git a/gcc/testsuite/gcc.c-torture/execute/vect-shuffle-8.c b/gcc/testsuite/gcc.c-torture/execute/vect-shuffle-8.c deleted file mode 100644 index f98e6ec..0000000 --- a/gcc/testsuite/gcc.c-torture/execute/vect-shuffle-8.c +++ /dev/null @@ -1,55 +0,0 @@ -typedef unsigned char V __attribute__((vector_size(16), may_alias)); - -struct S -{ - V in1, in2, mask, out; -}; - -struct S tests[] = { - { - { 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25 }, - { 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45 }, - { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }, - { 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25 }, - }, - { - { 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25 }, - { 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45 }, - { 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31 }, - { 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45 }, - }, - { - { 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25 }, - { 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45 }, - { 7, 6, 5, 4, 16, 17, 18, 19, 31, 30, 29, 28, 3, 2, 1, 0 }, - { 17, 16, 15, 14, 30, 31, 32, 33, 45, 44, 43, 42, 13, 12, 11, 10 }, - }, - { - { 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25 }, - { 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45 }, - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - { 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10 }, - }, - { - { 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25 }, - { 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45 }, - { 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63 }, - { 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45 }, - }, -}; - -extern void abort(void); - -int main() -{ - int i; - - for (i = 0; i < sizeof(tests)/sizeof(tests[0]); ++i) - { - V r = __builtin_shuffle(tests[i].in1, tests[i].in2, tests[i].mask); - if (__builtin_memcmp(&r, &tests[i].out, sizeof(V)) != 0) - abort(); - } - - return 0; -} diff --git a/gcc/testsuite/gcc.c-torture/execute/vshuf-16.inc b/gcc/testsuite/gcc.c-torture/execute/vshuf-16.inc new file mode 100644 index 0000000..68f2646 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/vshuf-16.inc @@ -0,0 +1,81 @@ +/* Test fragment for vectors with 16 elements. */ + +#ifndef UNSUPPORTED + +struct S +{ + V in; + VI mask; + V out; +}; + +struct S tests[] = { + { + { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 }, + { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, }, + { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 }, + }, + { + { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 }, + { 0x10, 0x21, 0x32, 0x43, 0x54, 0x65, 0x76, 0x87, + 0x98, 0xa9, 0xba, 0xcb, 0xdc, 0xed, 0xfe, 0xff }, + { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 }, + }, + { + { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 }, + { 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 }, + { 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1 }, + }, + { + { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 }, + { 0, 2, 4, 6, 8, 10, 12, 14, 1, 3, 5, 7, 9, 11, 13, 15 }, + { 1, 3, 5, 7, 9, 11, 13, 15, 2, 4, 6, 8, 10, 12, 14, 16 }, + }, + { + { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 }, + { 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 }, + { 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 }, + }, +}; + +struct S2 +{ + V in1, in2; + VI mask; + V out; +}; + +struct S2 tests2[] = { + { + { 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25 }, + { 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45 }, + { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }, + { 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25 }, + }, + { + { 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25 }, + { 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45 }, + { 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31 }, + { 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45 }, + }, + { + { 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25 }, + { 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45 }, + { 7, 6, 5, 4, 16, 17, 18, 19, 31, 30, 29, 28, 3, 2, 1, 0 }, + { 17, 16, 15, 14, 30, 31, 32, 33, 45, 44, 43, 42, 13, 12, 11, 10 }, + }, + { + { 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25 }, + { 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45 }, + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10 }, + }, + { + { 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25 }, + { 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45 }, + { 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63 }, + { 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45 }, + }, +}; + +#endif diff --git a/gcc/testsuite/gcc.c-torture/execute/vshuf-2.inc b/gcc/testsuite/gcc.c-torture/execute/vshuf-2.inc new file mode 100644 index 0000000..ef778e5 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/vshuf-2.inc @@ -0,0 +1,38 @@ +/* Test fragment for vectors of 2 elements. */ + +#ifndef UNSUPPORTED + +struct S +{ + V in; + VI mask; + V out; +}; + +struct S tests[] = { + { { A, B }, { 0, 1 }, { A, B } }, + { { A, B }, { -16, -1 }, { A, B } }, + { { A, B }, { 1, 0 }, { B, A } }, + { { A, B }, { 0, 0 }, { A, A } }, + { { X, Y }, { 1, 1 }, { Y, Y } }, + { { X, Y }, { 1, 0 }, { Y, X } }, +}; + +struct S2 +{ + V in1, in2; + VI mask; + V out; +}; + +struct S2 tests2[] = { + { { A, B }, { X, Y }, { 0, 1 }, { A, B } }, + { { A, B }, { X, Y }, { 2, 3 }, { X, Y } }, + { { A, B }, { X, Y }, { 0, 2 }, { A, X } }, + { { A, B }, { X, Y }, { 2, 1 }, { X, B } }, + { { A, B }, { X, Y }, { 3, 0 }, { Y, A } }, + { { A, B }, { X, Y }, { 0, 0 }, { A, A } }, + { { A, B }, { X, Y }, { 3, 3 }, { Y, Y } }, +}; + +#endif diff --git a/gcc/testsuite/gcc.c-torture/execute/vshuf-4.inc b/gcc/testsuite/gcc.c-torture/execute/vshuf-4.inc new file mode 100644 index 0000000..d6e6e10 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/vshuf-4.inc @@ -0,0 +1,39 @@ +/* Test fragment for vectors of 4 elements. */ + +#ifndef UNSUPPORTED + +struct S +{ + V in; + VI mask; + V out; +}; + +struct S tests[] = { + { { A, B, C, D }, { 0, 1, 2, 3 }, { A, B, C, D }, }, + { { A, B, C, D }, { 0+1*4, 1+2*4, 2+3*4, 3+4*4 }, { A, B, C, D } }, + { { A, B, C, D }, { 3, 2, 1, 0 }, { D, C, B, A } }, + { { A, B, C, D }, { 0, 3, 2, 1 }, { A, D, C, B } }, + { { A, B, C, D }, { 0, 2, 1, 3 }, { A, C, B, D } }, + { { W, X, Y, Z }, { 3, 1, 2, 0 }, { Z, X, Y, W } }, + { { W, X, Y, Z }, { 0, 0, 0, 0 }, { W, W, W, W } }, + { { W, X, Y, Z }, { 1, 2, 1, 2 }, { X, Y, X, Y } }, +}; + +struct S2 +{ + V in1, in2; + VI mask; + V out; +}; + +struct S2 tests2[] = { + { { A, B, C, D }, { W, X, Y, Z }, { 0, 1, 2, 3 }, { A, B, C, D } }, + { { A, B, C, D }, { W, X, Y, Z }, { 4, 5, 6, 7 }, { W, X, Y, Z } }, + { { A, B, C, D }, { W, X, Y, Z }, { 0, 4, 1, 5 }, { A, W, B, X } }, + { { A, B, C, D }, { W, X, Y, Z }, { 0, 7, 4, 3 }, { A, Z, W, D } }, + { { A, B, C, D }, { W, X, Y, Z }, { 0, 0, 0, 0 }, { A, A, A, A } }, + { { A, B, C, D }, { W, X, Y, Z }, { 7, 7, 7, 7 }, { Z, Z, Z, Z } }, +}; + +#endif diff --git a/gcc/testsuite/gcc.c-torture/execute/vshuf-8.inc b/gcc/testsuite/gcc.c-torture/execute/vshuf-8.inc new file mode 100644 index 0000000..e647522 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/vshuf-8.inc @@ -0,0 +1,101 @@ +/* Test fragment for vectors of 8 elements. */ + +#ifndef UNSUPPORTED + +struct S +{ + V in; + VI mask; + V out; +}; + +struct S tests[] = { + { + { A1, B1, C1, D1, E1, F1, G1, H1 }, + { 0, 1, 2, 3, 4, 5, 6, 7 }, + { A1, B1, C1, D1, E1, F1, G1, H1 }, + }, + { + { A1, B1, C1, D1, E1, F1, G1, H1 }, + { 0x10, 0x21, 0x32, 0x43, 0x54, 0x65, 0x76, 0x87 }, + { A1, B1, C1, D1, E1, F1, G1, H1 }, + }, + { + { A1, B1, C1, D1, E1, F1, G1, H1 }, + { 7, 6, 5, 4, 3, 2, 1, 0 }, + { H1, G1, F1, E1, D1, C1, B1, A1 }, + }, + { + { A1, B1, C1, D1, E1, F1, G1, H1 }, + { 7, 0, 5, 3, 2, 4, 1, 6 }, + { H1, A1, F1, D1, C1, E1, B1, G1 }, + }, + { + { A1, B1, C1, D1, E1, F1, G1, H1 }, + { 0, 2, 1, 3, 4, 6, 5, 7 }, + { A1, C1, B1, D1, E1, G1, F1, H1 }, + }, + { + { A2, B2, C2, D2, E2, F2, G2, H2 }, + { 3, 1, 2, 0, 7, 5, 6, 4 }, + { D2, B2, C2, A2, H2, F2, G2, E2 }, + }, + { + { A2, B2, C2, D2, E2, F2, G2, H2 }, + { 0, 0, 0, 0 }, + { A2, A2, A2, A2, A2, A2, A2, A2 }, + }, + { + { A2, B2, C2, D2, E2, F2, G2, H2 }, + { 1, 6, 1, 6, 1, 6, 1, 6 }, + { B2, G2, B2, G2, B2, G2, B2, G2 }, + } +}; + +struct S2 +{ + V in1, in2; + VI mask; + V out; +}; + +struct S2 tests2[] = { + { + { A1, B1, C1, D1, E1, F1, G1, H1 }, + { A2, B2, C2, D2, E2, F2, G2, H2 }, + { 0, 1, 2, 3, 4, 5, 6, 7 }, + { A1, B1, C1, D1, E1, F1, G1, H1 }, + }, + { + { A1, B1, C1, D1, E1, F1, G1, H1 }, + { A2, B2, C2, D2, E2, F2, G2, H2 }, + { 8, 9, 10, 11, 12, 13, 14, 15 }, + { A2, B2, C2, D2, E2, F2, G2, H2 }, + }, + { + { A1, B1, C1, D1, E1, F1, G1, H1 }, + { A2, B2, C2, D2, E2, F2, G2, H2 }, + { 0, 8, 1, 9, 2, 10, 3, 11 }, + { A1, A2, B1, B2, C1, C2, D1, D2 }, + }, + { + { A1, B1, C1, D1, E1, F1, G1, H1 }, + { A2, B2, C2, D2, E2, F2, G2, H2 }, + { 0, 15, 4, 11, 12, 3, 7, 8 }, + { A1, H2, E1, D2, E2, D1, H1, A2 }, + }, + { + { A1, B1, C1, D1, E1, F1, G1, H1 }, + { A2, B2, C2, D2, E2, F2, G2, H2 }, + { 0, 0, 0, 0, 0, 0, 0, 0 }, + { A1, A1, A1, A1, A1, A1, A1, A1 }, + }, + { + { A1, B1, C1, D1, E1, F1, G1, H1 }, + { A2, B2, C2, D2, E2, F2, G2, H2 }, + { 0x1e, 0x2e, 0x3e, 0x4e, 0x5e, 0x6e, 0x7e, 0x8e }, + { G2, G2, G2, G2, G2, G2, G2, G2 }, + }, +}; + +#endif diff --git a/gcc/testsuite/gcc.c-torture/execute/vshuf-main.inc b/gcc/testsuite/gcc.c-torture/execute/vshuf-main.inc new file mode 100644 index 0000000..8487131 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/vshuf-main.inc @@ -0,0 +1,26 @@ +/* Driver fragment for __builtin_shuffle of any vector shape. */ + +extern void abort(void); + +int main() +{ +#ifndef UNSUPPORTED + int i; + + for (i = 0; i < sizeof(tests)/sizeof(tests[0]); ++i) + { + V r = __builtin_shuffle(tests[i].in, tests[i].mask); + if (__builtin_memcmp(&r, &tests[i].out, sizeof(V)) != 0) + abort(); + } + + for (i = 0; i < sizeof(tests2)/sizeof(tests2[0]); ++i) + { + V r = __builtin_shuffle(tests2[i].in1, tests2[i].in2, tests2[i].mask); + if (__builtin_memcmp(&r, &tests2[i].out, sizeof(V)) != 0) + abort(); + } +#endif + + return 0; +} diff --git a/gcc/testsuite/gcc.c-torture/execute/vshuf-v16qi.c b/gcc/testsuite/gcc.c-torture/execute/vshuf-v16qi.c new file mode 100644 index 0000000..dcd1de1 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/vshuf-v16qi.c @@ -0,0 +1,5 @@ +typedef unsigned char V __attribute__((vector_size(16))); +typedef V VI; + +#include "vshuf-16.inc" +#include "vshuf-main.inc" diff --git a/gcc/testsuite/gcc.c-torture/execute/vshuf-v2df.c b/gcc/testsuite/gcc.c-torture/execute/vshuf-v2df.c new file mode 100644 index 0000000..e88ec08 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/vshuf-v2df.c @@ -0,0 +1,15 @@ +#if __SIZEOF_DOUBLE__ == 8 && __SIZEOF_LONG_LONG__ == 8 +typedef double V __attribute__((vector_size(16))); +typedef unsigned long long VI __attribute__((vector_size(16))); +#else +#define UNSUPPORTED +#endif + +#define A 0.69314718055994530942 +#define B 2.7182818284590452354 + +#define X 3.14159265358979323846 +#define Y 1.41421356237309504880 + +#include "vshuf-2.inc" +#include "vshuf-main.inc" diff --git a/gcc/testsuite/gcc.c-torture/execute/vshuf-v2di.c b/gcc/testsuite/gcc.c-torture/execute/vshuf-v2di.c new file mode 100644 index 0000000..0985a0d --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/vshuf-v2di.c @@ -0,0 +1,15 @@ +#if __SIZEOF_LONG_LONG__ == 8 +typedef unsigned long long V __attribute__((vector_size(16))); +typedef V VI; +#else +#define UNSUPPORTED +#endif + +#define A 0x1112131415161718 +#define B 0x2122232425262728 + +#define X 0xc1c2c3c4c5c6c7c8 +#define Y 0xd1d2d3d4d5d6d7d8 + +#include "vshuf-2.inc" +#include "vshuf-main.inc" diff --git a/gcc/testsuite/gcc.c-torture/execute/vshuf-v2sf.c b/gcc/testsuite/gcc.c-torture/execute/vshuf-v2sf.c new file mode 100644 index 0000000..f9c40b2 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/vshuf-v2sf.c @@ -0,0 +1,21 @@ +#if __SIZEOF_FLOAT__ == 4 +typedef float V __attribute__((vector_size(8))); +# if __SIZEOF_INT__ == 4 +typedef unsigned int VI __attribute__((vector_size(8))); +# elif __SIZEOF_LONG__ == 4 +typedef unsigned long VI __attribute__((vector_size(8))); +# else +# define UNSUPPORTED +# endif +#else +# define UNSUPPORTED +#endif + +#define A 0.69314718055994530942f +#define B 2.7182818284590452354f + +#define X 3.14159265358979323846f +#define Y 1.41421356237309504880f + +#include "vshuf-2.inc" +#include "vshuf-main.inc" diff --git a/gcc/testsuite/gcc.c-torture/execute/vshuf-v2si.c b/gcc/testsuite/gcc.c-torture/execute/vshuf-v2si.c new file mode 100644 index 0000000..414743c --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/vshuf-v2si.c @@ -0,0 +1,18 @@ +#if __SIZEOF_INT__ == 4 +typedef unsigned int V __attribute__((vector_size(8))); +typedef V VI; +#elif __SIZEOF_LONG__ == 4 +typedef unsigned long V __attribute__((vector_size(8))); +typedef V VI; +#else +#define UNSUPPORTED +#endif + +#define A 0x11121314 +#define B 0x21222324 + +#define X 0xd1d2d3d4 +#define Y 0xe1e2e3e4 + +#include "vshuf-2.inc" +#include "vshuf-main.inc" diff --git a/gcc/testsuite/gcc.c-torture/execute/vshuf-v4df.c b/gcc/testsuite/gcc.c-torture/execute/vshuf-v4df.c new file mode 100644 index 0000000..c4030a7 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/vshuf-v4df.c @@ -0,0 +1,19 @@ +#if __SIZEOF_DOUBLE__ == 8 && __SIZEOF_LONG_LONG__ == 8 +typedef double V __attribute__((vector_size(32))); +typedef unsigned long long VI __attribute__((vector_size(32))); +#else +#define UNSUPPORTED +#endif + +#define A 0.69314718055994530942 +#define B 2.7182818284590452354 +#define C 2.30258509299404568402 +#define D 1.4426950408889634074 + +#define W 0.31830988618379067154 +#define X 3.14159265358979323846 +#define Y 1.41421356237309504880 +#define Z 0.70710678118654752440 + +#include "vshuf-4.inc" +#include "vshuf-main.inc" diff --git a/gcc/testsuite/gcc.c-torture/execute/vshuf-v4di.c b/gcc/testsuite/gcc.c-torture/execute/vshuf-v4di.c new file mode 100644 index 0000000..a84aebe --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/vshuf-v4di.c @@ -0,0 +1,19 @@ +#if __SIZEOF_LONG_LONG__ == 8 +typedef unsigned long long V __attribute__((vector_size(32))); +typedef V VI; +#else +#define UNSUPPORTED +#endif + +#define A 0x1112131415161718 +#define B 0x2122232425262728 +#define C 0x3132333435363738 +#define D 0x4142434445464748 + +#define W 0xc1c2c3c4c5c6c7c8 +#define X 0xd1d2d3d4d5d6d7d8 +#define Y 0xe1e2e3e4e5e6e7e8 +#define Z 0xf1f2f3f4f5f6f7f8 + +#include "vshuf-4.inc" +#include "vshuf-main.inc" diff --git a/gcc/testsuite/gcc.c-torture/execute/vshuf-v4hi.c b/gcc/testsuite/gcc.c-torture/execute/vshuf-v4hi.c new file mode 100644 index 0000000..64a2bb4 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/vshuf-v4hi.c @@ -0,0 +1,15 @@ +typedef unsigned short V __attribute__((vector_size(8))); +typedef V VI; + +#define A 0x1112 +#define B 0x2122 +#define C 0x3132 +#define D 0x4142 + +#define W 0xc1c2 +#define X 0xd1d2 +#define Y 0xe1e2 +#define Z 0xf1f2 + +#include "vshuf-4.inc" +#include "vshuf-main.inc" diff --git a/gcc/testsuite/gcc.c-torture/execute/vshuf-v4sf.c b/gcc/testsuite/gcc.c-torture/execute/vshuf-v4sf.c new file mode 100644 index 0000000..2836725 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/vshuf-v4sf.c @@ -0,0 +1,25 @@ +#if __SIZEOF_FLOAT__ == 4 +typedef float V __attribute__((vector_size(16))); +# if __SIZEOF_INT__ == 4 +typedef unsigned int VI __attribute__((vector_size(16))); +# elif __SIZEOF_LONG__ == 4 +typedef unsigned long VI __attribute__((vector_size(16))); +# else +# define UNSUPPORTED +# endif +#else +# define UNSUPPORTED +#endif + +#define A 0.69314718055994530942f +#define B 2.7182818284590452354f +#define C 2.30258509299404568402f +#define D 1.4426950408889634074f + +#define W 0.31830988618379067154f +#define X 3.14159265358979323846f +#define Y 1.41421356237309504880f +#define Z 0.70710678118654752440f + +#include "vshuf-4.inc" +#include "vshuf-main.inc" diff --git a/gcc/testsuite/gcc.c-torture/execute/vshuf-v4si.c b/gcc/testsuite/gcc.c-torture/execute/vshuf-v4si.c new file mode 100644 index 0000000..289ec1b --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/vshuf-v4si.c @@ -0,0 +1,22 @@ +#if __SIZEOF_INT__ == 4 +typedef unsigned int V __attribute__((vector_size(16))); +typedef V VI; +#elif __SIZEOF_LONG__ == 4 +typedef unsigned long V __attribute__((vector_size(16))); +typedef V VI; +#else +# define UNSUPPORTED +#endif + +#define A 0x11121314 +#define B 0x21222324 +#define C 0x31323334 +#define D 0x41424344 + +#define W 0xc1c2c3c4 +#define X 0xd1d2d3d4 +#define Y 0xe1e2e3e4 +#define Z 0xf1f2f3f4 + +#include "vshuf-4.inc" +#include "vshuf-main.inc" diff --git a/gcc/testsuite/gcc.c-torture/execute/vshuf-v8hi.c b/gcc/testsuite/gcc.c-torture/execute/vshuf-v8hi.c new file mode 100644 index 0000000..ce442c5 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/vshuf-v8hi.c @@ -0,0 +1,23 @@ +typedef unsigned short V __attribute__((vector_size(16))); +typedef V VI; + +#define A1 0x1112 +#define B1 0x2122 +#define C1 0x3132 +#define D1 0x4142 +#define E1 0x5152 +#define F1 0x6162 +#define G1 0x7172 +#define H1 0x8182 + +#define A2 0x9192 +#define B2 0xa1a2 +#define C2 0xb1b2 +#define D2 0xc1c2 +#define E2 0xd1d2 +#define F2 0xe1e2 +#define G2 0xf1f2 +#define H2 0x0102 + +#include "vshuf-8.inc" +#include "vshuf-main.inc" diff --git a/gcc/testsuite/gcc.c-torture/execute/vshuf-v8qi.c b/gcc/testsuite/gcc.c-torture/execute/vshuf-v8qi.c new file mode 100644 index 0000000..349ec6d --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/vshuf-v8qi.c @@ -0,0 +1,23 @@ +typedef unsigned char V __attribute__((vector_size(8))); +typedef V VI; + +#define A1 0x11 +#define B1 0x12 +#define C1 0x13 +#define D1 0x14 +#define E1 0x15 +#define F1 0x16 +#define G1 0x17 +#define H1 0x18 + +#define A2 0xf1 +#define B2 0xf2 +#define C2 0xf3 +#define D2 0xf4 +#define E2 0xf5 +#define F2 0xf6 +#define G2 0xf7 +#define H2 0xf8 + +#include "vshuf-8.inc" +#include "vshuf-main.inc" diff --git a/gcc/testsuite/gcc.c-torture/execute/vshuf-v8si.c b/gcc/testsuite/gcc.c-torture/execute/vshuf-v8si.c new file mode 100644 index 0000000..5b0a2c3 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/vshuf-v8si.c @@ -0,0 +1,30 @@ +#if __SIZEOF_INT__ == 4 +typedef unsigned int V __attribute__((vector_size(32))); +typedef V VI; +#elif __SIZEOF_LONG__ == 4 +typedef unsigned long V __attribute__((vector_size(32))); +typedef V VI; +#else +# define UNSUPPORTED +#endif + +#define A1 0x11121314 +#define B1 0x21222324 +#define C1 0x31323334 +#define D1 0x41424344 +#define E1 0x51525354 +#define F1 0x61626364 +#define G1 0x71727374 +#define H1 0x81828384 + +#define A2 0x91929394 +#define B2 0xa1a2a3a4 +#define C2 0xb1b2b3b4 +#define D2 0xc1c2c3c4 +#define E2 0xd1d2d3d4 +#define F2 0xe1e2e3e4 +#define G2 0xf1f2f3f4 +#define H2 0x01020304 + +#include "vshuf-8.inc" +#include "vshuf-main.inc"