Debian Codegraph @

gcc/testsuite/gcc.target/powerpc/fold-vec-logical-other-longlong.c

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