+2020-05-11 Kelvin Nilsen <kelvin@gcc.gnu.org>
+
+ * 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 <cel@us.ibm.com>
* config/rs6000/altivec.h (vec_genpcvm): New #define.
#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)
&& 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;
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,
@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
@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
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)
@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.
+2020-05-11 Kelvin Nilsen <kelvin@gcc.gnu.org>
+
+ * 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 <cel@us.ibm.com>
* gcc.target/powerpc/xxgenpc-runnable.c: New.
+++ /dev/null
-/* { dg-do compile } */
-/* { dg-options "-mdejagnu-cpu=future" } */
-
-#include <altivec.h>
-
-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} } } */
+++ /dev/null
-/* { dg-do run } */
-/* { dg-require-effective-target powerpc_future_hw } */
-/* { dg-options "-mdejagnu-cpu=future" } */
-
-#include <altivec.h>
-
-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;
-}
-
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-mdejagnu-cpu=future" } */
+
+#include <altivec.h>
+
+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} } } */
--- /dev/null
+/* { dg-do run } */
+/* { dg-require-effective-target powerpc_future_hw } */
+/* { dg-options "-mdejagnu-cpu=future" } */
+
+#include <altivec.h>
+
+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;
+}
+
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-mdejagnu-cpu=future" } */
+
+#include <altivec.h>
+
+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} } } */
--- /dev/null
+/* { dg-do compile } */
+/* { dg-require-effective-target powerpc_future_hw } */
+/* { dg-options "-mdejagnu-cpu=future" } */
+
+#include <altivec.h>
+
+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;
+}
+++ /dev/null
-/* { dg-do compile } */
-/* { dg-options "-mdejagnu-cpu=future" } */
-
-#include <altivec.h>
-
-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} } } */
+++ /dev/null
-/* { dg-do compile } */
-/* { dg-require-effective-target powerpc_future_hw } */
-/* { dg-options "-mdejagnu-cpu=future" } */
-
-#include <altivec.h>
-
-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;
-}
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)
{
/* 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,
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)
{
/* 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,
return 0;
}
-
+++ /dev/null
-/* { dg-do compile } */
-/* { dg-options "-mdejagnu-cpu=future" } */
-
-#include <altivec.h>
-
-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;
-}
-
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);
/* 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,
return 0;
}
-/* { dg-final { scan-assembler {\mvgnb\M} } } */
+++ /dev/null
-/* { dg-do run } */
-/* { dg-require-effective-target powerpc_future_hw } */
-/* { dg-options "-mdejagnu-cpu=future" } */
-
-#include <altivec.h>
-
-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;
-}
+++ /dev/null
-/* { dg-do compile } */
-/* { dg-options "-mdejagnu-cpu=future" } */
-
-#include <altivec.h>
-
-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} } } */
+++ /dev/null
-/* { dg-do run } */
-/* { dg-require-effective-target powerpc_future_hw } */
-/* { dg-options "-mdejagnu-cpu=future" } */
-
-#include <altivec.h>
-
-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;
-}
-
+++ /dev/null
-/* { dg-do compile } */
-/* { dg-options "-mdejagnu-cpu=future" } */
-
-#include <altivec.h>
-
-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} } } */
+++ /dev/null
-/* { dg-do run } */
-/* { dg-require-effective-target powerpc_future_hw } */
-/* { dg-options "-mdejagnu-cpu=future" } */
-
-#include <altivec.h>
-
-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;
-}
-
+++ /dev/null
-/* { dg-do compile } */
-/* { dg-options "-mdejagnu-cpu=future" } */
-
-#include <altivec.h>
-
-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} } } */
+++ /dev/null
-/* { dg-do run } */
-/* { dg-require-effective-target powerpc_future_hw } */
-/* { dg-options "-mdejagnu-cpu=future" } */
-
-#include <altivec.h>
-
-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;
-}