| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-O -fdump-tree-gimple" } */ |
| 3 |
|
| 4 |
typedef int vec __attribute__ ((vector_size (4 * sizeof (int)))); |
| 5 |
|
| 6 |
void f1 (vec *x) |
| 7 |
{ |
| 8 |
*x = (*x >= 0) ? *x : -*x; |
| 9 |
} |
| 10 |
void f2 (vec *x) |
| 11 |
{ |
| 12 |
*x = (0 < *x) ? *x : -*x; |
| 13 |
} |
| 14 |
void g1 (vec *x) |
| 15 |
{ |
| 16 |
*x = (*x < 0) ? -*x : *x; |
| 17 |
} |
| 18 |
void g2 (vec *x) |
| 19 |
{ |
| 20 |
*x = (0 > *x) ? -*x : *x; |
| 21 |
} |
| 22 |
void h (vec *x, vec *y) |
| 23 |
{ |
| 24 |
*x = (*x < *y) ? *y : *x; |
| 25 |
} |
| 26 |
void i (vec *x, vec *y) |
| 27 |
{ |
| 28 |
*x = (*x < *y) ? *x : *y; |
| 29 |
} |
| 30 |
void j (vec *x, vec *y) |
| 31 |
{ |
| 32 |
*x = (*x < *y) ? *x : *x; |
| 33 |
} |
| 34 |
|
| 35 |
/* { dg-final { scan-tree-dump-times "ABS_EXPR" 4 "gimple" } } */ |
| 36 |
/* { dg-final { scan-tree-dump "MIN_EXPR" "gimple" } } */ |
| 37 |
/* { dg-final { scan-tree-dump "MAX_EXPR" "gimple" } } */ |
| 38 |
/* { dg-final { scan-tree-dump-not "VEC_COND_EXPR" "gimple" } } */ |