1 /* Verify that overloaded built-ins for vec_orc and vec_nand with long long
2    inputs produce the right results.  */
3 
4 /* { dg-do compile } */
5 /* { dg-require-effective-target powerpc_p8vector_ok } */
6 /* { dg-options "-mpower8-vector -O1" } */
7 
8 #include <altivec.h>
9 
10 vector signed long long
test1_orc(vector bool long long x,vector signed long long y)11 test1_orc (vector bool long long x, vector signed long long y)
12 {
13   vector signed long long *foo;
14   *foo += vec_orc (x, y);
15   return *foo;
16 }
17 
18 vector signed long long
test1_nand(vector bool long long x,vector signed long long y)19 test1_nand (vector bool long long x, vector signed long long y)
20 {
21   vector signed long long *foo;
22   *foo += vec_nand (x, y);
23   return *foo;
24 }
25 
26 vector signed long long
test2_orc(vector signed long long x,vector bool long long y)27 test2_orc (vector signed long long x, vector bool long long y)
28 {
29   vector signed long long *foo;
30   *foo += vec_orc (x, y);
31   return *foo;
32 }
33 
34 vector signed long long
test2_nand(vector signed long long x,vector bool long long y)35 test2_nand (vector signed long long x, vector bool long long y)
36 {
37   vector signed long long *foo;
38   *foo += vec_nand (x, y);
39   return *foo;
40 }
41 
42 vector signed long long
test3_orc(vector signed long long x,vector signed long long y)43 test3_orc (vector signed long long x, vector signed long long y)
44 {
45   vector signed long long *foo;
46   *foo += vec_orc (x, y);
47   return *foo;
48 }
49 
50 vector signed long long
test3_nand(vector signed long long x,vector signed long long y)51 test3_nand (vector signed long long x, vector signed long long y)
52 {
53   vector signed long long *foo;
54   *foo += vec_nand (x, y);
55   return *foo;
56 }
57 
58 vector unsigned long long
test4_orc(vector bool long long x,vector unsigned long long y)59 test4_orc (vector bool long long x, vector unsigned long long y)
60 {
61   vector unsigned long long *foo;
62   *foo += vec_orc (x, y);
63   return *foo;
64 }
65 
66 vector unsigned long long
test4_nand(vector bool long long x,vector unsigned long long y)67 test4_nand (vector bool long long x, vector unsigned long long y)
68 {
69   vector unsigned long long *foo;
70   *foo += vec_nand (x, y);
71   return *foo;
72 }
73 
74 vector unsigned long long
test5_orc(vector unsigned long long x,vector bool long long y)75 test5_orc (vector unsigned long long x, vector bool long long y)
76 {
77   vector unsigned long long *foo;
78   *foo += vec_orc (x, y);
79   return *foo;
80 }
81 
82 vector unsigned long long
test5_nand(vector unsigned long long x,vector bool long long y)83 test5_nand (vector unsigned long long x, vector bool long long y)
84 {
85   vector unsigned long long *foo;
86   *foo += vec_nand (x, y);
87   return *foo;
88 }
89 
90 vector unsigned long long
test6_orc(vector unsigned long long x,vector unsigned long long y)91 test6_orc (vector unsigned long long x, vector unsigned long long y)
92 {
93   vector unsigned long long *foo;
94   *foo += vec_orc (x, y);
95   return *foo;
96 }
97 vector unsigned long long
test6_nand(vector unsigned long long x,vector unsigned long long y)98 test6_nand (vector unsigned long long x, vector unsigned long long y)
99 {
100   vector unsigned long long *foo;
101   *foo += vec_nand (x, y);
102   return *foo;
103 }
104 
105 /* { dg-final { scan-assembler-times {\mxxlorc\M} 6 } } */
106 /* { dg-final { scan-assembler-times {\mxxlnand\M} 6 } } */
107