| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-O2 -fdump-tree-ccp1" } */ |
| 3 |
|
| 4 |
typedef double v2df __attribute__ ((vector_size (2 * sizeof (double)))); |
| 5 |
|
| 6 |
void do_div (v2df *a, v2df *b) |
| 7 |
{ |
| 8 |
*a = *b / (v2df) { 2.0, 2.0 }; |
| 9 |
} |
| 10 |
|
| 11 |
/* Since 2.0 has an exact reciprocal, constant folding should multiply *b |
| 12 |
by the reciprocals of the vector elements. As a result there should be |
| 13 |
one vector multiply and zero divides in the optimized code. The fold |
| 14 |
does not take place for generic vectors until the first CCP pass. The |
| 15 |
string " * " occurs 3 times: one multiply and two indirect parameters. */ |
| 16 |
|
| 17 |
/* { dg-final { scan-tree-dump-times " \\\* " 3 "ccp1" } } */ |
| 18 |
/* { dg-final { scan-tree-dump-times " / " 0 "ccp1" } } */ |