From: Kelvin Nilsen Date: Tue, 12 May 2020 02:37:41 +0000 (-0500) Subject: rs6000: Built-in cleanups for vec_clzm, vec_ctzm, and vec_gnb X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3ebd168b443d946f9381d012176e38598987b133;p=gcc.git rs6000: Built-in cleanups for vec_clzm, vec_ctzm, and vec_gnb Changes to the built-in specification occurred after early patches added support for these. The name of vec_clzm became vec_cntlzm, and vec_ctzm became vec_cnttzm. Four of the overloaded forms of vec_gnb were removed, and the fourth argument redefined as an unsigned int, not an unsigned char. This patch reflects those changes in the code and test cases. Eight of the vec_gnb test cases are removed as a result. [gcc] 2020-05-11 Kelvin Nilsen * config/rs6000/altivec.h (vec_clzm): Rename to vec_cntlzm. (vec_ctzm): Rename to vec_cnttzm. * config/rs6000/rs6000-c.c (altivec_resolve_overloaded_builtin): Change fourth operand for vec_ternarylogic to require compatibility with unsigned SImode rather than unsigned QImode. * config/rs6000/rs6000-call.c (altivec_overloaded_builtins): Remove overloaded forms of vec_gnb that are no longer needed. * doc/extend.texi (PowerPC AltiVec Built-in Functions Available for a Future Architecture): Replace vec_clzm with vec_cntlzm; replace vec_ctzm with vec_cntlzm; remove four unwanted forms of vec_gnb; move vec_ternarylogic documentation into this section and replace const unsigned char with const unsigned int as its fourth argument. [gcc/testsuite] 2020-05-11 Kelvin Nilsen * gcc.target/powerpc/vec-clzm-0.c: Rename to... * gcc.target/powerpc/vec-cntlzm-0.c: ...this. * gcc.target/powerpc/vec-clzm-1.c: Rename to... * gcc.target/powerpc/vec-cntlzm-1.c: ...this. * gcc.target/powerpc/vec-ctzm-0.c: Rename to... * gcc.target/powerpc/vec-cnttzm-0.c: ...this. * gcc.target/powerpc/vec-ctzm-1.c: Rename to... * gcc.target/powerpc/vec-cnttzm-1.c: ...this. * gcc.target/powerpc/vec-gnb-8.c: Rename to... * gcc.target/powerpc/vec-gnb-0.c: ...this, deleting the old file. * gcc.target/powerpc/vec-gnb-9.c: Rename to... * gcc.target/powerpc/vec-gnb-1.c: ...this, deleting the old file. * gcc.target/powerpc/vec-gnb-10.c: Rename to... * gcc.target/powerpc/vec-gnb-2.c: ...this, deleting the old file. * gcc.target/powerpc/vec-gnb-3.c: Delete. * gcc.target/powerpc/vec-gnb-4.c: Delete. * gcc.target/powerpc/vec-gnb-5.c: Delete. * gcc.target/powerpc/vec-gnb-6.c: Delete. * gcc.target/powerpc/vec-gnb-7.c: Delete. --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 0edf5808215..ef6867527a1 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,19 @@ +2020-05-11 Kelvin Nilsen + + * config/rs6000/altivec.h (vec_clzm): Rename to vec_cntlzm. + (vec_ctzm): Rename to vec_cnttzm. + * config/rs6000/rs6000-c.c (altivec_resolve_overloaded_builtin): + Change fourth operand for vec_ternarylogic to require + compatibility with unsigned SImode rather than unsigned QImode. + * config/rs6000/rs6000-call.c (altivec_overloaded_builtins): + Remove overloaded forms of vec_gnb that are no longer needed. + * doc/extend.texi (PowerPC AltiVec Built-in Functions Available + for a Future Architecture): Replace vec_clzm with vec_cntlzm; + replace vec_ctzm with vec_cntlzm; remove four unwanted forms of + vec_gnb; move vec_ternarylogic documentation into this section + and replace const unsigned char with const unsigned int as its + fourth argument. + 2020-05-11 Carl Love * config/rs6000/altivec.h (vec_genpcvm): New #define. diff --git a/gcc/config/rs6000/altivec.h b/gcc/config/rs6000/altivec.h index 3729ceaf336..85c5626877d 100644 --- a/gcc/config/rs6000/altivec.h +++ b/gcc/config/rs6000/altivec.h @@ -689,8 +689,8 @@ __altivec_scalar_pred(vec_any_nle, #ifdef _ARCH_PWR_FUTURE /* May modify these macro definitions if future capabilities overload with support for different vector argument and result types. */ -#define vec_clzm(a, b) __builtin_altivec_vclzdm (a, b) -#define vec_ctzm(a, b) __builtin_altivec_vctzdm (a, b) +#define vec_cntlzm(a, b) __builtin_altivec_vclzdm (a, b) +#define vec_cnttzm(a, b) __builtin_altivec_vctzdm (a, b) #define vec_pdep(a, b) __builtin_altivec_vpdepd (a, b) #define vec_pext(a, b) __builtin_altivec_vpextd (a, b) #define vec_cfuge(a, b) __builtin_altivec_vcfuged (a, b) diff --git a/gcc/config/rs6000/rs6000-c.c b/gcc/config/rs6000/rs6000-c.c index cacaea00bd4..07ca33a89b4 100644 --- a/gcc/config/rs6000/rs6000-c.c +++ b/gcc/config/rs6000/rs6000-c.c @@ -1813,7 +1813,7 @@ altivec_resolve_overloaded_builtin (location_t loc, tree fndecl, && rs6000_builtin_type_compatible (types[1], desc->op2) && rs6000_builtin_type_compatible (types[2], desc->op3) && rs6000_builtin_type_compatible (types[3], - RS6000_BTI_UINTQI)) + RS6000_BTI_UINTSI)) { if (rs6000_builtin_decls[desc->overloaded_code] == NULL_TREE) unsupported_builtin = true; diff --git a/gcc/config/rs6000/rs6000-call.c b/gcc/config/rs6000/rs6000-call.c index d4dffc5615f..04189eaaa53 100644 --- a/gcc/config/rs6000/rs6000-call.c +++ b/gcc/config/rs6000/rs6000-call.c @@ -5522,14 +5522,6 @@ const struct altivec_builtin_types altivec_overloaded_builtins[] = { RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_UINTSI, 0 }, - { FUTURE_BUILTIN_VEC_GNB, FUTURE_BUILTIN_VGNB, RS6000_BTI_unsigned_long_long, - RS6000_BTI_unsigned_V16QI, RS6000_BTI_UINTQI, 0 }, - { FUTURE_BUILTIN_VEC_GNB, FUTURE_BUILTIN_VGNB, RS6000_BTI_unsigned_long_long, - RS6000_BTI_unsigned_V8HI, RS6000_BTI_UINTQI, 0 }, - { FUTURE_BUILTIN_VEC_GNB, FUTURE_BUILTIN_VGNB, RS6000_BTI_unsigned_long_long, - RS6000_BTI_unsigned_V4SI, RS6000_BTI_UINTQI, 0 }, - { FUTURE_BUILTIN_VEC_GNB, FUTURE_BUILTIN_VGNB, RS6000_BTI_unsigned_long_long, - RS6000_BTI_unsigned_V2DI, RS6000_BTI_UINTQI, 0 }, { FUTURE_BUILTIN_VEC_GNB, FUTURE_BUILTIN_VGNB, RS6000_BTI_unsigned_long_long, RS6000_BTI_unsigned_V1TI, RS6000_BTI_UINTQI, 0 }, { FUTURE_BUILTIN_VEC_XXGENPCVM, FUTURE_BUILTIN_XXGENPCVM_V2DI, diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi index c352c512285..4c5ed3f3bac 100644 --- a/gcc/doc/extend.texi +++ b/gcc/doc/extend.texi @@ -20762,19 +20762,19 @@ Perform a vector centrifuge operation, as if implemented by the Future @smallexample @exdent vector unsigned long long int -@exdent vec_clzm (vector unsigned long long int, vector unsigned long long int) +@exdent vec_cntlzm (vector unsigned long long int, vector unsigned long long int) @end smallexample Perform a vector count leading zeros under bit mask operation, as if implemented by the Future @code{vclzdm} instruction. -@findex vec_clzm +@findex vec_cntlzm @smallexample @exdent vector unsigned long long int -@exdent vec_ctzm (vector unsigned long long int, vector unsigned long long int) +@exdent vec_cnttzm (vector unsigned long long int, vector unsigned long long int) @end smallexample Perform a vector count trailing zeros under bit mask operation, as if implemented by the Future @code{vctzdm} instruction. -@findex vec_ctzm +@findex vec_cnttzm @smallexample @exdent vector signed char @@ -20802,14 +20802,6 @@ value of @code{n} that is greater than 16 is treated as if it equaled 16. @smallexample @exdent vector unsigned long long int -@exdent vec_gnb (vector unsigned char, const unsigned char) -@exdent vector unsigned long long int -@exdent vec_gnb (vector unsigned short, const unsigned char) -@exdent vector unsigned long long int -@exdent vec_gnb (vector unsigned int, const unsigned char) -@exdent vector unsigned long long int -@exdent vec_gnb (vector unsigned long long int, const unsigned char) -@exdent vector unsigned long long int @exdent vec_gnb (vector unsigned __int128, const unsigned char) @end smallexample Perform a 128-bit vector gather operation, as if implemented by the Future @@ -20889,6 +20881,28 @@ little-endian targets. Choose this built-in to check for presence of zero element if the same argument is also passed to @code{vec_strir}. @findex vec_strir_p +@smallexample +@exdent vector unsigned char +@exdent vec_ternarylogic (vector unsigned char, vector unsigned char, + vector unsigned char, const unsigned int) +@exdent vector unsigned short +@exdent vec_ternarylogic (vector unsigned short, vector unsigned short, + vector unsigned short, const unsigned int) +@exdent vector unsigned int +@exdent vec_ternarylogic (vector unsigned int, vector unsigned int, + vector unsigned int, const unsigned int) +@exdent vector unsigned long long int +@exdent vec_ternarylogic (vector unsigned long long int, vector unsigned long long int, + vector unsigned long long int, const unsigned int) +@exdent vector unsigned __int128 +@exdent vec_ternarylogic (vector unsigned __int128, vector unsigned __int128, + vector unsigned __int128, const unsigned int) +@end smallexample +Perform a 128-bit vector evaluate operation, as if implemented by the +Future @code{xxeval} instruction. The fourth argument must be a literal +integer value between 0 and 255 inclusive. +@findex vec_ternarylogic + @smallexample @exdent vector unsigned char vec_genpcvm (vector unsigned char, const int) @exdent vector unsigned short vec_genpcvm (vector unsigned short, const int) @@ -22123,28 +22137,6 @@ else @end smallexample @end deftypefn -@smallexample -@exdent vector unsigned char -@exdent vec_ternarylogic (vector unsigned char, vector unsigned char, - vector unsigned char, const unsigned char) -@exdent vector unsigned short -@exdent vec_ternarylogic (vector unsigned short, vector unsigned short, - vector unsigned short, const unsigned char) -@exdent vector unsigned int -@exdent vec_ternarylogic (vector unsigned int, vector unsigned int, - vector unsigned int, const unsigned char) -@exdent vector unsigned long long int -@exdent vec_ternarylogic (vector unsigned long long int, vector unsigned long long int, - vector unsigned long long int, const unsigned char) -@exdent vector unsigned __int128 -@exdent vec_ternarylogic (vector unsigned __int128, vector unsigned __int128, - vector unsigned __int128, const unsigned char) -@end smallexample -Perform a 128-bit vector evaluate operation, as if implemented by the -Future @code{xxeval} instruction. The fourth argument must be a literal -integer value between 0 and 255 inclusive. -@findex vec_ternarylogic - The following built-in functions are made available by @option{-mmmx}. All of them generate the machine instruction that is part of the name. diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 960dff0f1e3..5064e684b6b 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,25 @@ +2020-05-11 Kelvin Nilsen + + * gcc.target/powerpc/vec-clzm-0.c: Rename to... + * gcc.target/powerpc/vec-cntlzm-0.c: ...this. + * gcc.target/powerpc/vec-clzm-1.c: Rename to... + * gcc.target/powerpc/vec-cntlzm-1.c: ...this. + * gcc.target/powerpc/vec-ctzm-0.c: Rename to... + * gcc.target/powerpc/vec-cnttzm-0.c: ...this. + * gcc.target/powerpc/vec-ctzm-1.c: Rename to... + * gcc.target/powerpc/vec-cnttzm-1.c: ...this. + * gcc.target/powerpc/vec-gnb-8.c: Rename to... + * gcc.target/powerpc/vec-gnb-0.c: ...this, deleting the old file. + * gcc.target/powerpc/vec-gnb-9.c: Rename to... + * gcc.target/powerpc/vec-gnb-1.c: ...this, deleting the old file. + * gcc.target/powerpc/vec-gnb-10.c: Rename to... + * gcc.target/powerpc/vec-gnb-2.c: ...this, deleting the old file. + * gcc.target/powerpc/vec-gnb-3.c: Delete. + * gcc.target/powerpc/vec-gnb-4.c: Delete. + * gcc.target/powerpc/vec-gnb-5.c: Delete. + * gcc.target/powerpc/vec-gnb-6.c: Delete. + * gcc.target/powerpc/vec-gnb-7.c: Delete. + 2020-05-11 Carl Love * gcc.target/powerpc/xxgenpc-runnable.c: New. diff --git a/gcc/testsuite/gcc.target/powerpc/vec-clzm-0.c b/gcc/testsuite/gcc.target/powerpc/vec-clzm-0.c deleted file mode 100644 index 099c5dc99bf..00000000000 --- a/gcc/testsuite/gcc.target/powerpc/vec-clzm-0.c +++ /dev/null @@ -1,54 +0,0 @@ -/* { dg-do compile } */ -/* { dg-options "-mdejagnu-cpu=future" } */ - -#include - -extern void abort (void); - -vector unsigned long long int -do_vec_clzm (vector unsigned long long int source, - vector unsigned long long int mask) -{ - return vec_clzm (source, mask); -} - -int main (int argc, char *argv []) -{ - vector unsigned long long int source_a = { 0xa5f07e3cull, 0x7e3ca5f0ull }; - vector unsigned long long int source_b = { 0x3ca5f07eull, 0x5a0fe7c3ull }; - - vector unsigned long long int mask_a = { 0xffff0000ull, 0x0000ffffull }; - vector unsigned long long int mask_b = { 0x0f0f0f0full, 0xf0f0f0f0ull }; - - /* See cntlzdm-0.c for derivation of expected results. - - result_aa [0] is compute (source [0], mask [0]; - result_aa [1] is compute (source [1], mask [1]. - - result_ab [0] is compute (source [0], mask [2]; - result_ab [1] is compute (source [1], mask [3]. - - result_ba [0] is compute (source [2], mask [0]; - result_ba [1] is compute (source [3], mask [1]. - - result_bb [0] is compute (source [2], mask [2]; - result_bb [1] is compute (source [3], mask [3]. */ - - vector unsigned long long int result_aa = { 0, 0 }; - vector unsigned long long int result_ab = { 1, 1 }; - vector unsigned long long int result_ba = { 2, 0 }; - vector unsigned long long int result_bb = { 0, 1 }; - - if (!vec_all_eq (do_vec_clzm (source_a, mask_a), result_aa)) - abort (); - if (!vec_all_eq (do_vec_clzm (source_a, mask_b), result_ab)) - abort (); - if (!vec_all_eq (do_vec_clzm (source_b, mask_a), result_ba)) - abort (); - if (!vec_all_eq (do_vec_clzm (source_b, mask_b), result_bb)) - abort (); - - return 0; -} - -/* { dg-final { scan-assembler {\mvclzdm\M} } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/vec-clzm-1.c b/gcc/testsuite/gcc.target/powerpc/vec-clzm-1.c deleted file mode 100644 index 43b86114487..00000000000 --- a/gcc/testsuite/gcc.target/powerpc/vec-clzm-1.c +++ /dev/null @@ -1,54 +0,0 @@ -/* { dg-do run } */ -/* { dg-require-effective-target powerpc_future_hw } */ -/* { dg-options "-mdejagnu-cpu=future" } */ - -#include - -extern void abort (void); - -vector unsigned long long int -do_vec_clzm (vector unsigned long long int source, - vector unsigned long long int mask) -{ - return vec_clzm (source, mask); -} - -int main (int argc, char *argv []) -{ - vector unsigned long long int source_a = { 0xa5f07e3cull, 0x7e3ca5f0ull }; - vector unsigned long long int source_b = { 0x3ca5f07eull, 0x5a0fe7c3ull }; - - vector unsigned long long int mask_a = { 0xffff0000ull, 0x0000ffffull }; - vector unsigned long long int mask_b = { 0x0f0f0f0full, 0xf0f0f0f0ull }; - - /* See cntlzdm-0.c for derivation of expected results. - - result_aa [0] is compute (source [0], mask [0]; - result_aa [1] is compute (source [1], mask [1]. - - result_ab [0] is compute (source [0], mask [2]; - result_ab [1] is compute (source [1], mask [3]. - - result_ba [0] is compute (source [2], mask [0]; - result_ba [1] is compute (source [3], mask [1]. - - result_bb [0] is compute (source [2], mask [2]; - result_bb [1] is compute (source [3], mask [3]. */ - - vector unsigned long long int result_aa = { 0, 0 }; - vector unsigned long long int result_ab = { 1, 1 }; - vector unsigned long long int result_ba = { 2, 0 }; - vector unsigned long long int result_bb = { 0, 1 }; - - if (!vec_all_eq (do_vec_clzm (source_a, mask_a), result_aa)) - abort (); - if (!vec_all_eq (do_vec_clzm (source_a, mask_b), result_ab)) - abort (); - if (!vec_all_eq (do_vec_clzm (source_b, mask_a), result_ba)) - abort (); - if (!vec_all_eq (do_vec_clzm (source_b, mask_b), result_bb)) - abort (); - - return 0; -} - diff --git a/gcc/testsuite/gcc.target/powerpc/vec-cntlzm-0.c b/gcc/testsuite/gcc.target/powerpc/vec-cntlzm-0.c new file mode 100644 index 00000000000..6fe0cbd8875 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/vec-cntlzm-0.c @@ -0,0 +1,54 @@ +/* { dg-do compile } */ +/* { dg-options "-mdejagnu-cpu=future" } */ + +#include + +extern void abort (void); + +vector unsigned long long int +do_vec_cntlzm (vector unsigned long long int source, + vector unsigned long long int mask) +{ + return vec_cntlzm (source, mask); +} + +int main (int argc, char *argv []) +{ + vector unsigned long long int source_a = { 0xa5f07e3cull, 0x7e3ca5f0ull }; + vector unsigned long long int source_b = { 0x3ca5f07eull, 0x5a0fe7c3ull }; + + vector unsigned long long int mask_a = { 0xffff0000ull, 0x0000ffffull }; + vector unsigned long long int mask_b = { 0x0f0f0f0full, 0xf0f0f0f0ull }; + + /* See cntlzdm-0.c for derivation of expected results. + + result_aa [0] is compute (source [0], mask [0]; + result_aa [1] is compute (source [1], mask [1]. + + result_ab [0] is compute (source [0], mask [2]; + result_ab [1] is compute (source [1], mask [3]. + + result_ba [0] is compute (source [2], mask [0]; + result_ba [1] is compute (source [3], mask [1]. + + result_bb [0] is compute (source [2], mask [2]; + result_bb [1] is compute (source [3], mask [3]. */ + + vector unsigned long long int result_aa = { 0, 0 }; + vector unsigned long long int result_ab = { 1, 1 }; + vector unsigned long long int result_ba = { 2, 0 }; + vector unsigned long long int result_bb = { 0, 1 }; + + if (!vec_all_eq (do_vec_cntlzm (source_a, mask_a), result_aa)) + abort (); + if (!vec_all_eq (do_vec_cntlzm (source_a, mask_b), result_ab)) + abort (); + if (!vec_all_eq (do_vec_cntlzm (source_b, mask_a), result_ba)) + abort (); + if (!vec_all_eq (do_vec_cntlzm (source_b, mask_b), result_bb)) + abort (); + + return 0; +} + +/* { dg-final { scan-assembler {\mvclzdm\M} } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/vec-cntlzm-1.c b/gcc/testsuite/gcc.target/powerpc/vec-cntlzm-1.c new file mode 100644 index 00000000000..7e058ed8843 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/vec-cntlzm-1.c @@ -0,0 +1,54 @@ +/* { dg-do run } */ +/* { dg-require-effective-target powerpc_future_hw } */ +/* { dg-options "-mdejagnu-cpu=future" } */ + +#include + +extern void abort (void); + +vector unsigned long long int +do_vec_cntlzm (vector unsigned long long int source, + vector unsigned long long int mask) +{ + return vec_cntlzm (source, mask); +} + +int main (int argc, char *argv []) +{ + vector unsigned long long int source_a = { 0xa5f07e3cull, 0x7e3ca5f0ull }; + vector unsigned long long int source_b = { 0x3ca5f07eull, 0x5a0fe7c3ull }; + + vector unsigned long long int mask_a = { 0xffff0000ull, 0x0000ffffull }; + vector unsigned long long int mask_b = { 0x0f0f0f0full, 0xf0f0f0f0ull }; + + /* See cntlzdm-0.c for derivation of expected results. + + result_aa [0] is compute (source [0], mask [0]; + result_aa [1] is compute (source [1], mask [1]. + + result_ab [0] is compute (source [0], mask [2]; + result_ab [1] is compute (source [1], mask [3]. + + result_ba [0] is compute (source [2], mask [0]; + result_ba [1] is compute (source [3], mask [1]. + + result_bb [0] is compute (source [2], mask [2]; + result_bb [1] is compute (source [3], mask [3]. */ + + vector unsigned long long int result_aa = { 0, 0 }; + vector unsigned long long int result_ab = { 1, 1 }; + vector unsigned long long int result_ba = { 2, 0 }; + vector unsigned long long int result_bb = { 0, 1 }; + + if (!vec_all_eq (do_vec_cntlzm (source_a, mask_a), result_aa)) + abort (); + if (!vec_all_eq (do_vec_cntlzm (source_a, mask_b), result_ab)) + abort (); + if (!vec_all_eq (do_vec_cntlzm (source_b, mask_a), result_ba)) + abort (); + if (!vec_all_eq (do_vec_cntlzm (source_b, mask_b), result_bb)) + abort (); + + return 0; +} + diff --git a/gcc/testsuite/gcc.target/powerpc/vec-cnttzm-0.c b/gcc/testsuite/gcc.target/powerpc/vec-cnttzm-0.c new file mode 100644 index 00000000000..94fac3bf817 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/vec-cnttzm-0.c @@ -0,0 +1,54 @@ +/* { dg-do compile } */ +/* { dg-options "-mdejagnu-cpu=future" } */ + +#include + +extern void abort (void); + +vector unsigned long long int +do_vec_cnttzm (vector unsigned long long int source, + vector unsigned long long int mask) +{ + return vec_cnttzm (source, mask); +} + +int main (int argc, char *argv []) +{ + vector unsigned long long int source_a = { 0xa5f07e3cull, 0x7e3ca5f0ull }; + vector unsigned long long int source_b = { 0x3ca5f07eull, 0x5a0fe7c3ull }; + + vector unsigned long long int mask_a = { 0xffff0000ull, 0x0000ffffull }; + vector unsigned long long int mask_b = { 0x0f0f0f0full, 0xf0f0f0f0ull }; + + /* See cnttzdm-0.c for derivation of expected results. + + result_aa [0] is compute (source [0], mask [0]; + result_aa [1] is compute (source [1], mask [1]. + + result_ab [0] is compute (source [0], mask [2]; + result_ab [1] is compute (source [1], mask [3]. + + result_ba [0] is compute (source [2], mask [0]; + result_ba [1] is compute (source [3], mask [1]. + + result_bb [0] is compute (source [2], mask [2]; + result_bb [1] is compute (source [3], mask [3]. */ + + vector unsigned long long int result_aa = { 4, 4 }; + vector unsigned long long int result_ab = { 2, 0 }; + vector unsigned long long int result_ba = { 0, 0 }; + vector unsigned long long int result_bb = { 1, 2 }; + + if (!vec_all_eq (do_vec_cnttzm (source_a, mask_a), result_aa)) + abort (); + if (!vec_all_eq (do_vec_cnttzm (source_a, mask_b), result_ab)) + abort (); + if (!vec_all_eq (do_vec_cnttzm (source_b, mask_a),result_ba)) + abort (); + if (!vec_all_eq (do_vec_cnttzm (source_b, mask_b), result_bb)) + abort (); + + return 0; +} + +/* { dg-final { scan-assembler {\mvctzdm\M} } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/vec-cnttzm-1.c b/gcc/testsuite/gcc.target/powerpc/vec-cnttzm-1.c new file mode 100644 index 00000000000..27ff3bd4961 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/vec-cnttzm-1.c @@ -0,0 +1,53 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target powerpc_future_hw } */ +/* { dg-options "-mdejagnu-cpu=future" } */ + +#include + +extern void abort (void); + +vector unsigned long long int +do_vec_cnttzm (vector unsigned long long int source, + vector unsigned long long int mask) +{ + return vec_cnttzm (source, mask); +} + +int main (int argc, char *argv []) +{ + vector unsigned long long int source_a = { 0xa5f07e3cull, 0x7e3ca5f0ull }; + vector unsigned long long int source_b = { 0x3ca5f07eull, 0x5a0fe7c3ull }; + + vector unsigned long long int mask_a = { 0xffff0000ull, 0x0000ffffull }; + vector unsigned long long int mask_b = { 0x0f0f0f0full, 0xf0f0f0f0ull }; + + /* See cnttzdm-0.c for derivation of expected results. + + result_aa [0] is compute (source [0], mask [0]; + result_aa [1] is compute (source [1], mask [1]. + + result_ab [0] is compute (source [0], mask [2]; + result_ab [1] is compute (source [1], mask [3]. + + result_ba [0] is compute (source [2], mask [0]; + result_ba [1] is compute (source [3], mask [1]. + + result_bb [0] is compute (source [2], mask [2]; + result_bb [1] is compute (source [3], mask [3]. */ + + vector unsigned long long int result_aa = { 4, 4 }; + vector unsigned long long int result_ab = { 2, 0 }; + vector unsigned long long int result_ba = { 0, 0 }; + vector unsigned long long int result_bb = { 1, 2 }; + + if (!vec_all_eq (do_vec_cnttzm (source_a, mask_a), result_aa)) + abort (); + if (!vec_all_eq (do_vec_cnttzm (source_a, mask_b), result_ab)) + abort (); + if (!vec_all_eq (do_vec_cnttzm (source_b, mask_a),result_ba)) + abort (); + if (!vec_all_eq (do_vec_cnttzm (source_b, mask_b), result_bb)) + abort (); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/powerpc/vec-ctzm-0.c b/gcc/testsuite/gcc.target/powerpc/vec-ctzm-0.c deleted file mode 100644 index 315edf4d4cd..00000000000 --- a/gcc/testsuite/gcc.target/powerpc/vec-ctzm-0.c +++ /dev/null @@ -1,54 +0,0 @@ -/* { dg-do compile } */ -/* { dg-options "-mdejagnu-cpu=future" } */ - -#include - -extern void abort (void); - -vector unsigned long long int -do_vec_ctzm (vector unsigned long long int source, - vector unsigned long long int mask) -{ - return vec_ctzm (source, mask); -} - -int main (int argc, char *argv []) -{ - vector unsigned long long int source_a = { 0xa5f07e3cull, 0x7e3ca5f0ull }; - vector unsigned long long int source_b = { 0x3ca5f07eull, 0x5a0fe7c3ull }; - - vector unsigned long long int mask_a = { 0xffff0000ull, 0x0000ffffull }; - vector unsigned long long int mask_b = { 0x0f0f0f0full, 0xf0f0f0f0ull }; - - /* See cnttzdm-0.c for derivation of expected results. - - result_aa [0] is compute (source [0], mask [0]; - result_aa [1] is compute (source [1], mask [1]. - - result_ab [0] is compute (source [0], mask [2]; - result_ab [1] is compute (source [1], mask [3]. - - result_ba [0] is compute (source [2], mask [0]; - result_ba [1] is compute (source [3], mask [1]. - - result_bb [0] is compute (source [2], mask [2]; - result_bb [1] is compute (source [3], mask [3]. */ - - vector unsigned long long int result_aa = { 4, 4 }; - vector unsigned long long int result_ab = { 2, 0 }; - vector unsigned long long int result_ba = { 0, 0 }; - vector unsigned long long int result_bb = { 1, 2 }; - - if (!vec_all_eq (do_vec_ctzm (source_a, mask_a), result_aa)) - abort (); - if (!vec_all_eq (do_vec_ctzm (source_a, mask_b), result_ab)) - abort (); - if (!vec_all_eq (do_vec_ctzm (source_b, mask_a),result_ba)) - abort (); - if (!vec_all_eq (do_vec_ctzm (source_b, mask_b), result_bb)) - abort (); - - return 0; -} - -/* { dg-final { scan-assembler {\mvctzdm\M} } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/vec-ctzm-1.c b/gcc/testsuite/gcc.target/powerpc/vec-ctzm-1.c deleted file mode 100644 index 3dc4a03ab09..00000000000 --- a/gcc/testsuite/gcc.target/powerpc/vec-ctzm-1.c +++ /dev/null @@ -1,53 +0,0 @@ -/* { dg-do compile } */ -/* { dg-require-effective-target powerpc_future_hw } */ -/* { dg-options "-mdejagnu-cpu=future" } */ - -#include - -extern void abort (void); - -vector unsigned long long int -do_vec_ctzm (vector unsigned long long int source, - vector unsigned long long int mask) -{ - return vec_ctzm (source, mask); -} - -int main (int argc, char *argv []) -{ - vector unsigned long long int source_a = { 0xa5f07e3cull, 0x7e3ca5f0ull }; - vector unsigned long long int source_b = { 0x3ca5f07eull, 0x5a0fe7c3ull }; - - vector unsigned long long int mask_a = { 0xffff0000ull, 0x0000ffffull }; - vector unsigned long long int mask_b = { 0x0f0f0f0full, 0xf0f0f0f0ull }; - - /* See cnttzdm-0.c for derivation of expected results. - - result_aa [0] is compute (source [0], mask [0]; - result_aa [1] is compute (source [1], mask [1]. - - result_ab [0] is compute (source [0], mask [2]; - result_ab [1] is compute (source [1], mask [3]. - - result_ba [0] is compute (source [2], mask [0]; - result_ba [1] is compute (source [3], mask [1]. - - result_bb [0] is compute (source [2], mask [2]; - result_bb [1] is compute (source [3], mask [3]. */ - - vector unsigned long long int result_aa = { 4, 4 }; - vector unsigned long long int result_ab = { 2, 0 }; - vector unsigned long long int result_ba = { 0, 0 }; - vector unsigned long long int result_bb = { 1, 2 }; - - if (!vec_all_eq (do_vec_ctzm (source_a, mask_a), result_aa)) - abort (); - if (!vec_all_eq (do_vec_ctzm (source_a, mask_b), result_ab)) - abort (); - if (!vec_all_eq (do_vec_ctzm (source_b, mask_a),result_ba)) - abort (); - if (!vec_all_eq (do_vec_ctzm (source_b, mask_b), result_bb)) - abort (); - - return 0; -} diff --git a/gcc/testsuite/gcc.target/powerpc/vec-gnb-0.c b/gcc/testsuite/gcc.target/powerpc/vec-gnb-0.c index a95c29cf31d..f18bb16ffb2 100644 --- a/gcc/testsuite/gcc.target/powerpc/vec-gnb-0.c +++ b/gcc/testsuite/gcc.target/powerpc/vec-gnb-0.c @@ -5,10 +5,8 @@ extern void abort (void); -/* This test is replicated for every different vector type since - vec_gnb is polymorphic. */ unsigned long long int -do_vec_gnb (vector unsigned char source, int stride) +do_vec_gnb (vector unsigned __int128 source, int stride) { switch (stride) { @@ -46,15 +44,15 @@ main (int argc, char *argv []) /* The last array element appears in the left-most (first) bit positions of the vector register. */ - vector unsigned char source_a = { - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x88, 0x88, 0x88, 0x88 }; - vector unsigned char source_b = { - 0, 0, 0, 0, 0, 0, 0, 0, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }; - vector unsigned char source_c = { - 0, 0, 0, 0, 0, 0, 0, 0, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88 }; - vector unsigned char source_d = { - 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }; + vector unsigned __int128 source_a = + { ((unsigned __int128) 0x8888888800000000ull) << 64 }; + vector unsigned __int128 source_b = + { ((unsigned __int128) 0x8080808080808080ull) << 64 }; + vector unsigned __int128 source_c = + { ((unsigned __int128) 0x8888888888888888ull) << 64 }; + vector unsigned __int128 source_d = + { 0x8080808080808080ull | + ((unsigned __int128) 0x8080808080808080ull) << 64 }; unsigned long long int results [] = { 0xaaaa000000000000ull, 0xaaaa000000000000ull, diff --git a/gcc/testsuite/gcc.target/powerpc/vec-gnb-1.c b/gcc/testsuite/gcc.target/powerpc/vec-gnb-1.c index e8ceed55994..ee9c44f88b2 100644 --- a/gcc/testsuite/gcc.target/powerpc/vec-gnb-1.c +++ b/gcc/testsuite/gcc.target/powerpc/vec-gnb-1.c @@ -6,10 +6,8 @@ extern void abort (void); -/* This test is replicated for every different vector type since - vec_gnb is polymorphic. */ unsigned long long int -do_vec_gnb (vector unsigned char source, int stride) +do_vec_gnb (vector unsigned __int128 source, int stride) { switch (stride) { @@ -47,15 +45,15 @@ main (int argc, char *argv []) /* The last array element appears in the left-most (first) bit positions of the vector register. */ - vector unsigned char source_a = { - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x88, 0x88, 0x88, 0x88 }; - vector unsigned char source_b = { - 0, 0, 0, 0, 0, 0, 0, 0, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }; - vector unsigned char source_c = { - 0, 0, 0, 0, 0, 0, 0, 0, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88 }; - vector unsigned char source_d = { - 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }; + vector unsigned __int128 source_a = + { ((unsigned __int128) 0x8888888800000000ull) << 64 }; + vector unsigned __int128 source_b = + { ((unsigned __int128) 0x8080808080808080ull) << 64 }; + vector unsigned __int128 source_c = + { ((unsigned __int128) 0x8888888888888888ull) << 64 }; + vector unsigned __int128 source_d = + { 0x8080808080808080ull | + ((unsigned __int128) 0x8080808080808080ull) << 64 }; unsigned long long int results [] = { 0xaaaa000000000000ull, 0xaaaa000000000000ull, @@ -72,4 +70,3 @@ main (int argc, char *argv []) return 0; } - diff --git a/gcc/testsuite/gcc.target/powerpc/vec-gnb-10.c b/gcc/testsuite/gcc.target/powerpc/vec-gnb-10.c deleted file mode 100644 index 73ff0d9fea7..00000000000 --- a/gcc/testsuite/gcc.target/powerpc/vec-gnb-10.c +++ /dev/null @@ -1,72 +0,0 @@ -/* { dg-do compile } */ -/* { dg-options "-mdejagnu-cpu=future" } */ - -#include - -extern void abort (void); - -unsigned long long int -do_vec_gnb (vector unsigned char source, unsigned char stride) -{ - switch (stride) - { - case 2: - return vec_gnb (source, 0); /* { dg-error "between 2 and 7" } */ - case 3: - return vec_gnb (source, -1); /* { dg-error "between 2 and 7" } */ - case 4: - return vec_gnb (source, 8); /* { dg-error "between 2 and 7" } */ - case 5: - return vec_gnb (source, 1); /* { dg-error "between 2 and 7" } */ - case 6: - return vec_gnb (source, stride); /* { dg-error "unsigned literal" } */ - case 7: - return vec_gnb (source, 7); - - default: - /* Illegal value of stride */ - abort (); - return 0; - } -} - -int -main (int argc, char *argv []) -{ - /* For result = 0xaaaa_0000_0000_0000, use: - stride = 2: binary 1x0x_1x0x_1x0x_... = 0x8888_8888_0000_0000, 0 - stride = 4: binary 1xxx_0xxx_1xxx_0xxxx = 0x8080_8080_8080_8080, 0 - - For result = 0xaaaa_aaaa_0000_0000, use: - stride = 2: source = 0x8888_8888_8888_8888, 0x0 } - stride = 4: source = { 0x8080_8080_8080_8080, 0x8080_8080_8080_8080 } - */ - - /* The last array element appears in the left-most (first) bit - positions of the vector register. */ - vector unsigned char source_a = { - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x88, 0x88, 0x88, 0x88 }; - vector unsigned char source_b = { - 0, 0, 0, 0, 0, 0, 0, 0, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }; - vector unsigned char source_c = { - 0, 0, 0, 0, 0, 0, 0, 0, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88 }; - vector unsigned char source_d = { - 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }; - - unsigned long long int results [] = - { 0xaaaa000000000000ull, 0xaaaa000000000000ull, - 0xaaaaaaaa00000000ull, 0xaaaaaaaa00000000ull }; - - if (do_vec_gnb (source_a, 2) != results [0]) - abort (); - if (do_vec_gnb (source_b, 4) != results [1]) - abort (); - if (do_vec_gnb (source_c, 2) != results [2]) - abort (); - if (do_vec_gnb (source_d, 4) != results [3]) - abort (); - - return 0; -} - diff --git a/gcc/testsuite/gcc.target/powerpc/vec-gnb-2.c b/gcc/testsuite/gcc.target/powerpc/vec-gnb-2.c index eb51a8db219..591f701e820 100644 --- a/gcc/testsuite/gcc.target/powerpc/vec-gnb-2.c +++ b/gcc/testsuite/gcc.target/powerpc/vec-gnb-2.c @@ -5,23 +5,21 @@ extern void abort (void); -/* This test is replicated for every different vector type since - vec_gnb is polymorphic. */ unsigned long long int -do_vec_gnb (vector unsigned short int source, int stride) +do_vec_gnb (vector unsigned __int128 source, int stride) { switch (stride) { case 2: - return vec_gnb (source, 2); + return vec_gnb (source, 0); /* { dg-error "between 2 and 7" } */ case 3: - return vec_gnb (source, 3); + return vec_gnb (source, -1); /* { dg-error "between 2 and 7" } */ case 4: - return vec_gnb (source, 4); + return vec_gnb (source, 8); /* { dg-error "between 2 and 7" } */ case 5: - return vec_gnb (source, 5); + return vec_gnb (source, 1); /* { dg-error "between 2 and 7" } */ case 6: - return vec_gnb (source, 6); + return vec_gnb (source, stride); /* { dg-error "unsigned literal" } */ case 7: return vec_gnb (source, 7); @@ -46,13 +44,15 @@ main (int argc, char *argv []) /* The last array element appears in the left-most (first) bit positions of the vector register. */ - vector unsigned short int source_a = { 0, 0, 0, 0, 0, 0, 0x8888, 0x8888 }; - vector unsigned short int source_b = { - 0, 0, 0, 0, 0x8080, 0x8080, 0x8080, 0x8080 }; - vector unsigned short int source_c = { - 0, 0, 0, 0, 0x8888, 0x8888, 0x8888, 0x8888 }; - vector unsigned short int source_d = { - 0x8080, 0x8080, 0x8080, 0x8080, 0x8080, 0x8080, 0x8080, 0x8080 }; + vector unsigned __int128 source_a = + { ((unsigned __int128) 0x8888888800000000ull) << 64 }; + vector unsigned __int128 source_b = + { ((unsigned __int128) 0x8080808080808080ull) << 64 }; + vector unsigned __int128 source_c = + { ((unsigned __int128) 0x8888888888888888ull) << 64 }; + vector unsigned __int128 source_d = + { 0x8080808080808080ull | + ((unsigned __int128) 0x8080808080808080ull) << 64 }; unsigned long long int results [] = { 0xaaaa000000000000ull, 0xaaaa000000000000ull, @@ -70,4 +70,3 @@ main (int argc, char *argv []) return 0; } -/* { dg-final { scan-assembler {\mvgnb\M} } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/vec-gnb-3.c b/gcc/testsuite/gcc.target/powerpc/vec-gnb-3.c deleted file mode 100644 index f36b91a83e5..00000000000 --- a/gcc/testsuite/gcc.target/powerpc/vec-gnb-3.c +++ /dev/null @@ -1,72 +0,0 @@ -/* { dg-do run } */ -/* { dg-require-effective-target powerpc_future_hw } */ -/* { dg-options "-mdejagnu-cpu=future" } */ - -#include - -extern void abort (void); - -/* This test is replicated for every different vector type since - vec_gnb is polymorphic. */ -unsigned long long int -do_vec_gnb (vector unsigned short int source, int stride) -{ - switch (stride) - { - case 2: - return vec_gnb (source, 2); - case 3: - return vec_gnb (source, 3); - case 4: - return vec_gnb (source, 4); - case 5: - return vec_gnb (source, 5); - case 6: - return vec_gnb (source, 6); - case 7: - return vec_gnb (source, 7); - - default: - /* Illegal value of stride */ - abort (); - return 0; - } -} - -int -main (int argc, char *argv []) -{ - /* For result = 0xaaaa_0000_0000_0000, use: - stride = 2: binary 1x0x_1x0x_1x0x_... = 0x8888_8888_0000_0000, 0 - stride = 4: binary 1xxx_0xxx_1xxx_0xxxx = 0x8080_8080_8080_8080, 0 - - For result = 0xaaaa_aaaa_0000_0000, use: - stride = 2: source = 0x8888_8888_8888_8888, 0x0 } - stride = 4: source = { 0x8080_8080_8080_8080, 0x8080_8080_8080_8080 } - */ - - /* The last array element appears in the left-most (first) bit - positions of the vector register. */ - vector unsigned short int source_a = { 0, 0, 0, 0, 0, 0, 0x8888, 0x8888 }; - vector unsigned short int source_b = { - 0, 0, 0, 0, 0x8080, 0x8080, 0x8080, 0x8080 }; - vector unsigned short int source_c = { - 0, 0, 0, 0, 0x8888, 0x8888, 0x8888, 0x8888 }; - vector unsigned short int source_d = { - 0x8080, 0x8080, 0x8080, 0x8080, 0x8080, 0x8080, 0x8080, 0x8080 }; - - unsigned long long int results [] = - { 0xaaaa000000000000ull, 0xaaaa000000000000ull, - 0xaaaaaaaa00000000ull, 0xaaaaaaaa00000000ull }; - - if (do_vec_gnb (source_a, 2) != results [0]) - abort (); - if (do_vec_gnb (source_b, 4) != results [1]) - abort (); - if (do_vec_gnb (source_c, 2) != results [2]) - abort (); - if (do_vec_gnb (source_d, 4) != results [3]) - abort (); - - return 0; -} diff --git a/gcc/testsuite/gcc.target/powerpc/vec-gnb-4.c b/gcc/testsuite/gcc.target/powerpc/vec-gnb-4.c deleted file mode 100644 index df312ae1b28..00000000000 --- a/gcc/testsuite/gcc.target/powerpc/vec-gnb-4.c +++ /dev/null @@ -1,71 +0,0 @@ -/* { dg-do compile } */ -/* { dg-options "-mdejagnu-cpu=future" } */ - -#include - -extern void abort (void); - -/* This test is replicated for every different vector type since - vec_gnb is polymorphic. */ -unsigned long long int -do_vec_gnb (vector unsigned int source, int stride) -{ - switch (stride) - { - case 2: - return vec_gnb (source, 2); - case 3: - return vec_gnb (source, 3); - case 4: - return vec_gnb (source, 4); - case 5: - return vec_gnb (source, 5); - case 6: - return vec_gnb (source, 6); - case 7: - return vec_gnb (source, 7); - - default: - /* Illegal value of stride */ - abort (); - return 0; - } -} - -int -main (int argc, char *argv []) -{ - /* For result = 0xaaaa_0000_0000_0000, use: - stride = 2: binary 1x0x_1x0x_1x0x_... = 0x8888_8888_0000_0000, 0 - stride = 4: binary 1xxx_0xxx_1xxx_0xxxx = 0x8080_8080_8080_8080, 0 - - For result = 0xaaaa_aaaa_0000_0000, use: - stride = 2: source = 0x8888_8888_8888_8888, 0x0 } - stride = 4: source = { 0x8080_8080_8080_8080, 0x8080_8080_8080_8080 } - */ - - /* The last array element appears in the left-most (first) bit - positions of the vector register. */ - vector unsigned int source_a = { 0, 0, 0, 0x88888888 }; - vector unsigned int source_b = { 0, 0, 0x80808080, 0x80808080 }; - vector unsigned int source_c = { 0, 0, 0x88888888, 0x88888888 }; - vector unsigned int source_d = - { 0x80808080, 0x80808080, 0x80808080, 0x80808080 }; - - unsigned long long int results [] = - { 0xaaaa000000000000ull, 0xaaaa000000000000ull, - 0xaaaaaaaa00000000ull, 0xaaaaaaaa00000000ull }; - - if (do_vec_gnb (source_a, 2) != results [0]) - abort (); - if (do_vec_gnb (source_b, 4) != results [1]) - abort (); - if (do_vec_gnb (source_c, 2) != results [2]) - abort (); - if (do_vec_gnb (source_d, 4) != results [3]) - abort (); - - return 0; -} - -/* { dg-final { scan-assembler {\mvgnb\M} } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/vec-gnb-5.c b/gcc/testsuite/gcc.target/powerpc/vec-gnb-5.c deleted file mode 100644 index 1c3c3fa72c0..00000000000 --- a/gcc/testsuite/gcc.target/powerpc/vec-gnb-5.c +++ /dev/null @@ -1,71 +0,0 @@ -/* { dg-do run } */ -/* { dg-require-effective-target powerpc_future_hw } */ -/* { dg-options "-mdejagnu-cpu=future" } */ - -#include - -extern void abort (void); - -/* This test is replicated for every different vector type since - vec_gnb is polymorphic. */ -unsigned long long int -do_vec_gnb (vector unsigned int source, int stride) -{ - switch (stride) - { - case 2: - return vec_gnb (source, 2); - case 3: - return vec_gnb (source, 3); - case 4: - return vec_gnb (source, 4); - case 5: - return vec_gnb (source, 5); - case 6: - return vec_gnb (source, 6); - case 7: - return vec_gnb (source, 7); - - default: - /* Illegal value of stride */ - abort (); - return 0; - } -} - -int -main (int argc, char *argv []) -{ - /* For result = 0xaaaa_0000_0000_0000, use: - stride = 2: binary 1x0x_1x0x_1x0x_... = 0x8888_8888_0000_0000, 0 - stride = 4: binary 1xxx_0xxx_1xxx_0xxxx = 0x8080_8080_8080_8080, 0 - - For result = 0xaaaa_aaaa_0000_0000, use: - stride = 2: source = 0x8888_8888_8888_8888, 0x0 } - stride = 4: source = { 0x8080_8080_8080_8080, 0x8080_8080_8080_8080 } - */ - - /* The last array element appears in the left-most (first) bit - positions of the vector register. */ - vector unsigned int source_a = { 0, 0, 0, 0x88888888 }; - vector unsigned int source_b = { 0, 0, 0x80808080, 0x80808080 }; - vector unsigned int source_c = { 0, 0, 0x88888888, 0x88888888 }; - vector unsigned int source_d = - { 0x80808080, 0x80808080, 0x80808080, 0x80808080 }; - - unsigned long long int results [] = - { 0xaaaa000000000000ull, 0xaaaa000000000000ull, - 0xaaaaaaaa00000000ull, 0xaaaaaaaa00000000ull }; - - if (do_vec_gnb (source_a, 2) != results [0]) - abort (); - if (do_vec_gnb (source_b, 4) != results [1]) - abort (); - if (do_vec_gnb (source_c, 2) != results [2]) - abort (); - if (do_vec_gnb (source_d, 4) != results [3]) - abort (); - - return 0; -} - diff --git a/gcc/testsuite/gcc.target/powerpc/vec-gnb-6.c b/gcc/testsuite/gcc.target/powerpc/vec-gnb-6.c deleted file mode 100644 index a6dc78a3e98..00000000000 --- a/gcc/testsuite/gcc.target/powerpc/vec-gnb-6.c +++ /dev/null @@ -1,71 +0,0 @@ -/* { dg-do compile } */ -/* { dg-options "-mdejagnu-cpu=future" } */ - -#include - -extern void abort (void); - -/* This test is replicated for every different vector type since - vec_gnb is polymorphic. */ -unsigned long long int -do_vec_gnb (vector unsigned long long int source, int stride) -{ - switch (stride) - { - case 2: - return vec_gnb (source, 2); - case 3: - return vec_gnb (source, 3); - case 4: - return vec_gnb (source, 4); - case 5: - return vec_gnb (source, 5); - case 6: - return vec_gnb (source, 6); - case 7: - return vec_gnb (source, 7); - - default: - /* Illegal value of stride */ - abort (); - return 0; - } -} - -int -main (int argc, char *argv []) -{ - /* For result = 0xaaaa_0000_0000_0000, use: - stride = 2: binary 1x0x_1x0x_1x0x_... = 0x8888_8888_0000_0000, 0 - stride = 4: binary 1xxx_0xxx_1xxx_0xxxx = 0x8080_8080_8080_8080, 0 - - For result = 0xaaaa_aaaa_0000_0000, use: - stride = 2: source = 0x8888_8888_8888_8888, 0x0 } - stride = 4: source = { 0x8080_8080_8080_8080, 0x8080_8080_8080_8080 } - */ - - /* The last array element appears in the left-most (first) bit - positions of the vector register. */ - vector unsigned long long int source_a = { 0, 0x8888888800000000ull }; - vector unsigned long long int source_b = { 0, 0x8080808080808080ull }; - vector unsigned long long int source_c = { 0, 0x8888888888888888ull }; - vector unsigned long long int source_d = { 0x8080808080808080ull, - 0x8080808080808080ull }; - - unsigned long long int results [] = - { 0xaaaa000000000000ull, 0xaaaa000000000000ull, - 0xaaaaaaaa00000000ull, 0xaaaaaaaa00000000ull }; - - if (do_vec_gnb (source_a, 2) != results [0]) - abort (); - if (do_vec_gnb (source_b, 4) != results [1]) - abort (); - if (do_vec_gnb (source_c, 2) != results [2]) - abort (); - if (do_vec_gnb (source_d, 4) != results [3]) - abort (); - - return 0; -} - -/* { dg-final { scan-assembler {\mvgnb\M} } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/vec-gnb-7.c b/gcc/testsuite/gcc.target/powerpc/vec-gnb-7.c deleted file mode 100644 index bbacff986a0..00000000000 --- a/gcc/testsuite/gcc.target/powerpc/vec-gnb-7.c +++ /dev/null @@ -1,71 +0,0 @@ -/* { dg-do run } */ -/* { dg-require-effective-target powerpc_future_hw } */ -/* { dg-options "-mdejagnu-cpu=future" } */ - -#include - -extern void abort (void); - -/* This test is replicated for every different vector type since - vec_gnb is polymorphic. */ -unsigned long long int -do_vec_gnb (vector unsigned long long int source, int stride) -{ - switch (stride) - { - case 2: - return vec_gnb (source, 2); - case 3: - return vec_gnb (source, 3); - case 4: - return vec_gnb (source, 4); - case 5: - return vec_gnb (source, 5); - case 6: - return vec_gnb (source, 6); - case 7: - return vec_gnb (source, 7); - - default: - /* Illegal value of stride */ - abort (); - return 0; - } -} - -int -main (int argc, char *argv []) -{ - /* For result = 0xaaaa_0000_0000_0000, use: - stride = 2: binary 1x0x_1x0x_1x0x_... = 0x8888_8888_0000_0000, 0 - stride = 4: binary 1xxx_0xxx_1xxx_0xxxx = 0x8080_8080_8080_8080, 0 - - For result = 0xaaaa_aaaa_0000_0000, use: - stride = 2: source = 0x8888_8888_8888_8888, 0x0 } - stride = 4: source = { 0x8080_8080_8080_8080, 0x8080_8080_8080_8080 } - */ - - /* The last array element appears in the left-most (first) bit - positions of the vector register. */ - vector unsigned long long int source_a = { 0, 0x8888888800000000ull }; - vector unsigned long long int source_b = { 0, 0x8080808080808080ull }; - vector unsigned long long int source_c = { 0, 0x8888888888888888ull }; - vector unsigned long long int source_d = { 0x8080808080808080ull, - 0x8080808080808080ull }; - - unsigned long long int results [] = - { 0xaaaa000000000000ull, 0xaaaa000000000000ull, - 0xaaaaaaaa00000000ull, 0xaaaaaaaa00000000ull }; - - if (do_vec_gnb (source_a, 2) != results [0]) - abort (); - if (do_vec_gnb (source_b, 4) != results [1]) - abort (); - if (do_vec_gnb (source_c, 2) != results [2]) - abort (); - if (do_vec_gnb (source_d, 4) != results [3]) - abort (); - - return 0; -} - diff --git a/gcc/testsuite/gcc.target/powerpc/vec-gnb-8.c b/gcc/testsuite/gcc.target/powerpc/vec-gnb-8.c deleted file mode 100644 index 23c16e51d48..00000000000 --- a/gcc/testsuite/gcc.target/powerpc/vec-gnb-8.c +++ /dev/null @@ -1,75 +0,0 @@ -/* { dg-do compile } */ -/* { dg-options "-mdejagnu-cpu=future" } */ - -#include - -extern void abort (void); - -/* This test is replicated for every different vector type since - vec_gnb is polymorphic. */ -unsigned long long int -do_vec_gnb (vector unsigned __int128 source, int stride) -{ - switch (stride) - { - case 2: - return vec_gnb (source, 2); - case 3: - return vec_gnb (source, 3); - case 4: - return vec_gnb (source, 4); - case 5: - return vec_gnb (source, 5); - case 6: - return vec_gnb (source, 6); - case 7: - return vec_gnb (source, 7); - - default: - /* Illegal value of stride */ - abort (); - return 0; - } -} - -int -main (int argc, char *argv []) -{ - /* For result = 0xaaaa_0000_0000_0000, use: - stride = 2: binary 1x0x_1x0x_1x0x_... = 0x8888_8888_0000_0000, 0 - stride = 4: binary 1xxx_0xxx_1xxx_0xxxx = 0x8080_8080_8080_8080, 0 - - For result = 0xaaaa_aaaa_0000_0000, use: - stride = 2: source = 0x8888_8888_8888_8888, 0x0 } - stride = 4: source = { 0x8080_8080_8080_8080, 0x8080_8080_8080_8080 } - */ - - /* The last array element appears in the left-most (first) bit - positions of the vector register. */ - vector unsigned __int128 source_a = - { ((unsigned __int128) 0x8888888800000000ull) << 64 }; - vector unsigned __int128 source_b = - { ((unsigned __int128) 0x8080808080808080ull) << 64 }; - vector unsigned __int128 source_c = - { ((unsigned __int128) 0x8888888888888888ull) << 64 }; - vector unsigned __int128 source_d = - { 0x8080808080808080ull | - ((unsigned __int128) 0x8080808080808080ull) << 64 }; - - unsigned long long int results [] = - { 0xaaaa000000000000ull, 0xaaaa000000000000ull, - 0xaaaaaaaa00000000ull, 0xaaaaaaaa00000000ull }; - - if (do_vec_gnb (source_a, 2) != results [0]) - abort (); - if (do_vec_gnb (source_b, 4) != results [1]) - abort (); - if (do_vec_gnb (source_c, 2) != results [2]) - abort (); - if (do_vec_gnb (source_d, 4) != results [3]) - abort (); - - return 0; -} - -/* { dg-final { scan-assembler {\mvgnb\M} } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/vec-gnb-9.c b/gcc/testsuite/gcc.target/powerpc/vec-gnb-9.c deleted file mode 100644 index 659e802d819..00000000000 --- a/gcc/testsuite/gcc.target/powerpc/vec-gnb-9.c +++ /dev/null @@ -1,74 +0,0 @@ -/* { dg-do run } */ -/* { dg-require-effective-target powerpc_future_hw } */ -/* { dg-options "-mdejagnu-cpu=future" } */ - -#include - -extern void abort (void); - -/* This test is replicated for every different vector type since - vec_gnb is polymorphic. */ -unsigned long long int -do_vec_gnb (vector unsigned __int128 source, int stride) -{ - switch (stride) - { - case 2: - return vec_gnb (source, 2); - case 3: - return vec_gnb (source, 3); - case 4: - return vec_gnb (source, 4); - case 5: - return vec_gnb (source, 5); - case 6: - return vec_gnb (source, 6); - case 7: - return vec_gnb (source, 7); - - default: - /* Illegal value of stride */ - abort (); - return 0; - } -} - -int -main (int argc, char *argv []) -{ - /* For result = 0xaaaa_0000_0000_0000, use: - stride = 2: binary 1x0x_1x0x_1x0x_... = 0x8888_8888_0000_0000, 0 - stride = 4: binary 1xxx_0xxx_1xxx_0xxxx = 0x8080_8080_8080_8080, 0 - - For result = 0xaaaa_aaaa_0000_0000, use: - stride = 2: source = 0x8888_8888_8888_8888, 0x0 } - stride = 4: source = { 0x8080_8080_8080_8080, 0x8080_8080_8080_8080 } - */ - - /* The last array element appears in the left-most (first) bit - positions of the vector register. */ - vector unsigned __int128 source_a = - { ((unsigned __int128) 0x8888888800000000ull) << 64 }; - vector unsigned __int128 source_b = - { ((unsigned __int128) 0x8080808080808080ull) << 64 }; - vector unsigned __int128 source_c = - { ((unsigned __int128) 0x8888888888888888ull) << 64 }; - vector unsigned __int128 source_d = - { 0x8080808080808080ull | - ((unsigned __int128) 0x8080808080808080ull) << 64 }; - - unsigned long long int results [] = - { 0xaaaa000000000000ull, 0xaaaa000000000000ull, - 0xaaaaaaaa00000000ull, 0xaaaaaaaa00000000ull }; - - if (do_vec_gnb (source_a, 2) != results [0]) - abort (); - if (do_vec_gnb (source_b, 4) != results [1]) - abort (); - if (do_vec_gnb (source_c, 2) != results [2]) - abort (); - if (do_vec_gnb (source_d, 4) != results [3]) - abort (); - - return 0; -}