| 1 |
/* { dg-require-effective-target vect_int } */ |
| 2 |
/* { dg-require-effective-target vect_int_mult } */ |
| 3 |
/* { dg-additional-options "-fdump-tree-optimized-details-blocks" } */ |
| 4 |
|
| 5 |
#include <stdarg.h> |
| 6 |
#include "tree-vect.h" |
| 7 |
|
| 8 |
extern void abort (void); |
| 9 |
|
| 10 |
unsigned int A[8] = {0x08000000,0xffffffff,0xff0000ff,0xf0000001, |
| 11 |
0x08000000,0xffffffff,0xff0000ff,0xf0000001}; |
| 12 |
unsigned int B[8] = {0x08000000,0x08000001,0xff0000ff,0xf0000001, |
| 13 |
0x08000000,0x08000001,0xff0000ff,0xf0000001}; |
| 14 |
unsigned int Answer[8] = {0,0xf7ffffff,0x0200fe01,0xe0000001, |
| 15 |
0,0xf7ffffff,0x0200fe01,0xe0000001}; |
| 16 |
unsigned int C[8]; |
| 17 |
|
| 18 |
__attribute__ ((noinline)) |
| 19 |
void u () |
| 20 |
{ |
| 21 |
int i, j; |
| 22 |
|
| 23 |
for (i=0; i<8; i++) |
| 24 |
C[i] = A[i] * B[i]; |
| 25 |
#pragma GCC novector |
| 26 |
for (i=0; i<8; i++) |
| 27 |
if (C[i] != Answer[i]) |
| 28 |
abort (); |
| 29 |
} |
| 30 |
|
| 31 |
signed int D[8] = {0x08000000,0xffffffff,0xff0000ff,0xf0000001, |
| 32 |
0x08000000,0xffffffff,0xff0000ff,0xf0000001}; |
| 33 |
signed int E[8] = {0x08000000,0x08000001,0xff0000ff,0xf0000001, |
| 34 |
0x08000000,0x08000001,0xff0000ff,0xf0000001}; |
| 35 |
signed int Dnswer[8] = {0,0xf7ffffff,0x0200fe01, 0xe0000001, |
| 36 |
0,0xf7ffffff,0x0200fe01, 0xe0000001}; |
| 37 |
signed int F[8]; |
| 38 |
|
| 39 |
__attribute__ ((noinline)) |
| 40 |
void s() |
| 41 |
{ |
| 42 |
int i, j; |
| 43 |
|
| 44 |
for (i=0; i<8; i++) |
| 45 |
F[i] = D[i] * E[i]; |
| 46 |
#pragma GCC novector |
| 47 |
for (i=0; i<8; i++) |
| 48 |
if (F[i] != Dnswer[i]) |
| 49 |
abort (); |
| 50 |
} |
| 51 |
|
| 52 |
__attribute__ ((noinline)) |
| 53 |
int main1 () |
| 54 |
{ |
| 55 |
u(); |
| 56 |
s(); |
| 57 |
return 0; |
| 58 |
} |
| 59 |
|
| 60 |
int main (void) |
| 61 |
{ |
| 62 |
check_vect (); |
| 63 |
|
| 64 |
return main1 (); |
| 65 |
} |
| 66 |
|
| 67 |
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" } } */ |
| 68 |
/* { dg-final { scan-tree-dump-not "Invalid sum" "optimized" } } */ |