| 1 |
/* PR tree-optimization/103660 */ |
| 2 |
/* Vector type version. */ |
| 3 |
/* { dg-do compile } */ |
| 4 |
/* { dg-options "-O1 -fdump-tree-forwprop1-raw -Wno-psabi" } */ |
| 5 |
|
| 6 |
typedef int v4si __attribute((__vector_size__(4 * sizeof(int)))); |
| 7 |
#define funcs(OP,n) \ |
| 8 |
v4si min_##n(v4si a, v4si b) { \ |
| 9 |
v4si X = -(a < b) * a; \ |
| 10 |
v4si Y = -(a >= b) * b; \ |
| 11 |
return (X OP Y); \ |
| 12 |
} \ |
| 13 |
v4si f_##n(v4si a, v4si b, \ |
| 14 |
v4si c, v4si d) { \ |
| 15 |
v4si X = -(a < b) * c; \ |
| 16 |
v4si Y = -(a >= b) * d; \ |
| 17 |
return (X OP Y); \ |
| 18 |
} |
| 19 |
|
| 20 |
|
| 21 |
funcs(|, ior) |
| 22 |
|
| 23 |
/* min_ior should produce min<a,b> or `a < b ? a : b` depending on if the target |
| 24 |
supports min on the vector type or not. */ |
| 25 |
/* f_ior should produce (a < b) ? c : d */ |
| 26 |
/* { dg-final { scan-tree-dump-not "bit_ior_expr, " "forwprop1" } } */ |
| 27 |
/* { dg-final { scan-tree-dump-times "(?:lt_expr|min_expr), " 2 "forwprop1" } } */ |
| 28 |
/* { dg-final { scan-tree-dump-times "(?:vec_cond_expr|min_expr), " 2 "forwprop1" } } */ |