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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.c-torture/] [execute/] [cmpsi-2.c] - Blame information for rev 774

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

Line No. Rev Author Line
1 688 jeremybenn
#define F 140
2
#define T 13
3
 
4
feq (int x, int y)
5
{
6
  if (x == y)
7
    return T;
8
  else
9
    return F;
10
}
11
 
12
fne (int x, int y)
13
{
14
  if (x != y)
15
    return T;
16
  else
17
    return F;
18
}
19
 
20
flt (int x, int y)
21
{
22
  if (x < y)
23
    return T;
24
  else
25
    return F;
26
}
27
 
28
fge (int x, int y)
29
{
30
  if (x >= y)
31
    return T;
32
  else
33
    return F;
34
}
35
 
36
fgt (int x, int y)
37
{
38
  if (x > y)
39
    return T;
40
  else
41
    return F;
42
}
43
 
44
fle (int x, int y)
45
{
46
  if (x <= y)
47
    return T;
48
  else
49
    return F;
50
}
51
 
52
fltu (unsigned int x, unsigned int y)
53
{
54
  if (x < y)
55
    return T;
56
  else
57
    return F;
58
}
59
 
60
fgeu (unsigned int x, unsigned int y)
61
{
62
  if (x >= y)
63
    return T;
64
  else
65
    return F;
66
}
67
 
68
fgtu (unsigned int x, unsigned int y)
69
{
70
  if (x > y)
71
    return T;
72
  else
73
    return F;
74
}
75
 
76
fleu (unsigned int x, unsigned int y)
77
{
78
  if (x <= y)
79
    return T;
80
  else
81
    return F;
82
}
83
 
84
unsigned int args[] =
85
{
86
  0L,
87
  1L,
88
  -1L,
89
  0x7fffffffL,
90
  0x80000000L,
91
  0x80000001L,
92
  0x1A3F2373L,
93
  0x93850E92L
94
};
95
 
96
int correct_results[] =
97
{
98
  T, F, F, T, F, T, F, T, F, T,
99
  F, T, T, F, F, T, T, F, F, T,
100
  F, T, F, T, T, F, T, F, F, T,
101
  F, T, T, F, F, T, T, F, F, T,
102
  F, T, F, T, T, F, T, F, F, T,
103
  F, T, F, T, T, F, T, F, F, T,
104
  F, T, T, F, F, T, T, F, F, T,
105
  F, T, F, T, T, F, T, F, F, T,
106
  F, T, F, T, T, F, F, T, T, F,
107
  T, F, F, T, F, T, F, T, F, T,
108
  F, T, F, T, T, F, T, F, F, T,
109
  F, T, T, F, F, T, T, F, F, T,
110
  F, T, F, T, T, F, T, F, F, T,
111
  F, T, F, T, T, F, T, F, F, T,
112
  F, T, T, F, F, T, T, F, F, T,
113
  F, T, F, T, T, F, T, F, F, T,
114
  F, T, T, F, F, T, F, T, T, F,
115
  F, T, T, F, F, T, F, T, T, F,
116
  T, F, F, T, F, T, F, T, F, T,
117
  F, T, T, F, F, T, F, T, T, F,
118
  F, T, F, T, T, F, F, T, T, F,
119
  F, T, F, T, T, F, F, T, T, F,
120
  F, T, T, F, F, T, F, T, T, F,
121
  F, T, F, T, T, F, F, T, T, F,
122
  F, T, F, T, T, F, F, T, T, F,
123
  F, T, F, T, T, F, F, T, T, F,
124
  F, T, F, T, T, F, T, F, F, T,
125
  T, F, F, T, F, T, F, T, F, T,
126
  F, T, F, T, T, F, T, F, F, T,
127
  F, T, F, T, T, F, T, F, F, T,
128
  F, T, F, T, T, F, F, T, T, F,
129
  F, T, F, T, T, F, T, F, F, T,
130
  F, T, T, F, F, T, F, T, T, F,
131
  F, T, T, F, F, T, F, T, T, F,
132
  F, T, T, F, F, T, T, F, F, T,
133
  F, T, T, F, F, T, F, T, T, F,
134
  T, F, F, T, F, T, F, T, F, T,
135
  F, T, T, F, F, T, T, F, F, T,
136
  F, T, T, F, F, T, F, T, T, F,
137
  F, T, T, F, F, T, T, F, F, T,
138
  F, T, T, F, F, T, F, T, T, F,
139
  F, T, T, F, F, T, F, T, T, F,
140
  F, T, T, F, F, T, T, F, F, T,
141
  F, T, T, F, F, T, F, T, T, F,
142
  F, T, F, T, T, F, F, T, T, F,
143
  T, F, F, T, F, T, F, T, F, T,
144
  F, T, T, F, F, T, F, T, T, F,
145
  F, T, T, F, F, T, T, F, F, T,
146
  F, T, F, T, T, F, F, T, T, F,
147
  F, T, F, T, T, F, F, T, T, F,
148
  F, T, F, T, T, F, T, F, F, T,
149
  F, T, T, F, F, T, T, F, F, T,
150
  F, T, F, T, T, F, T, F, F, T,
151
  F, T, F, T, T, F, T, F, F, T,
152
  T, F, F, T, F, T, F, T, F, T,
153
  F, T, F, T, T, F, T, F, F, T,
154
  F, T, T, F, F, T, F, T, T, F,
155
  F, T, T, F, F, T, F, T, T, F,
156
  F, T, T, F, F, T, T, F, F, T,
157
  F, T, T, F, F, T, F, T, T, F,
158
  F, T, F, T, T, F, F, T, T, F,
159
  F, T, F, T, T, F, F, T, T, F,
160
  F, T, T, F, F, T, F, T, T, F,
161
  T, F, F, T, F, T, F, T, F, T
162
};
163
 
164
int
165
main (void)
166
{
167
  int i, j, *res = correct_results;
168
 
169
  for (i = 0; i < 8; i++)
170
    {
171
      unsigned int arg0 = args[i];
172
      for (j = 0; j < 8; j++)
173
        {
174
          unsigned int arg1 = args[j];
175
 
176
          if (feq (arg0, arg1) != *res++)
177
            abort ();
178
          if (fne (arg0, arg1) != *res++)
179
            abort ();
180
          if (flt (arg0, arg1) != *res++)
181
            abort ();
182
          if (fge (arg0, arg1) != *res++)
183
            abort ();
184
          if (fgt (arg0, arg1) != *res++)
185
            abort ();
186
          if (fle (arg0, arg1) != *res++)
187
            abort ();
188
          if (fltu (arg0, arg1) != *res++)
189
            abort ();
190
          if (fgeu (arg0, arg1) != *res++)
191
            abort ();
192
          if (fgtu (arg0, arg1) != *res++)
193
            abort ();
194
          if (fleu (arg0, arg1) != *res++)
195
            abort ();
196
        }
197
    }
198
  exit (0);
199
}

powered by: WebSVN 2.1.0

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