summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/vect/vect-11a.c
blob: 2da903b1bc498f353d5d5cb4e6d53bb7cb299793 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/* { dg-require-effective-target vect_int } */
/* { dg-require-effective-target vect_int_mult } */

#include <stdarg.h>
#include "tree-vect.h"

extern void abort (void);

unsigned int A[8] = {0x08000000,0xffffffff,0xff0000ff,0xf0000001,
		     0x08000000,0xffffffff,0xff0000ff,0xf0000001};
unsigned int B[8] = {0x08000000,0x08000001,0xff0000ff,0xf0000001,
		     0x08000000,0x08000001,0xff0000ff,0xf0000001};
unsigned int Answer[8] = {0,0xf7ffffff,0x0200fe01,0xe0000001,
			  0,0xf7ffffff,0x0200fe01,0xe0000001};
unsigned int C[8];

__attribute__ ((noinline))
void u ()
{  
  int i, j;
  
  for (i=0; i<8; i++)
    C[i] = A[i] * B[i];
  for (i=0; i<8; i++)
    if (C[i] != Answer[i])
      abort ();
}

signed int D[8] = {0x08000000,0xffffffff,0xff0000ff,0xf0000001,
		   0x08000000,0xffffffff,0xff0000ff,0xf0000001};
signed int E[8] = {0x08000000,0x08000001,0xff0000ff,0xf0000001,
		   0x08000000,0x08000001,0xff0000ff,0xf0000001};
signed int Dnswer[8] = {0,0xf7ffffff,0x0200fe01, 0xe0000001,
			0,0xf7ffffff,0x0200fe01, 0xe0000001};
signed int F[8];

__attribute__ ((noinline))
void s()
{
  int i, j;
  
  for (i=0; i<8; i++)
    F[i] = D[i] * E[i];
  for (i=0; i<8; i++)
    if (F[i] != Dnswer[i])
      abort ();
}

__attribute__ ((noinline))
int main1 ()
{
  u();
  s();
  return 0;
}

int main (void)
{ 
  check_vect ();
  
  return main1 ();
}

/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" } } */
/* { dg-final { cleanup-tree-dump "vect" } } */