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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-stable/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.target/] [ia64/] [pr42542-2.c] - Blame information for rev 319

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

Line No. Rev Author Line
1 319 jeremybenn
/* { dg-do run } */
2
/* { dg-options "-O1 -ftree-vectorize" } */
3
 
4
unsigned short v1[] __attribute__ ((aligned(16))) =
5
{
6
  0x8000, 0x9000, 1, 10, 0xa000, 0xb000, 2, 20,
7
  3, 30, 0xd000, 0xe000, 0xf000, 0xe000, 25, 30
8
};
9
unsigned short v2[] __attribute__ ((aligned(16))) =
10
{
11
  4, 40, 0xb000, 0x8000, 5, 50, 0xc000, 0xf000,
12
  0xd000, 0xa000, 6, 65, 7, 75, 0xe000, 0xc000
13
};
14
 
15
unsigned short max[] =
16
{
17
  0x8000, 0x9000, 0xb000, 0x8000, 0xa000, 0xb000, 0xc000, 0xf000,
18
  0xd000, 0xa000, 0xd000, 0xe000, 0xf000, 0xe000, 0xe000, 0xc000
19
};
20
 
21
unsigned short min[] =
22
{
23
  4, 40, 1, 10, 5, 50, 2, 20,
24
  3, 30, 6, 65, 7, 75, 25, 30
25
};
26
 
27
unsigned short res[16] __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 < 16; 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 < 16; 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 < 16; i++)
56
    if (res[i] != max[i])
57
      err++;
58
 
59
  find_min ();
60
  for (i = 0; i < 16; 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.