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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.target/] [i386/] [sse2-cvt-1.c] - Blame information for rev 691

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 691 jeremybenn
/* { dg-do run } */
2
/* { dg-options "-O3 -msse2 -mno-avx" } */
3
/* { dg-require-effective-target sse2 } */
4
 
5
#ifndef CHECK_H
6
#define CHECK_H "sse2-check.h"
7
#endif
8
 
9
#ifndef TEST
10
#define TEST sse2_test
11
#endif
12
 
13
#include CHECK_H
14
 
15
#define N 16
16
float f[N];
17
double d[N];
18
int n[N];
19
 
20
__attribute__((noinline)) void
21
f1 (void)
22
{
23
  int i;
24
  for (i = 0; i < N; i++)
25
    n[i] = d[i];
26
}
27
 
28
__attribute__((noinline)) void
29
f2 (void)
30
{
31
  int i;
32
  for (i = 0; i < N; i++)
33
    f[i] = n[i];
34
}
35
 
36
__attribute__((noinline)) void
37
f3 (void)
38
{
39
  int i;
40
  for (i = 0; i < N; i++)
41
    d[i] = f[i];
42
}
43
 
44
__attribute__((noinline)) void
45
f4 (void)
46
{
47
  int i;
48
  for (i = 0; i < N; i++)
49
    n[i] = f[i];
50
}
51
 
52
__attribute__((noinline)) void
53
f5 (void)
54
{
55
  int i;
56
  for (i = 0; i < N; i++)
57
    d[i] = n[i];
58
}
59
 
60
__attribute__((noinline)) void
61
f6 (void)
62
{
63
  int i;
64
  for (i = 0; i < N; i++)
65
    f[i] = d[i];
66
}
67
 
68
static void
69
TEST ()
70
{
71
  int i;
72
  for (i = 0; i < N; i++)
73
    {
74
      asm ("");
75
      d[i] = i + 2.5;
76
    }
77
  f1 ();
78
  for (i = 0; i < N; i++)
79
    if (n[i] != i + 2)
80
      abort ();
81
    else
82
      n[i] = i + 7;
83
  f2 ();
84
  for (i = 0; i < N; i++)
85
    if (f[i] != i + 7)
86
      abort ();
87
    else
88
      f[i] = i - 2.25f;
89
  f3 ();
90
  for (i = 0; i < N; i++)
91
    if (d[i] != i - 2.25)
92
      abort ();
93
    else
94
      f[i] = i + 3.5;
95
  f4 ();
96
  for (i = 0; i < N; i++)
97
    if (n[i] != i + 3)
98
      abort ();
99
    else
100
      n[i] = i + 9;
101
  f5 ();
102
  for (i = 0; i < N; i++)
103
    if (d[i] != i + 9)
104
      abort ();
105
    else
106
      d[i] = i - 7.25;
107
  f6 ();
108
  for (i = 0; i < N; i++)
109
    if (f[i] != i - 7.25)
110
      abort ();
111
}

powered by: WebSVN 2.1.0

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