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-3.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 char v1[] __attribute__ ((aligned(16))) =
5
{
6
  0x80, 0xd0, 0x90, 0xa0, 1, 15, 10, 15,
7
  0xa0, 0xc0, 0xb0, 0xf0, 2, 25, 20, 35,
8
  3, 34, 30, 36, 0xd0, 0x80, 0xe0, 0xb0,
9
  0xf0, 0xe0, 0xe0, 0x80, 25, 34, 30, 40
10
};
11
unsigned char v2[] __attribute__ ((aligned(16))) =
12
{
13
  4, 44, 40, 48, 0xb0, 0x80, 0x80, 0x90,
14
  5, 55, 50, 51, 0xc0, 0xb0, 0xf0, 0xd0,
15
  0xd0, 0x80, 0xa0, 0xf0, 6, 61, 65, 68,
16
  7, 76, 75, 81, 0xe0, 0xf0, 0xc0, 0x90
17
};
18
 
19
unsigned char max[] =
20
{
21
  0x80, 0xd0, 0x90, 0xa0, 0xb0, 0x80, 0x80, 0x90,
22
  0xa0, 0xc0, 0xb0, 0xf0, 0xc0, 0xb0, 0xf0, 0xd0,
23
  0xd0, 0x80, 0xa0, 0xf0, 0xd0, 0x80, 0xe0, 0xb0,
24
  0xf0, 0xe0, 0xe0, 0x80, 0xe0, 0xf0, 0xc0, 0x90
25
};
26
 
27
unsigned char min[] =
28
{
29
  4, 44, 40, 48, 1, 15, 10, 15,
30
  5, 55, 50, 51, 2, 25, 20, 35,
31
  3, 34, 30, 36, 6, 61, 65, 68,
32
  7, 76, 75, 81, 25, 34, 30, 40
33
};
34
 
35
unsigned char res[32] __attribute__ ((aligned(16)));
36
 
37
extern void abort (void);
38
 
39
void
40
find_max (void)
41
{
42
  int i;
43
 
44
  for (i = 0; i < 32; i++)
45
    res[i] = v1[i] < v2[i] ? v2[i] : v1[i];
46
}
47
 
48
void
49
find_min (void)
50
{
51
  int i;
52
 
53
  for (i = 0; i < 32; i++)
54
    res[i] = v1[i] > v2[i] ? v2[i] : v1[i];
55
}
56
 
57
int main (void)
58
{
59
  int i;
60
  int err = 0;
61
 
62
  find_max ();
63
  for (i = 0; i < 32; i++)
64
    if (res[i] != max[i])
65
      err++;
66
 
67
  find_min ();
68
  for (i = 0; i < 32; i++)
69
    if (res[i] != min[i])
70
      err++;
71
 
72
  if (err)
73
    abort ();
74
 
75
  return 0;
76
}

powered by: WebSVN 2.1.0

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