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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.target/] [i386/] [pr42542-4.c] - Blame information for rev 318

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 318 jeremybenn
/* { dg-do run } */
2
/* { dg-require-effective-target sse4 } */
3
/* { dg-options "-O1 -msse4.2 -ftree-vectorize" } */
4
 
5
#include "sse4_2-check.h"
6
 
7
unsigned long long v1[] __attribute__ ((aligned(16))) =
8
{
9
  0x8000000000000000ULL, 2,
10
  3, 0xd000000000000000ULL
11
};
12
unsigned long long v2[] __attribute__ ((aligned(16))) =
13
{
14
  4, 0xb000000000000000ULL,
15
  0xf000000000000000ULL, 6
16
};
17
 
18
unsigned long long max[] =
19
{
20
  0x8000000000000000ULL, 0xb000000000000000ULL,
21
  0xf000000000000000ULL, 0xd000000000000000ULL
22
};
23
 
24
unsigned long long min[] =
25
{
26
  4, 2,
27
  3, 6
28
};
29
 
30
unsigned long long res[4] __attribute__ ((aligned(16)));
31
 
32
extern void abort (void);
33
 
34
void
35
find_max (void)
36
{
37
  int i;
38
 
39
  for (i = 0; i < 4; i++)
40
    res[i] = v1[i] < v2[i] ? v2[i] : v1[i];
41
}
42
 
43
void
44
find_min (void)
45
{
46
  int i;
47
 
48
  for (i = 0; i < 4; i++)
49
    res[i] = v1[i] > v2[i] ? v2[i] : v1[i];
50
}
51
 
52
static void
53
sse4_2_test (void)
54
{
55
  int i;
56
  int err = 0;
57
 
58
  find_max ();
59
  for (i = 0; i < 4; i++)
60
    if (res[i] != max[i])
61
      err++;
62
 
63
  find_min ();
64
  for (i = 0; i < 4; i++)
65
    if (res[i] != min[i])
66
      err++;
67
 
68
  if (err)
69
    abort ();
70
}

powered by: WebSVN 2.1.0

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