| 1 |
/* Similiar to vec-cmp-1.c but requires that |
| 2 |
s390_canonicalize_comparison is able to merge the two nested |
| 3 |
compares. */ |
| 4 |
|
| 5 |
/* { dg-do compile { target { s390*-*-* } } } */ |
| 6 |
/* { dg-options "-O3 -mzarch -march=z13 -mzvector -fno-asynchronous-unwind-tables" } */ |
| 7 |
|
| 8 |
#include <vecintrin.h> |
| 9 |
|
| 10 |
int g = 1; |
| 11 |
|
| 12 |
void __attribute__((noinline,noclone)) |
| 13 |
all_eq_double (vector double a, vector double b) |
| 14 |
{ |
| 15 |
if (__builtin_expect (vec_all_eq (a, b), 1)) |
| 16 |
g = 2; |
| 17 |
} |
| 18 |
/* { dg-final { scan-assembler-times all_eq_double:\n\tvfcedbs\t%v\[0-9\]*,%v24,%v26\n\tbner\t%r14\n 1 } } */ |
| 19 |
|
| 20 |
void __attribute__((noinline,noclone)) |
| 21 |
all_ne_double (vector double a, vector double b) |
| 22 |
{ |
| 23 |
if (__builtin_expect (vec_all_ne (a, b), 1)) |
| 24 |
g = 2; |
| 25 |
} |
| 26 |
/* { dg-final { scan-assembler-times all_ne_double:\n\tvfcedbs\t%v\[0-9\]*,%v24,%v26\n\tbler\t%r14\n 1 } } */ |
| 27 |
|
| 28 |
void __attribute__((noinline,noclone)) |
| 29 |
all_gt_double (vector double a, vector double b) |
| 30 |
{ |
| 31 |
if (__builtin_expect (vec_all_gt (a, b), 1)) |
| 32 |
g = 2; |
| 33 |
} |
| 34 |
/* { dg-final { scan-assembler-times all_gt_double:\n\tvfchdbs\t%v\[0-9\]*,%v24,%v26\n\tbner\t%r14\n 1 } } */ |
| 35 |
|
| 36 |
void __attribute__((noinline,noclone)) |
| 37 |
all_lt_double (vector double a, vector double b) |
| 38 |
{ |
| 39 |
if (__builtin_expect (vec_all_lt (a, b), 1)) |
| 40 |
g = 2; |
| 41 |
} |
| 42 |
/* { dg-final { scan-assembler-times all_lt_double:\n\tvfchdbs\t%v\[0-9\]*,%v26,%v24\n\tbner\t%r14\n 1 } } */ |
| 43 |
|
| 44 |
void __attribute__((noinline,noclone)) |
| 45 |
all_ge_double (vector double a, vector double b) |
| 46 |
{ |
| 47 |
if (__builtin_expect (vec_all_ge (a, b), 1)) |
| 48 |
g = 2; |
| 49 |
} |
| 50 |
/* { dg-final { scan-assembler-times all_ge_double:\n\tvfchedbs\t%v\[0-9\]*,%v24,%v26\n\tbner\t%r14\n 1 } } */ |
| 51 |
|
| 52 |
void __attribute__((noinline,noclone)) |
| 53 |
all_le_double (vector double a, vector double b) |
| 54 |
{ |
| 55 |
if (__builtin_expect (vec_all_le (a, b), 1)) |
| 56 |
g = 2; |
| 57 |
} |
| 58 |
/* { dg-final { scan-assembler-times all_le_double:\n\tvfchedbs\t%v\[0-9\]*,%v26,%v24\n\tbner\t%r14\n 1 } } */ |
| 59 |
|
| 60 |
void __attribute__((noinline,noclone)) |
| 61 |
any_eq_double (vector double a, vector double b) |
| 62 |
{ |
| 63 |
if (__builtin_expect (vec_any_eq (a, b), 1)) |
| 64 |
g = 2; |
| 65 |
} |
| 66 |
/* { dg-final { scan-assembler-times any_eq_double:\n\tvfcedbs\t%v\[0-9\]*,%v24,%v26\n\tbnler\t%r14\n 1 } } */ |
| 67 |
|
| 68 |
void __attribute__((noinline,noclone)) |
| 69 |
any_ne_double (vector double a, vector double b) |
| 70 |
{ |
| 71 |
if (__builtin_expect (vec_any_ne (a, b), 1)) |
| 72 |
g = 2; |
| 73 |
} |
| 74 |
/* { dg-final { scan-assembler-times any_ne_double:\n\tvfcedbs\t%v\[0-9\]*,%v24,%v26\n\tber\t%r14\n 1 } } */ |
| 75 |
|
| 76 |
void __attribute__((noinline,noclone)) |
| 77 |
any_gt_double (vector double a, vector double b) |
| 78 |
{ |
| 79 |
if (__builtin_expect (vec_any_gt (a, b), 1)) |
| 80 |
g = 2; |
| 81 |
} |
| 82 |
/* { dg-final { scan-assembler-times any_gt_double:\n\tvfchdbs\t%v\[0-9\]*,%v24,%v26\n\tbnler\t%r14\n 1 } } */ |
| 83 |
|
| 84 |
void __attribute__((noinline,noclone)) |
| 85 |
any_lt_double (vector double a, vector double b) |
| 86 |
{ |
| 87 |
if (__builtin_expect (vec_any_lt (a, b), 1)) |
| 88 |
g = 2; |
| 89 |
} |
| 90 |
/* { dg-final { scan-assembler-times any_lt_double:\n\tvfchdbs\t%v\[0-9\]*,%v26,%v24\n\tbnler\t%r14\n 1 } } */ |
| 91 |
|
| 92 |
void __attribute__((noinline,noclone)) |
| 93 |
any_ge_double (vector double a, vector double b) |
| 94 |
{ |
| 95 |
if (__builtin_expect (vec_any_ge (a, b), 1)) |
| 96 |
g = 2; |
| 97 |
} |
| 98 |
/* { dg-final { scan-assembler-times any_ge_double:\n\tvfchedbs\t%v\[0-9\]*,%v24,%v26\n\tbnler\t%r14\n 1 } } */ |
| 99 |
|
| 100 |
void __attribute__((noinline,noclone)) |
| 101 |
any_le_double (vector double a, vector double b) |
| 102 |
{ |
| 103 |
if (__builtin_expect (vec_any_le (a, b), 1)) |
| 104 |
g = 2; |
| 105 |
} |
| 106 |
/* { dg-final { scan-assembler-times any_le_double:\n\tvfchedbs\t%v\[0-9\]*,%v26,%v24\n\tbnler\t%r14\n 1 } } */ |
| 107 |
|
| 108 |
void __attribute__((noinline,noclone)) |
| 109 |
all_eq_int (vector int a, vector int b) |
| 110 |
{ |
| 111 |
if (__builtin_expect (vec_all_eq (a, b), 1)) |
| 112 |
g = 2; |
| 113 |
} |
| 114 |
/* { dg-final { scan-assembler-times all_eq_int:\n\tvceqfs\t%v\[0-9\]*,%v24,%v26\n\tbner\t%r14\n 1 } } */ |
| 115 |
|
| 116 |
void __attribute__((noinline,noclone)) |
| 117 |
all_ne_int (vector int a, vector int b) |
| 118 |
{ |
| 119 |
if (__builtin_expect (vec_all_ne (a, b), 1)) |
| 120 |
g = 2; |
| 121 |
} |
| 122 |
/* { dg-final { scan-assembler-times all_ne_int:\n\tvceqfs\t%v\[0-9\]*,%v24,%v26\n\tbler\t%r14\n 1 } } */ |
| 123 |
|
| 124 |
void __attribute__((noinline,noclone)) |
| 125 |
all_gt_int (vector int a, vector int b) |
| 126 |
{ |
| 127 |
if (__builtin_expect (vec_all_gt (a, b), 1)) |
| 128 |
g = 2; |
| 129 |
} |
| 130 |
/* { dg-final { scan-assembler-times all_gt_int:\n\tvchfs\t%v\[0-9\]*,%v24,%v26\n\tbner\t%r14\n 1 } } */ |
| 131 |
|
| 132 |
void __attribute__((noinline,noclone)) |
| 133 |
all_lt_int (vector int a, vector int b) |
| 134 |
{ |
| 135 |
if (__builtin_expect (vec_all_lt (a, b), 1)) |
| 136 |
g = 2; |
| 137 |
} |
| 138 |
/* { dg-final { scan-assembler-times all_lt_int:\n\tvchfs\t%v\[0-9\]*,%v26,%v24\n\tbner\t%r14\n 1 } } */ |
| 139 |
|
| 140 |
void __attribute__((noinline,noclone)) |
| 141 |
all_ge_int (vector int a, vector int b) |
| 142 |
{ |
| 143 |
if (__builtin_expect (vec_all_ge (a, b), 1)) |
| 144 |
g = 2; |
| 145 |
} |
| 146 |
/* { dg-final { scan-assembler-times all_ge_int:\n\tvchfs\t%v\[0-9\]*,%v26,%v24\n\tbler\t%r14\n 1 } } */ |
| 147 |
|
| 148 |
void __attribute__((noinline,noclone)) |
| 149 |
all_le_int (vector int a, vector int b) |
| 150 |
{ |
| 151 |
if (__builtin_expect (vec_all_le (a, b), 1)) |
| 152 |
g = 2; |
| 153 |
} |
| 154 |
/* { dg-final { scan-assembler-times all_le_int:\n\tvchfs\t%v\[0-9\]*,%v24,%v26\n\tbler\t%r14\n 1 } } */ |
| 155 |
|
| 156 |
void __attribute__((noinline,noclone)) |
| 157 |
any_eq_int (vector int a, vector int b) |
| 158 |
{ |
| 159 |
if (__builtin_expect (vec_any_eq (a, b), 1)) |
| 160 |
g = 2; |
| 161 |
} |
| 162 |
/* { dg-final { scan-assembler-times any_eq_int:\n\tvceqfs\t%v\[0-9\]*,%v24,%v26\n\tbnler\t%r14\n 1 } } */ |
| 163 |
|
| 164 |
void __attribute__((noinline,noclone)) |
| 165 |
any_ne_int (vector int a, vector int b) |
| 166 |
{ |
| 167 |
if (__builtin_expect (vec_any_ne (a, b), 1)) |
| 168 |
g = 2; |
| 169 |
} |
| 170 |
/* { dg-final { scan-assembler-times any_ne_int:\n\tvceqfs\t%v\[0-9\]*,%v24,%v26\n\tber\t%r14\n 1 } } */ |
| 171 |
|
| 172 |
void __attribute__((noinline,noclone)) |
| 173 |
any_gt_int (vector int a, vector int b) |
| 174 |
{ |
| 175 |
if (__builtin_expect (vec_any_gt (a, b), 1)) |
| 176 |
g = 2; |
| 177 |
} |
| 178 |
/* { dg-final { scan-assembler-times any_gt_int:\n\tvchfs\t%v\[0-9\]*,%v24,%v26\n\tbnler\t%r14\n 1 } } */ |
| 179 |
|
| 180 |
void __attribute__((noinline,noclone)) |
| 181 |
any_lt_int (vector int a, vector int b) |
| 182 |
{ |
| 183 |
if (__builtin_expect (vec_any_lt (a, b), 1)) |
| 184 |
g = 2; |
| 185 |
} |
| 186 |
/* { dg-final { scan-assembler-times any_lt_int:\n\tvchfs\t%v\[0-9\]*,%v26,%v24\n\tbnler\t%r14\n 1 } } */ |
| 187 |
|
| 188 |
void __attribute__((noinline,noclone)) |
| 189 |
any_ge_int (vector int a, vector int b) |
| 190 |
{ |
| 191 |
if (__builtin_expect (vec_any_ge (a, b), 1)) |
| 192 |
g = 2; |
| 193 |
} |
| 194 |
/* { dg-final { scan-assembler-times any_ge_int:\n\tvchfs\t%v\[0-9\]*,%v26,%v24\n\tber\t%r14\n 1 } } */ |
| 195 |
|
| 196 |
void __attribute__((noinline,noclone)) |
| 197 |
any_le_int (vector int a, vector int b) |
| 198 |
{ |
| 199 |
if (__builtin_expect (vec_any_le (a, b), 1)) |
| 200 |
g = 2; |
| 201 |
} |
| 202 |
/* { dg-final { scan-assembler-times any_le_int:\n\tvchfs\t%v\[0-9\]*,%v24,%v26\n\tber\t%r14\n 1 } } */ |
| 203 |
|