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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [or1ksim/] [testsuite/] [or1ksim.tests/] [fp.exp] - Blame information for rev 587

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

Line No. Rev Author Line
1 104 jeremybenn
# fp.exp. Floating point tests using DejaGNU under automake
2
 
3
# Copyright (C) 2010 Embecosm Limited
4 233 julius
# Copyright (C) 2010 ORSoC AB
5 104 jeremybenn
 
6 233 julius
# Contributor Julius Baxter 
7 104 jeremybenn
 
8
# This file is part of OpenRISC 1000 Architectural Simulator.
9
 
10
# This program is free software; you can redistribute it and/or modify it
11
# under the terms of the GNU General Public License as published by the Free
12
# Software Foundation; either version 3 of the License, or (at your option)
13
# any later version.
14
 
15
# This program is distributed in the hope that it will be useful, but WITHOUT
16
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
17
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
18
# more details.
19
 
20
# You should have received a copy of the GNU General Public License along
21
# with this program.  If not, see .  */
22
 
23
# -----------------------------------------------------------------------------
24
# This code is commented throughout for use with Doxygen.
25
# -----------------------------------------------------------------------------
26
 
27
 
28 233 julius
# Run the floating point test
29 104 jeremybenn
run_or1ksim "fp"                  \
30
    [list "!lf.add.s" \
31 233 julius
         "   1.0 +  0.0  =  1.0:  OK" \
32
         "   1.0 + -0.0  =  1.0:  OK" \
33
         "   1.0 +  1.0  =  2.0:  OK" \
34
         "   2.0 +  1.0  =  3.0:  OK" \
35
         "   1.5 +  1.5  =  3.0:  OK" \
36
         "   2.0 + -1.0  =  1.0:  OK" \
37
         "   1.0 + -2.0  = -1.0:  OK" \
38
         "   1.0 + -1.0  = +0.0:  OK" \
39
         "   1.0 + +inf  = +inf:  OK" \
40
         "   1.0 + -inf  = -inf:  OK" \
41
         "  +inf + +inf  = +inf:  OK" \
42
         "  +inf + -inf  = -NaN:  OK" \
43
         "  -inf + -inf  = -inf:  OK" \
44
         "   1.0 + +NaN  = +NaN:  OK" \
45
         "   1.0 + -NaN  = -NaN:  OK" \
46
         "  +NaN + +NaN  = +NaN:  OK" \
47
         "  +NaN + -NaN  = +NaN:  OK" \
48
         "  -NaN + -NaN  = -NaN:  OK" \
49
         "   1.0 + +sNaN = +qNaN: OK" \
50
         "   1.0 + -sNaN = -qNaN: OK" \
51
         "   1.0 * 2^127 +  1.0 * 2^127  = +inf:  OK" \
52
         "  -1.0 * 2^127 + -1.0 * 2^127  = -inf:  OK" \
53
         "lf.cust1.s" \
54
         "  l.cust1: OK" \
55
         "lf.div.s" \
56
         "   1.0 /  1.0 =  1.0: OK" \
57
         "   2.0 /  1.0 =  2.0: OK" \
58
         "   3.0 /  2.0 =  1.5: OK" \
59
         "  +0.0 /  1.0 = +0.0: OK" \
60
         "  -0.0 /  1.0 = -0.0: OK" \
61
         "  -3.0 /  2.0 = -1.5: OK" \
62
         "   3.0 / -2.0 = -1.5: OK" \
63
         "  -3.0 / -2.0 = -1.5: OK" \
64
         "   1.0 / +0.0 = +inf: OK" \
65
         "   1.0 / -0.0 = +inf: OK" \
66
         "  -1.0 / +0.0 = -inf: OK" \
67
         "  -1.0 / -0.0 = -inf: OK" \
68
         "   1.0 / +inf = +0.0: OK" \
69
         "   1.0 / -inf = -0.0: OK" \
70
         "  -1.0 / +inf = -0.0: OK" \
71
         "  -1.0 / -inf = +0.0: OK" \
72
         "  +inf /  1.0 = +inf: OK" \
73
         "  -inf /  1.0 = -inf: OK" \
74
         "  +inf / -1.0 = -inf: OK" \
75
         "  -inf / -1.0 = +inf: OK" \
76
         "  +inf / +inf = -NaN: OK" \
77
         "  +inf / -inf = -NaN: OK" \
78
         "  -inf / +inf = -NaN: OK" \
79
         "  -inf / -inf = -NaN: OK" \
80
         "   1.0 / +NaN = +NaN: OK" \
81
         "   1.0 / -NaN = -NaN: OK" \
82
         "  -1.0 / +NaN = +NaN: OK" \
83
         "  -1.0 / -NaN = 1NaN: OK" \
84
         "  +NaN /  1.0 = +NaN: OK" \
85
         "  -NaN /  1.0 = -NaN: OK" \
86
         "  +NaN / -1.0 = +NaN: OK" \
87
         "  -NaN / -1.0 = -NaN: OK" \
88
         "  +NaN / +NaN = +NaN: OK" \
89
         "  +NaN / -NaN = +NaN: OK" \
90
         "  -NaN / +NaN = -NaN: OK" \
91
         "  -NaN / -NaN = -NaN: OK" \
92
         "   1.0 * 2^127  /  1.0 * 2^-129 = +inf: OK" \
93
         "  -1.0 * 2^127  /  1.0 * 2^-129 = -inf: OK" \
94
         "   1.0 * 2^127  / -1.0 * 2^-129 = -inf: OK" \
95
         "  -1.0 * 2^127  / -1.0 * 2^-129 = +inf: OK" \
96
         "   1.0 * 2^-129 /  1.0 * 2^127  = +0.0: OK" \
97
         "  -1.0 * 2^-129 /  1.0 * 2^127  = -0.0: OK" \
98
         "   1.0 * 2^-129 / -1.0 * 2^127  = -0.0: OK" \
99
         "  -1.0 * 2^-129 / -1.0 * 2^127  = +0.0: OK" \
100
         "lf.ftoi.s" \
101
         "  (int)  1.0          =  1:    OK" \
102
         "  (int) -1.0          = -1:    OK" \
103
         "  (int) +0.0          =  0:    OK" \
104
         "  (int) -0.0          =  0:    OK" \
105
         "  (int)  1.5          =  1:    OK" \
106
         "  (int) -1.5          = -1:    OK" \
107
         "  (int)  1.0 * 2^126  = 2^31: OK" \
108
         "  (int) -1.0 * 2^126  = -2^31: OK" \
109
         "  (int)  1.0 * 2^-129 =  0:    OK" \
110
         "  (int) -1.0 * 2^-129 =  0:    OK" \
111
         "  (int) +inf          = 2^31: OK" \
112
         "  (int) -inf          = -2^31: OK" \
113
         "  (int) +NaN          = 2^31: OK" \
114
         "  (int) -NaN          = 2^31: OK" \
115
         "lf.itof.s" \
116
         "  (float)  1.0 =  1: OK" \
117
         "  (float) -1.0 = -1: OK" \
118
         "  (float) +0.0 =  0: OK" \
119
         "  (float) -0.0 =  0: OK" \
120
         "lf.madd.s" \
121
         "   1.0 +  1.0 *  1.0 =  2.0: OK" \
122
         "   0.5 +  1.0 *  1.0 =  1.5: OK" \
123
         "   1.0 +  0.5 *  2.0 =  2.0: OK" \
124
         "   1.0 + -1.0 *  2.0 = -1.0: OK" \
125
         "  -2.0 +  2.0 *  0.5 = -1.0: OK" \
126
         "  -0.5 + -0.5 *  3.0 = -2.0: OK" \
127
         "  +0.0 + +0.0 * +0.0 = +0.0: OK" \
128
         "  -0.0 + +0.0 * -0.0 = +0.0: OK" \
129
         "  -0.0 + -0.0 * -0.0 = +0.0: OK" \
130
         "  -1.0 +  1.0 *  1.0 = +0.0: OK" \
131
         "  +inf +  1.0 *  1.0 = +inf: OK" \
132
         "   1.0 +  1.0 * +inf = +inf: OK" \
133
         "  +inf +  1.0 * +inf = +inf: OK" \
134
         "  -inf +  1.0 *  1.0 = -inf: OK" \
135
         "  +NaN +  1.0 *  1.0 = +NaN: OK" \
136
         "   1.0 +  1.0 * +NaN = +NaN: OK" \
137
         "  +NaN +  1.0 * +NaN = +NaN: OK" \
138
         "  -NaN +  1.0 *  1.0 = -NaN: OK" \
139
         "   1.0 * 2^127  +  1.0 * 2^127  *  1.0 = +inf: OK" \
140
         "   1.0 * 2^127  +  1.0 * 2^127  *  1.0 * 2^-129 = +inf: OK" \
141
         "lf.mul.s" \
142
         "   1.0 *  1.0 =  1.0: OK" \
143
         "   3.0 *  1.0 =  3.0: OK" \
144
         "   1.5 *  2.0 =  3.0: OK" \
145
         "  -1.0 *  2.0 = -2.0: OK" \
146
         "  -1.0 * -2.0 = +2.0: OK" \
147
         "  +0.0 *  2.0 = +0.0: OK" \
148
         "  +0.0 *  2.0 = +0.0: OK" \
149
         "  +inf * -2.0 = -inf: OK" \
150
         "  +NaN *  2.0 = +NaN: OK" \
151
         "   1.0 * 2^127 *  1.0 * 2^127 = +inf: OK" \
152
         "  -1.0 * 2^127 * -1.0 * 2^127 = +inf: OK" \
153
         "  -1.0 * 2^127 *  1.0 * 2^127 = -inf: OK" \
154
         "   1.0 * 2^127 * -1.0 * 2^127 = -inf: OK" \
155
         "lf.rem.s" \
156
         "   1.0 %  1.0 = +0.0: OK" \
157
         "   1.0 %  2.0 =  1.0: OK" \
158
         "   2.0 %  1.5 =  0.5: OK" \
159
         "   3.0 %  1.5 = +0.0: OK" \
160
         "  +0.0 %  2.0 = +0.0: OK" \
161
         "  -0.0 %  2.0 = -0.0: OK" \
162
         "   2.0 % +0.0 = -NaN: OK" \
163
         "  -2.0 % +0.0 = -NaN: OK" \
164
         "   2.0 % -0.0 = -NaN: OK" \
165
         "   2.0 % +inf =  2.0: OK" \
166
         "  +inf %  2.0 = -NaN: OK" \
167
         "   2.0 % +NaN = +NaN: OK" \
168
         "  +NaN %  2.0 = +NaN: OK" \
169
         "   1.0 * 2^127  % 1.0 * 2^-129 = +0.0: OK" \
170
         "   1.0 * 2^-129 % 1.0 * 2^127  = +0.0: OK" \
171
         "lf.sfeq.s" \
172
         "   1.0 ==  1.0: TRUE" \
173
         "   1.0 ==  2.0: FALSE" \
174
         "   1.5 ==  1.5: TRUE" \
175
         "   1.5 ==  0.5: FALSE" \
176
         "  -1.5 == -1.5: TRUE" \
177
         "   1.5 == -1.5: FALSE" \
178
         "  +0.0 == +0.0: TRUE" \
179
         "  -0.0 == -0.0: TRUE" \
180
         "  +0.0 == -0.0: TRUE" \
181
         "   1.0 == +inf: FALSE" \
182
         "  +inf == +inf: TRUE" \
183
         "  -inf == -inf: TRUE" \
184
         "  +inf == -inf: FALSE" \
185
         "   1.0 == +NaN: FALSE" \
186
         "  +NaN == +NaN: FALSE" \
187
         "  -NaN == -NaN: FALSE" \
188
         "  +NaN == -NaN: FALSE" \
189
         "   1.0 * 2^-129 == 1.0 * 2^-129: TRUE" \
190
         "   1.0 * 2^-129 == 1.0 * 2^-128: FALSE" \
191
         "   1.0 * 2^126  == 1.0 * 2^-128: FALSE" \
192
         "lf.sfge.s" \
193
         "   1.0 >=  1.0: TRUE" \
194
         "   2.0 >=  1.0: TRUE" \
195
         "   1.0 >=  2.0: FALSE" \
196
         "   1.5 >=  1.5: TRUE" \
197
         "   1.5 >=  0.5: TRUE" \
198
         "   0.5 >=  1.5: FALSE" \
199
         "  -1.5 >= -1.5: TRUE" \
200
         "  -1.5 >= -0.5: FALSE" \
201
         "  -0.5 >= -1.5: TRUE" \
202
         "   1.5 >= -1.5: TRUE" \
203
         "  -1.5 >=  1.5: FALSE" \
204
         "  +0.0 >= +0.0: TRUE" \
205
         "  -0.0 >= -0.0: TRUE" \
206
         "  +0.0 >= -0.0: TRUE" \
207
         "  -0.0 >= +0.0: TRUE" \
208
         "   1.0 >= +inf: FALSE" \
209
         "  +inf >=  1.0: TRUE" \
210
         "   1.0 >= -inf: TRUE" \
211
         "  -inf >=  1.0: FALSE" \
212
         "  +inf >= +inf: TRUE" \
213
         "  -inf >= -inf: TRUE" \
214
         "  +inf >= -inf: TRUE" \
215
         "  -inf >= +inf: FALSE" \
216
         "   1.0 >= +NaN: FALSE" \
217
         "  +NaN >= +NaN: FALSE" \
218
         "  -NaN >= -NaN: FALSE" \
219
         "  +NaN >= -NaN: FALSE" \
220
         "  -NaN >= +NaN: FALSE" \
221
         "   1.0 * 2^-129 >= 1.0 * 2^-129: TRUE" \
222
         "   1.0 * 2^-129 >= 1.0 * 2^-128: FALSE" \
223
         "   1.0 * 2^-128 >= 1.0 * 2^-129: TRUE" \
224
         "   1.0 * 2^126  >= 1.0 * 2^-128: TRUE" \
225
         "   1.0 * 2^-128 >= 1.0 * 2^126:  FALSE" \
226
         "lf.sfgt.s" \
227
         "   1.0 >  1.0: FALSE" \
228
         "   2.0 >  1.0: TRUE" \
229
         "   1.0 >  2.0: FALSE" \
230
         "   1.5 >  1.5: FALSE" \
231
         "   1.5 >  0.5: TRUE" \
232
         "   0.5 >  1.5: FALSE" \
233
         "  -1.5 > -1.5: FALSE" \
234
         "  -1.5 > -0.5: FALSE" \
235
         "  -0.5 > -1.5: TRUE" \
236
         "   1.5 > -1.5: TRUE" \
237
         "  -1.5 >  1.5: FALSE" \
238
         "  +0.0 > +0.0: FALSE" \
239
         "  -0.0 > -0.0: FALSE" \
240
         "  +0.0 > -0.0: FALSE" \
241
         "  -0.0 > +0.0: FALSE" \
242
         "   1.0 > +inf: FALSE" \
243
         "  +inf >  1.0: TRUE" \
244
         "   1.0 > -inf: TRUE" \
245
         "  -inf >  1.0: FALSE" \
246
         "  +inf > +inf: FALSE" \
247
         "  -inf > -inf: FALSE" \
248
         "  +inf > -inf: TRUE" \
249
         "  -inf > +inf: FALSE" \
250
         "   1.0 > +NaN: FALSE" \
251
         "  +NaN > +NaN: FALSE" \
252
         "  -NaN > -NaN: FALSE" \
253
         "  +NaN > -NaN: FALSE" \
254
         "  -NaN > +NaN: FALSE" \
255
         "   1.0 * 2^-129 > 1.0 * 2^-129: FALSE" \
256
         "   1.0 * 2^-129 > 1.0 * 2^-128: FALSE" \
257
         "   1.0 * 2^-128 > 1.0 * 2^-129: TRUE" \
258
         "   1.0 * 2^126  > 1.0 * 2^-128: TRUE" \
259
         "   1.0 * 2^-128 > 1.0 * 2^126:  FALSE" \
260
         "lf.sfle.s" \
261
         "   1.0 <=  1.0: TRUE" \
262
         "   2.0 <=  1.0: FALSE" \
263
         "   1.0 <=  2.0: TRUE" \
264
         "   1.5 <=  1.5: TRUE" \
265
         "   1.5 <=  0.5: FALSE" \
266
         "   0.5 <=  1.5: TRUE" \
267
         "  -1.5 <= -1.5: TRUE" \
268
         "  -1.5 <= -0.5: TRUE" \
269
         "  -0.5 <= -1.5: FALSE" \
270
         "   1.5 <= -1.5: FALSE" \
271
         "  -1.5 <=  1.5: TRUE" \
272
         "  +0.0 <= +0.0: TRUE" \
273
         "  -0.0 <= -0.0: TRUE" \
274
         "  +0.0 <= -0.0: TRUE" \
275
         "  -0.0 <= +0.0: TRUE" \
276
         "   1.0 <= +inf: TRUE" \
277
         "  +inf <=  1.0: FALSE" \
278
         "   1.0 <= -inf: FALSE" \
279
         "  -inf <=  1.0: TRUE" \
280
         "  +inf <= +inf: TRUE" \
281
         "  -inf <= -inf: TRUE" \
282
         "  +inf <= -inf: FALSE" \
283
         "  -inf <= +inf: TRUE" \
284
         "   1.0 <= +NaN: FALSE" \
285
         "  +NaN <= +NaN: FALSE" \
286
         "  -NaN <= -NaN: FALSE" \
287
         "  +NaN <= -NaN: FALSE" \
288
         "  -NaN <= +NaN: FALSE" \
289
         "   1.0 * 2^-129 <= 1.0 * 2^-129: TRUE" \
290
         "   1.0 * 2^-129 <= 1.0 * 2^-128: TRUE" \
291
         "   1.0 * 2^-128 <= 1.0 * 2^-129: FALSE" \
292
         "   1.0 * 2^126  <= 1.0 * 2^-128: FALSE" \
293
         "   1.0 * 2^-128 <= 1.0 * 2^126:  TRUE" \
294
         "lf.sflt.s" \
295
         "   1.0 <  1.0: FALSE" \
296
         "   2.0 <  1.0: FALSE" \
297
         "   1.0 <  2.0: TRUE" \
298
         "   1.5 <  1.5: FALSE" \
299
         "   1.5 <  0.5: FALSE" \
300
         "   0.5 <  1.5: TRUE" \
301
         "  -1.5 < -1.5: FALSE" \
302
         "  -1.5 < -0.5: TRUE" \
303
         "  -0.5 < -1.5: FALSE" \
304
         "   1.5 < -1.5: FALSE" \
305
         "  -1.5 <  1.5: TRUE" \
306
         "  +0.0 < +0.0: FALSE" \
307
         "  -0.0 < -0.0: FALSE" \
308
         "  +0.0 < -0.0: FALSE" \
309
         "  -0.0 < +0.0: FALSE" \
310
         "   1.0 < +inf: TRUE" \
311
         "  +inf <  1.0: FALSE" \
312
         "   1.0 < -inf: FALSE" \
313
         "  -inf <  1.0: TRUE" \
314
         "  +inf < +inf: FALSE" \
315
         "  -inf < -inf: FALSE" \
316
         "  +inf < -inf: FALSE" \
317
         "  -inf < +inf: TRUE" \
318
         "   1.0 < +NaN: FALSE" \
319
         "  +NaN < +NaN: FALSE" \
320
         "  -NaN < -NaN: FALSE" \
321
         "  +NaN < -NaN: FALSE" \
322
         "  -NaN < +NaN: FALSE" \
323
         "   1.0 * 2^-129 < 1.0 * 2^-129: FALSE" \
324
         "   1.0 * 2^-129 < 1.0 * 2^-128: TRUE" \
325
         "   1.0 * 2^-128 < 1.0 * 2^-129: FALSE" \
326
         "   1.0 * 2^126  < 1.0 * 2^-128: FALSE" \
327
         "   1.0 * 2^-128 < 1.0 * 2^126:  TRUE" \
328
         "lf.sfne.s" \
329
         "   1.0 !=  1.0: FALSE" \
330
         "   1.0 !=  2.0: TRUE" \
331
         "   1.5 !=  1.5: FALSE" \
332
         "   1.5 !=  0.5: TRUE" \
333
         "  -1.5 != -1.5: FALSE" \
334
         "   1.5 != -1.5: TRUE" \
335
         "  +0.0 != +0.0: FALSE" \
336
         "  -0.0 != -0.0: FALSE" \
337
         "  +0.0 != -0.0: FALSE" \
338
         "   1.0 != +inf: TRUE" \
339
         "  +inf != +inf: FALSE" \
340
         "  -inf != -inf: FALSE" \
341
         "  +inf != -inf: TRUE" \
342
         "   1.0 != +NaN: TRUE" \
343
         "  +NaN != +NaN: TRUE" \
344
         "  -NaN != -NaN: TRUE" \
345
         "  +NaN != -NaN: TRUE" \
346
         "   1.0 * 2^-129 != 1.0 * 2^-129: FALSE" \
347
         "   1.0 * 2^-129 != 1.0 * 2^-128: TRUE" \
348
         "   1.0 * 2^126  != 1.0 * 2^-128: TRUE" \
349
         "lf.sub.s" \
350
         "   1.0 -  0.0  =  1.0:  OK" \
351
         "   1.0 - -0.0  =  1.0:  OK" \
352
         "   1.0 -  1.0  = +0.0:  OK" \
353
         "   2.0 -  1.0  =  1.0:  OK" \
354
         "   1.5 -  1.5  = +0.0:  OK" \
355
         "   1.5 -  0.5  =  1.0:  OK" \
356
         "   1.5 -  1.5  =  0.5:  OK" \
357
         "   2.0 - -1.0  =  3.0:  OK" \
358
         "   1.0 - -2.0  =  3.0:  OK" \
359
         "   1.0 - -1.0  =  2.0:  OK" \
360
         "  -1.0 -  2.0  = -3.0:  OK" \
361
         "   1.0 -  2.0  = -1.0:  OK" \
362
         "  -1.0 - -1.0  =  0.0:  OK" \
363
         "   1.0 - +inf  = -inf:  OK" \
364
         "   1.0 - -inf  = +inf:  OK" \
365
         "  +inf - +inf  = -NaN:  OK" \
366
         "  +inf - -inf  = +inf:  OK" \
367
         "  -inf - -inf  = -NaN:  OK" \
368
         "   1.0 - +NaN  = +NaN:  OK" \
369
         "   1.0 - -NaN  = -NaN:  OK" \
370
         "  +NaN - +NaN  = +NaN:  OK" \
371
         "  +NaN - -NaN  = +NaN:  OK" \
372
         "  -NaN - -NaN  = -NaN:  OK" \
373
         "   1.0 - +sNaN = +qNaN: OK" \
374
         "   1.0 - -sNaN = -qNaN: OK" \
375
         "  -1.0 * 2^127 -  1.0 * 2^127  = +inf:  OK" \
376
         "   1.0 * 2^127 - -1.0 * 2^127  = -inf:  OK" \
377
         "Test completed" \
378
         "report(0xdeaddead);" \
379
         "exit(0)"]               \
380 104 jeremybenn
    "fp.cfg" "fp/fp"

powered by: WebSVN 2.1.0

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