| 1 |
/* { dg-require-effective-target vect_int } */ |
| 2 |
/* { dg-additional-options "-fno-early-inlining" } */ |
| 3 |
|
| 4 |
#include <stdarg.h> |
| 5 |
#include "tree-vect.h" |
| 6 |
|
| 7 |
#define N 64 |
| 8 |
|
| 9 |
short X[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))); |
| 10 |
short Y[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))); |
| 11 |
int result[N]; |
| 12 |
|
| 13 |
/* short->int widening-mult */ |
| 14 |
int |
| 15 |
foo1(int len) { |
| 16 |
int i; |
| 17 |
|
| 18 |
for (i=0; i<len/2; i++) { |
| 19 |
result[2*i] = X[2*i] * Y[2*i]; |
| 20 |
result[2*i+1] = X[2*i+1] * Y[2*i+1]; |
| 21 |
} |
| 22 |
} |
| 23 |
|
| 24 |
int main (void) |
| 25 |
{ |
| 26 |
int i; |
| 27 |
|
| 28 |
check_vect (); |
| 29 |
|
| 30 |
for (i=0; i<N; i++) { |
| 31 |
X[i] = i; |
| 32 |
Y[i] = 64-i; |
| 33 |
__asm__ volatile (""); |
| 34 |
} |
| 35 |
|
| 36 |
foo1 (N); |
| 37 |
|
| 38 |
#pragma GCC novector |
| 39 |
for (i=0; i<N; i++) { |
| 40 |
if (result[i] != X[i] * Y[i]) |
| 41 |
abort (); |
| 42 |
} |
| 43 |
|
| 44 |
return 0; |
| 45 |
} |
| 46 |
|
| 47 |
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_widen_mult_hi_to_si } } }*/ |
| 48 |
/* { dg-final { scan-tree-dump "vectorizing stmts using SLP" "vect" { target vect_widen_mult_hi_to_si } } } */ |
| 49 |
|