* gcc.target/powerpc/builtins-1-be.c <vclzb>: Rename duplicate test
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / fold-vec-logical-ands-int.c
blob59a23e89b485f13a59e4a914a9980f48e9556b99
1 /* Verify that overloaded built-ins for vec_and, vec_andc, vec_or and vec_xor
2 * with int inputs produce the right results. */
4 /* { dg-do compile } */
5 /* { dg-require-effective-target powerpc_vsx_ok } */
6 /* { dg-options "-mvsx -O1" } */
8 #include <altivec.h>
10 vector signed int
11 test1_and (vector bool int x, vector signed int y)
13 vector signed int *foo;
14 *foo += vec_and (x, y);
15 return *foo;
18 vector signed int
19 test1_andc (vector bool int x, vector signed int y)
21 vector signed int *foo;
22 *foo += vec_andc (x, y);
23 return *foo;
26 vector signed int
27 test2_and (vector signed int x, vector bool int y)
29 vector signed int *foo;
30 *foo += vec_and (x, y);
31 return *foo;
34 vector signed int
35 test2_andc (vector signed int x, vector bool int y)
37 vector signed int *foo;
38 *foo += vec_andc (x, y);
39 return *foo;
42 vector signed int
43 test3_and (vector signed int x, vector signed int y)
45 vector signed int *foo;
46 *foo += vec_and (x, y);
47 return *foo;
50 vector signed int
51 test3_andc (vector signed int x, vector signed int y)
53 vector signed int *foo;
54 *foo += vec_andc (x, y);
55 return *foo;
58 vector unsigned int
59 test4_and (vector bool int x, vector unsigned int y)
61 vector unsigned int *foo;
62 *foo += vec_and (x, y);
63 return *foo;
66 vector unsigned int
67 test4_andc (vector bool int x, vector unsigned int y)
69 vector unsigned int *foo;
70 *foo += vec_andc (x, y);
71 return *foo;
74 vector unsigned int
75 test5_and (vector unsigned int x, vector bool int y)
77 vector unsigned int *foo;
78 *foo += vec_and (x, y);
79 return *foo;
82 vector unsigned int
83 test5_andc (vector unsigned int x, vector bool int y)
85 vector unsigned int *foo;
86 *foo += vec_andc (x, y);
87 return *foo;
90 vector unsigned int
91 test6_and (vector unsigned int x, vector unsigned int y)
93 vector unsigned int *foo;
94 *foo += vec_and (x, y);
95 return *foo;
98 vector unsigned int
99 test6_andc (vector unsigned int x, vector unsigned int y)
101 vector unsigned int *foo;
102 *foo += vec_andc (x, y);
103 return *foo;
106 /* { dg-final { scan-assembler-times {\mxxland\M} 6 } } */
107 /* { dg-final { scan-assembler-times {\mxxlandc\M} 6 } } */