| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-mdejagnu-cpu=power8 -mvsx -O3" } */ |
| 3 |
/* { dg-require-effective-target powerpc_vsx } */ |
| 4 |
/* { dg-final { scan-assembler-not "xxpermdi" } } */ |
| 5 |
|
| 6 |
/* This is a test for a specific convert-splat permute removal. */ |
| 7 |
|
| 8 |
void compute (float*, float*, float*, int, int); |
| 9 |
double test (void); |
| 10 |
double gorp; |
| 11 |
|
| 12 |
int main (void) |
| 13 |
{ |
| 14 |
float X[10000], Y[256], Z[2000]; |
| 15 |
int i; |
| 16 |
for (i = 0; i < 2500; i++) |
| 17 |
compute (X, Y, Z, 256, 2000); |
| 18 |
gorp = test (); |
| 19 |
} |
| 20 |
|
| 21 |
void compute(float *X, float *Y, float *Z, int m, int n) |
| 22 |
{ |
| 23 |
int i, j; |
| 24 |
float w, *x, *y; |
| 25 |
|
| 26 |
for (i = 0; i < n; i++) |
| 27 |
{ |
| 28 |
w = 0.0; |
| 29 |
x = X++; |
| 30 |
y = Y; |
| 31 |
for (j = 0; j < m; j++) |
| 32 |
w += (*x++) * (*y++); |
| 33 |
Z[i] = w; |
| 34 |
} |
| 35 |
} |