OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.target/] [ia64/] [pr42542-1.c] - Blame information for rev 753

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 691 jeremybenn
/* { dg-do run } */
2
/* { dg-options "-O1 -ftree-vectorize" } */
3
 
4
unsigned int v1[] __attribute__ ((aligned(16))) =
5
{
6
  0x80000000, 1, 0xa0000000, 2,
7
  3, 0xd0000000, 0xf0000000, 0xe0000000
8
};
9
unsigned int v2[] __attribute__ ((aligned(16))) =
10
{
11
  4, 0xb0000000, 5, 0xc0000000,
12
  0xd0000000, 6, 7, 8
13
};
14
 
15
unsigned int max[] =
16
{
17
  0x80000000, 0xb0000000, 0xa0000000, 0xc0000000,
18
  0xd0000000, 0xd0000000, 0xf0000000, 0xe0000000
19
};
20
 
21
unsigned int min[] =
22
{
23
  4, 1, 5, 2,
24
  3, 6, 7, 8
25
};
26
 
27
unsigned int res[8] __attribute__ ((aligned(16)));
28
 
29
extern void abort (void);
30
 
31
void
32
find_max (void)
33
{
34
  int i;
35
 
36
  for (i = 0; i < 8; i++)
37
    res[i] = v1[i] < v2[i] ? v2[i] : v1[i];
38
}
39
 
40
void
41
find_min (void)
42
{
43
  int i;
44
 
45
  for (i = 0; i < 8; i++)
46
    res[i] = v1[i] > v2[i] ? v2[i] : v1[i];
47
}
48
 
49
int main (void)
50
{
51
  int i;
52
  int err = 0;
53
 
54
  find_max ();
55
  for (i = 0; i < 8; i++)
56
    if (res[i] != max[i])
57
      err++;
58
 
59
  find_min ();
60
  for (i = 0; i < 8; i++)
61
    if (res[i] != min[i])
62
      err++;
63
 
64
  if (err)
65
    abort ();
66
 
67
  return 0;
68
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.