From patchwork Thu Oct 6 11:46:47 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Georg-Johann Lay X-Patchwork-Id: 118064 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 E2E41B6FA3 for ; Thu, 6 Oct 2011 22:47:49 +1100 (EST) Received: (qmail 25535 invoked by alias); 6 Oct 2011 11:47:41 -0000 Received: (qmail 25026 invoked by uid 22791); 6 Oct 2011 11:47:31 -0000 X-SWARE-Spam-Status: No, hits=-1.3 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_NONE, TW_CB, TW_XC, TW_XD, TW_XF X-Spam-Check-By: sourceware.org Received: from mo-p00-ob.rzone.de (HELO mo-p00-ob.rzone.de) (81.169.146.162) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 06 Oct 2011 11:47:10 +0000 X-RZG-AUTH: :LXoWVUeid/7A29J/hMvvT2k715jHQaJercGObUOFkj18odoYNahU4Q== X-RZG-CLASS-ID: mo00 Received: from [192.168.0.22] (business-188-111-022-002.static.arcor-ip.net [188.111.22.2]) by smtp.strato.de (cohen mo29) (RZmta 26.10 AUTH) with ESMTPA id u0441en96Bap2k ; Thu, 6 Oct 2011 13:46:47 +0200 (MEST) Message-ID: <4E8D9527.1010305@gjlay.de> Date: Thu, 06 Oct 2011 13:46:47 +0200 From: Georg-Johann Lay User-Agent: Thunderbird 2.0.0.24 (X11/20100302) MIME-Version: 1.0 To: Richard Guenther CC: Artem Shinkarov , Richard Henderson , "Joseph S. Myers" , Duncan Sands , gcc-patches@gcc.gnu.org Subject: Re: Vector shuffling References: <4E724C78.6020006@redhat.com> <4E83332D.1010002@redhat.com> <4E848D45.5000001@redhat.com> <4E86080A.7000009@redhat.com> <4E863399.6020803@redhat.com> <4E89D11A.1020707@redhat.com> <4E8D884A.7040405@gjlay.de> <4E8D8B07.30209@gjlay.de> In-Reply-To: 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 Richard Guenther schrieb: > On Thu, Oct 6, 2011 at 1:03 PM, Georg-Johann Lay wrote: >> Richard Guenther schrieb: >>> On Thu, Oct 6, 2011 at 12:51 PM, Georg-Johann Lay wrote: >>>> Artem Shinkarov schrieb: >>>>> Hi, Richard >>>>> >>>>> There is a problem with the testcases of the patch you have committed >>>>> for me. The code in every test-case is doubled. Could you please, >>>>> apply the following patch, otherwise it would fail all the tests from >>>>> the vector-shuffle-patch would fail. >>>>> >>>>> Also, if it is possible, could you change my name from in the >>>>> ChangeLog from "Artem Shinkarov" to "Artjoms Sinkarovs". The last >>>>> version is the way I am spelled in the passport, and the name I use in >>>>> the ChangeLog. >>>>> >>>>> Thanks, >>>>> Artem. >>>>> >>>>> On Mon, Oct 3, 2011 at 4:13 PM, Richard Henderson wrote: >>>>>> On 10/03/2011 05:14 AM, Artem Shinkarov wrote: >>>>>>> Hi, can anyone commit it please? >>>>>>> >>>>>>> Richard? >>>>>>> Or may be Richard? >>>>>> Committed. >>>>>> >>>>>> r~ >>>>>> >>>>> Hi, Richard >>>>> >>>>> There is a problem with the testcases of the patch you have committed >>>>> for me. The code in every test-case is doubled. Could you please, >>>>> apply the following patch, otherwise it would fail all the tests from >>>>> the vector-shuffle-patch would fail. >>>>> >>>>> Also, if it is possible, could you change my name from in the >>>>> ChangeLog from "Artem Shinkarov" to "Artjoms Sinkarovs". The last >>>>> version is the way I am spelled in the passport, and the name I use in >>>>> the ChangeLog. >>>>> >>>>> >>>>> Thanks, >>>>> Artem. >>>>> >>>> The following test cases cause FAILs because main cannot be found by the linker >>>> because if __SIZEOF_INT__ != 4 you are trying to compile and run an empty file. >>>> >>>>> Index: gcc/testsuite/gcc.c-torture/execute/vect-shuffle-1.c >>>>> Index: gcc/testsuite/gcc.c-torture/execute/vect-shuffle-5.c >>>> The following patch avoids __SIZEOF_INT__. >>>> >>>> Ok by some maintainer to commit? >>> On a general note, if you need to add .x files, consider moving the >>> test to gcc.dg/torture instead. >> So should I move all vect-shuffle-*.c files so that they are kept together? > > Yes. So here it is. Lightly tested on my target: All tests either PASS or are UNSUPPORTED now. Ok? Johann testsuite/ * lib/target-supports.exp (check_effective_target_int32): New function. (check_effective_target_short16): New function. (check_effective_target_longlong64): New function. * gcc.c-torture/execute/vect-shuffle-1.c: Move to gcc.dg/torture. * gcc.c-torture/execute/vect-shuffle-2.c: Move to gcc.dg/torture. * gcc.c-torture/execute/vect-shuffle-3.c: Move to gcc.dg/torture. * gcc.c-torture/execute/vect-shuffle-4.c: Move to gcc.dg/torture. * gcc.c-torture/execute/vect-shuffle-5.c: Move to gcc.dg/torture. * gcc.c-torture/execute/vect-shuffle-6.c: Move to gcc.dg/torture. * gcc.c-torture/execute/vect-shuffle-7.c: Move to gcc.dg/torture. * gcc.c-torture/execute/vect-shuffle-8.c: Move to gcc.dg/torture. * gcc.dg/torture/vect-shuffle-1.c: Use dg-require-effective-target int32 instead of __SIZEOF_INT__ == 4. * gcc.dg/torture/vect-shuffle-5.c: Ditto. * gcc.dg/torture/vect-shuffle-2.c: Use dg-require-effective-target short16 instead of __SIZEOF_SHORT__ == 2. * gcc.dg/torture/vect-shuffle-6.c: Ditto. * gcc.dg/torture/vect-shuffle-3.c: Use dg-require-effective-target longlong64 instead of __SIZEOF_LONG_LONG__ == 8. * gcc.dg/torture/vect-shuffle-7.c: Ditto. Index: lib/target-supports.exp =================================================================== --- lib/target-supports.exp (revision 179599) +++ lib/target-supports.exp (working copy) @@ -1583,6 +1583,33 @@ proc check_effective_target_int16 { } { }] } +# Returns 1 if we're generating 32-bit integers with the +# default options, 0 otherwise. + +proc check_effective_target_int32 { } { + return [check_no_compiler_messages int32 object { + int dummy[sizeof (int) == 4 ? 1 : -1]; + }] +} + +# Returns 1 if we're generating 64-bit long long integers with the +# default options, 0 otherwise. + +proc check_effective_target_longlong64 { } { + return [check_no_compiler_messages longlong64 object { + int dummy[sizeof (long long ) == 8 ? 1 : -1]; + }] +} + +# Returns 1 if we're generating 16-bit short integers with the +# default options, 0 otherwise. + +proc check_effective_target_short16 { } { + return [check_no_compiler_messages short16 object { + int dummy[sizeof (short) == 2 ? 1 : -1]; + }] +} + # Return 1 if we're generating 64-bit code using default options, 0 # otherwise. Index: gcc.c-torture/execute/vect-shuffle-2.c =================================================================== --- gcc.c-torture/execute/vect-shuffle-2.c (revision 179599) +++ gcc.c-torture/execute/vect-shuffle-2.c (working copy) @@ -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 */ Index: gcc.c-torture/execute/vect-shuffle-4.c =================================================================== --- gcc.c-torture/execute/vect-shuffle-4.c (revision 179599) +++ gcc.c-torture/execute/vect-shuffle-4.c (working copy) @@ -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; -} Index: gcc.c-torture/execute/vect-shuffle-6.c =================================================================== --- gcc.c-torture/execute/vect-shuffle-6.c (revision 179599) +++ gcc.c-torture/execute/vect-shuffle-6.c (working copy) @@ -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 */ Index: gcc.c-torture/execute/vect-shuffle-8.c =================================================================== --- gcc.c-torture/execute/vect-shuffle-8.c (revision 179599) +++ gcc.c-torture/execute/vect-shuffle-8.c (working copy) @@ -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; -} Index: gcc.c-torture/execute/vect-shuffle-1.c =================================================================== --- gcc.c-torture/execute/vect-shuffle-1.c (revision 179599) +++ gcc.c-torture/execute/vect-shuffle-1.c (working copy) @@ -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 */ Index: gcc.c-torture/execute/vect-shuffle-3.c =================================================================== --- gcc.c-torture/execute/vect-shuffle-3.c (revision 179599) +++ gcc.c-torture/execute/vect-shuffle-3.c (working copy) @@ -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 */ Index: gcc.c-torture/execute/vect-shuffle-5.c =================================================================== --- gcc.c-torture/execute/vect-shuffle-5.c (revision 179599) +++ gcc.c-torture/execute/vect-shuffle-5.c (working copy) @@ -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 */ Index: gcc.c-torture/execute/vect-shuffle-7.c =================================================================== --- gcc.c-torture/execute/vect-shuffle-7.c (revision 179599) +++ gcc.c-torture/execute/vect-shuffle-7.c (working copy) @@ -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 */ Index: gcc.dg/torture/vect-shuffle-6.c =================================================================== --- gcc.dg/torture/vect-shuffle-6.c (revision 179599) +++ gcc.dg/torture/vect-shuffle-6.c (working copy) @@ -1,4 +1,6 @@ -#if __SIZEOF_SHORT__ == 2 +/* { dg-do run } */ +/* { dg-require-effective-target short16 } */ + typedef unsigned short V __attribute__((vector_size(16), may_alias)); struct S @@ -60,5 +62,3 @@ int main() return 0; } - -#endif /* SIZEOF_SHORT */ Index: gcc.dg/torture/vect-shuffle-7.c =================================================================== --- gcc.dg/torture/vect-shuffle-7.c (revision 179599) +++ gcc.dg/torture/vect-shuffle-7.c (working copy) @@ -1,4 +1,6 @@ -#if __SIZEOF_LONG_LONG__ == 8 +/* { dg-do run } */ +/* { dg-require-effective-target longlong64 } */ + typedef unsigned long long V __attribute__((vector_size(16), may_alias)); struct S @@ -66,5 +68,3 @@ int main() return 0; } - -#endif /* SIZEOF_LONG_LONG */ Index: gcc.dg/torture/vect-shuffle-1.c =================================================================== --- gcc.dg/torture/vect-shuffle-1.c (revision 179599) +++ gcc.dg/torture/vect-shuffle-1.c (working copy) @@ -1,4 +1,6 @@ -#if __SIZEOF_INT__ == 4 +/* { dg-do run } */ +/* { dg-require-effective-target int32 } */ + typedef unsigned int V __attribute__((vector_size(16), may_alias)); struct S @@ -64,5 +66,3 @@ int main() return 0; } - -#endif /* SIZEOF_INT */ Index: gcc.dg/torture/vect-shuffle-2.c =================================================================== --- gcc.dg/torture/vect-shuffle-2.c (revision 179599) +++ gcc.dg/torture/vect-shuffle-2.c (working copy) @@ -1,4 +1,6 @@ -#if __SIZEOF_SHORT__ == 2 +/* { dg-do run } */ +/* { dg-require-effective-target short16 } */ + typedef unsigned short V __attribute__((vector_size(16), may_alias)); struct S @@ -64,5 +66,3 @@ int main() return 0; } - -#endif /* SIZEOF_SHORT */ Index: gcc.dg/torture/vect-shuffle-3.c =================================================================== --- gcc.dg/torture/vect-shuffle-3.c (revision 179599) +++ gcc.dg/torture/vect-shuffle-3.c (working copy) @@ -1,4 +1,6 @@ -#if __SIZEOF_LONG_LONG__ == 8 +/* { dg-do run } */ +/* { dg-require-effective-target longlong64 } */ + typedef unsigned long long V __attribute__((vector_size(16), may_alias)); struct S @@ -54,5 +56,3 @@ int main() return 0; } - -#endif /* SIZEOF_LONG_LONG */ Index: gcc.dg/torture/vect-shuffle-5.c =================================================================== --- gcc.dg/torture/vect-shuffle-5.c (revision 179599) +++ gcc.dg/torture/vect-shuffle-5.c (working copy) @@ -1,4 +1,6 @@ -#if __SIZEOF_INT__ == 4 +/* { dg-do run } */ +/* { dg-require-effective-target int32 } */ + typedef unsigned int V __attribute__((vector_size(16), may_alias)); struct S @@ -60,5 +62,3 @@ int main() return 0; } - -#endif /* SIZEOF_INT */