[RS6000] Tests that use int128_t and -m32
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / p8vector-vectorize-5.c
blobbd27a9eb950921ccf720550c3f00099eaa3d666c
1 /* { dg-do compile { target { powerpc*-*-* } } } */
2 /* { dg-skip-if "" { powerpc*-*-darwin* } } */
3 /* { dg-require-effective-target powerpc_p8vector_ok } */
4 /* { dg-options "-mdejagnu-cpu=power8 -O2 -ftree-vectorize -fvect-cost-model=dynamic -fno-unroll-loops -fno-unroll-all-loops" } */
6 #ifndef SIZE
7 #define SIZE 1024
8 #endif
10 #ifndef ALIGN
11 #define ALIGN 32
12 #endif
14 #ifndef ATTR_ALIGN
15 #define ATTR_ALIGN __attribute__((__aligned__(ALIGN)))
16 #endif
18 #ifndef TYPE
19 #define TYPE unsigned int
20 #endif
22 TYPE in1 [SIZE] ATTR_ALIGN;
23 TYPE in2 [SIZE] ATTR_ALIGN;
24 TYPE eqv [SIZE] ATTR_ALIGN;
25 TYPE nand1[SIZE] ATTR_ALIGN;
26 TYPE nand2[SIZE] ATTR_ALIGN;
27 TYPE orc1 [SIZE] ATTR_ALIGN;
28 TYPE orc2 [SIZE] ATTR_ALIGN;
30 void
31 do_eqv (void)
33 unsigned long i;
35 for (i = 0; i < SIZE; i++)
37 eqv[i] = ~(in1[i] ^ in2[i]);
41 void
42 do_nand1 (void)
44 unsigned long i;
46 for (i = 0; i < SIZE; i++)
48 nand1[i] = ~(in1[i] & in2[i]);
52 void
53 do_nand2 (void)
55 unsigned long i;
57 for (i = 0; i < SIZE; i++)
59 nand2[i] = (~in1[i]) | (~in2[i]);
63 void
64 do_orc1 (void)
66 unsigned long i;
68 for (i = 0; i < SIZE; i++)
70 orc1[i] = (~in1[i]) | in2[i];
74 void
75 do_orc2 (void)
77 unsigned long i;
79 for (i = 0; i < SIZE; i++)
81 orc1[i] = in1[i] | (~in2[i]);
85 /* { dg-final { scan-assembler-times "xxleqv" 1 } } */
86 /* { dg-final { scan-assembler-times "xxlnand" 2 } } */
87 /* { dg-final { scan-assembler-times "xxlorc" 2 } } */