S/390: Fix conditional returns on z196+
[official-gcc.git] / gcc / testsuite / gcc.target / s390 / zvector / vec-cmp-2.c
blob09a15eb25f07ba481928bfe6a830a99362f89469
1 /* Similiar to vec-cmp-1.c but requires that
2 s390_canonicalize_comparison is able to merge the the two nested
3 compares. */
5 /* { dg-do compile { target { s390*-*-* } } } */
6 /* { dg-options "-O3 -mzarch -march=z13 -mzvector -fno-asynchronous-unwind-tables" } */
8 #include <vecintrin.h>
10 int g = 1;
12 void __attribute__((noinline,noclone))
13 all_eq_double (vector double a, vector double b)
15 if (__builtin_expect (vec_all_eq (a, b), 1))
16 g = 2;
18 /* { dg-final { scan-assembler-times all_eq_double:\n\tvfcedbs\t%v\[0-9\]*,%v24,%v26\n\tbner\t%r14\n 1 } } */
20 void __attribute__((noinline,noclone))
21 all_ne_double (vector double a, vector double b)
23 if (__builtin_expect (vec_all_ne (a, b), 1))
24 g = 2;
26 /* { dg-final { scan-assembler-times all_ne_double:\n\tvfcedbs\t%v\[0-9\]*,%v24,%v26\n\tbler\t%r14\n 1 } } */
28 void __attribute__((noinline,noclone))
29 all_gt_double (vector double a, vector double b)
31 if (__builtin_expect (vec_all_gt (a, b), 1))
32 g = 2;
34 /* { dg-final { scan-assembler-times all_gt_double:\n\tvfchdbs\t%v\[0-9\]*,%v24,%v26\n\tbner\t%r14\n 1 } } */
36 void __attribute__((noinline,noclone))
37 all_lt_double (vector double a, vector double b)
39 if (__builtin_expect (vec_all_lt (a, b), 1))
40 g = 2;
42 /* { dg-final { scan-assembler-times all_lt_double:\n\tvfchdbs\t%v\[0-9\]*,%v26,%v24\n\tbner\t%r14\n 1 } } */
44 void __attribute__((noinline,noclone))
45 all_ge_double (vector double a, vector double b)
47 if (__builtin_expect (vec_all_ge (a, b), 1))
48 g = 2;
50 /* { dg-final { scan-assembler-times all_ge_double:\n\tvfchedbs\t%v\[0-9\]*,%v24,%v26\n\tbner\t%r14\n 1 } } */
52 void __attribute__((noinline,noclone))
53 all_le_double (vector double a, vector double b)
55 if (__builtin_expect (vec_all_le (a, b), 1))
56 g = 2;
58 /* { dg-final { scan-assembler-times all_le_double:\n\tvfchedbs\t%v\[0-9\]*,%v26,%v24\n\tbner\t%r14\n 1 } } */
60 void __attribute__((noinline,noclone))
61 any_eq_double (vector double a, vector double b)
63 if (__builtin_expect (vec_any_eq (a, b), 1))
64 g = 2;
66 /* { dg-final { scan-assembler-times any_eq_double:\n\tvfcedbs\t%v\[0-9\]*,%v24,%v26\n\tbnler\t%r14\n 1 } } */
68 void __attribute__((noinline,noclone))
69 any_ne_double (vector double a, vector double b)
71 if (__builtin_expect (vec_any_ne (a, b), 1))
72 g = 2;
74 /* { dg-final { scan-assembler-times any_ne_double:\n\tvfcedbs\t%v\[0-9\]*,%v24,%v26\n\tber\t%r14\n 1 } } */
76 void __attribute__((noinline,noclone))
77 any_gt_double (vector double a, vector double b)
79 if (__builtin_expect (vec_any_gt (a, b), 1))
80 g = 2;
82 /* { dg-final { scan-assembler-times any_gt_double:\n\tvfchdbs\t%v\[0-9\]*,%v24,%v26\n\tbnler\t%r14\n 1 } } */
84 void __attribute__((noinline,noclone))
85 any_lt_double (vector double a, vector double b)
87 if (__builtin_expect (vec_any_lt (a, b), 1))
88 g = 2;
90 /* { dg-final { scan-assembler-times any_lt_double:\n\tvfchdbs\t%v\[0-9\]*,%v26,%v24\n\tbnler\t%r14\n 1 } } */
92 void __attribute__((noinline,noclone))
93 any_ge_double (vector double a, vector double b)
95 if (__builtin_expect (vec_any_ge (a, b), 1))
96 g = 2;
98 /* { dg-final { scan-assembler-times any_ge_double:\n\tvfchedbs\t%v\[0-9\]*,%v24,%v26\n\tbnler\t%r14\n 1 } } */
100 void __attribute__((noinline,noclone))
101 any_le_double (vector double a, vector double b)
103 if (__builtin_expect (vec_any_le (a, b), 1))
104 g = 2;
106 /* { dg-final { scan-assembler-times any_le_double:\n\tvfchedbs\t%v\[0-9\]*,%v26,%v24\n\tbnler\t%r14\n 1 } } */
108 void __attribute__((noinline,noclone))
109 all_eq_int (vector int a, vector int b)
111 if (__builtin_expect (vec_all_eq (a, b), 1))
112 g = 2;
114 /* { dg-final { scan-assembler-times all_eq_int:\n\tvceqfs\t%v\[0-9\]*,%v24,%v26\n\tbner\t%r14\n 1 } } */
116 void __attribute__((noinline,noclone))
117 all_ne_int (vector int a, vector int b)
119 if (__builtin_expect (vec_all_ne (a, b), 1))
120 g = 2;
122 /* { dg-final { scan-assembler-times all_ne_int:\n\tvceqfs\t%v\[0-9\]*,%v24,%v26\n\tbler\t%r14\n 1 } } */
124 void __attribute__((noinline,noclone))
125 all_gt_int (vector int a, vector int b)
127 if (__builtin_expect (vec_all_gt (a, b), 1))
128 g = 2;
130 /* { dg-final { scan-assembler-times all_gt_int:\n\tvchfs\t%v\[0-9\]*,%v24,%v26\n\tbner\t%r14\n 1 } } */
132 void __attribute__((noinline,noclone))
133 all_lt_int (vector int a, vector int b)
135 if (__builtin_expect (vec_all_lt (a, b), 1))
136 g = 2;
138 /* { dg-final { scan-assembler-times all_lt_int:\n\tvchfs\t%v\[0-9\]*,%v26,%v24\n\tbner\t%r14\n 1 } } */
140 void __attribute__((noinline,noclone))
141 all_ge_int (vector int a, vector int b)
143 if (__builtin_expect (vec_all_ge (a, b), 1))
144 g = 2;
146 /* { dg-final { scan-assembler-times all_ge_int:\n\tvchfs\t%v\[0-9\]*,%v26,%v24\n\tbler\t%r14\n 1 } } */
148 void __attribute__((noinline,noclone))
149 all_le_int (vector int a, vector int b)
151 if (__builtin_expect (vec_all_le (a, b), 1))
152 g = 2;
154 /* { dg-final { scan-assembler-times all_le_int:\n\tvchfs\t%v\[0-9\]*,%v24,%v26\n\tbler\t%r14\n 1 } } */
156 void __attribute__((noinline,noclone))
157 any_eq_int (vector int a, vector int b)
159 if (__builtin_expect (vec_any_eq (a, b), 1))
160 g = 2;
162 /* { dg-final { scan-assembler-times any_eq_int:\n\tvceqfs\t%v\[0-9\]*,%v24,%v26\n\tbnler\t%r14\n 1 } } */
164 void __attribute__((noinline,noclone))
165 any_ne_int (vector int a, vector int b)
167 if (__builtin_expect (vec_any_ne (a, b), 1))
168 g = 2;
170 /* { dg-final { scan-assembler-times any_ne_int:\n\tvceqfs\t%v\[0-9\]*,%v24,%v26\n\tber\t%r14\n 1 } } */
172 void __attribute__((noinline,noclone))
173 any_gt_int (vector int a, vector int b)
175 if (__builtin_expect (vec_any_gt (a, b), 1))
176 g = 2;
178 /* { dg-final { scan-assembler-times any_gt_int:\n\tvchfs\t%v\[0-9\]*,%v24,%v26\n\tbnler\t%r14\n 1 } } */
180 void __attribute__((noinline,noclone))
181 any_lt_int (vector int a, vector int b)
183 if (__builtin_expect (vec_any_lt (a, b), 1))
184 g = 2;
186 /* { dg-final { scan-assembler-times any_lt_int:\n\tvchfs\t%v\[0-9\]*,%v26,%v24\n\tbnler\t%r14\n 1 } } */
188 void __attribute__((noinline,noclone))
189 any_ge_int (vector int a, vector int b)
191 if (__builtin_expect (vec_any_ge (a, b), 1))
192 g = 2;
194 /* { dg-final { scan-assembler-times any_ge_int:\n\tvchfs\t%v\[0-9\]*,%v26,%v24\n\tber\t%r14\n 1 } } */
196 void __attribute__((noinline,noclone))
197 any_le_int (vector int a, vector int b)
199 if (__builtin_expect (vec_any_le (a, b), 1))
200 g = 2;
202 /* { dg-final { scan-assembler-times any_le_int:\n\tvchfs\t%v\[0-9\]*,%v24,%v26\n\tber\t%r14\n 1 } } */