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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [or1ksim/] [testsuite/] [test-code-or1k/] [testfloat/] [testFunction.h] - Blame information for rev 609

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

Line No. Rev Author Line
1 234 jeremybenn
 
2
/*
3
===============================================================================
4
 
5
This C header file is part of TestFloat, Release 2a, a package of programs
6
for testing the correctness of floating-point arithmetic complying to the
7
IEC/IEEE Standard for Floating-Point.
8
 
9
Written by John R. Hauser.  More information is available through the Web
10
page `http://HTTP.CS.Berkeley.EDU/~jhauser/arithmetic/TestFloat.html'.
11
 
12
THIS SOFTWARE IS DISTRIBUTED AS IS, FOR FREE.  Although reasonable effort
13
has been made to avoid it, THIS SOFTWARE MAY CONTAIN FAULTS THAT WILL AT
14
TIMES RESULT IN INCORRECT BEHAVIOR.  USE OF THIS SOFTWARE IS RESTRICTED TO
15
PERSONS AND ORGANIZATIONS WHO CAN AND WILL TAKE FULL RESPONSIBILITY FOR ANY
16
AND ALL LOSSES, COSTS, OR OTHER PROBLEMS ARISING FROM ITS USE.
17
 
18
Derivative works are acceptable, even for commercial purposes, so long as
19
(1) they include prominent notice that the work is derivative, and (2) they
20
include prominent notice akin to these four paragraphs for those parts of
21
this code that are retained.
22
 
23
Modified for use with or1ksim's testsuite.
24
 
25
Contributor Julius Baxter <julius.baxter@orsoc.se>
26
 
27
===============================================================================
28
*/
29
 
30
enum {
31
    INT32_TO_FLOAT32 = 1,
32
    INT32_TO_FLOAT64,
33
    INT32_TO_FLOATX80,
34
    INT32_TO_FLOAT128,
35
    INT64_TO_FLOAT32,
36
    INT64_TO_FLOAT64,
37
    INT64_TO_FLOATX80,
38
    INT64_TO_FLOAT128,
39
    FLOAT32_TO_INT32,
40
    FLOAT32_TO_INT32_ROUND_TO_ZERO,
41
    FLOAT32_TO_INT64,
42
    FLOAT32_TO_INT64_ROUND_TO_ZERO,
43
    FLOAT32_TO_FLOAT64,
44
    FLOAT32_TO_FLOATX80,
45
    FLOAT32_TO_FLOAT128,
46
    FLOAT32_ROUND_TO_INT,
47
    FLOAT32_ADD,
48
    FLOAT32_SUB,
49
    FLOAT32_MUL,
50
    FLOAT32_DIV,
51
    FLOAT32_REM,
52
    FLOAT32_SQRT,
53
    FLOAT32_EQ,
54
    FLOAT32_LE,
55
    FLOAT32_LT,
56
    FLOAT32_EQ_SIGNALING,
57
    FLOAT32_LE_QUIET,
58
    FLOAT32_LT_QUIET,
59
    FLOAT64_TO_INT32,
60
    FLOAT64_TO_INT32_ROUND_TO_ZERO,
61
    FLOAT64_TO_INT64,
62
    FLOAT64_TO_INT64_ROUND_TO_ZERO,
63
    FLOAT64_TO_FLOAT32,
64
    FLOAT64_TO_FLOATX80,
65
    FLOAT64_TO_FLOAT128,
66
    FLOAT64_ROUND_TO_INT,
67
    FLOAT64_ADD,
68
    FLOAT64_SUB,
69
    FLOAT64_MUL,
70
    FLOAT64_DIV,
71
    FLOAT64_REM,
72
    FLOAT64_SQRT,
73
    FLOAT64_EQ,
74
    FLOAT64_LE,
75
    FLOAT64_LT,
76
    FLOAT64_EQ_SIGNALING,
77
    FLOAT64_LE_QUIET,
78
    FLOAT64_LT_QUIET,
79
    FLOATX80_TO_INT32,
80
    FLOATX80_TO_INT32_ROUND_TO_ZERO,
81
    FLOATX80_TO_INT64,
82
    FLOATX80_TO_INT64_ROUND_TO_ZERO,
83
    FLOATX80_TO_FLOAT32,
84
    FLOATX80_TO_FLOAT64,
85
    FLOATX80_TO_FLOAT128,
86
    FLOATX80_ROUND_TO_INT,
87
    FLOATX80_ADD,
88
    FLOATX80_SUB,
89
    FLOATX80_MUL,
90
    FLOATX80_DIV,
91
    FLOATX80_REM,
92
    FLOATX80_SQRT,
93
    FLOATX80_EQ,
94
    FLOATX80_LE,
95
    FLOATX80_LT,
96
    FLOATX80_EQ_SIGNALING,
97
    FLOATX80_LE_QUIET,
98
    FLOATX80_LT_QUIET,
99
    FLOAT128_TO_INT32,
100
    FLOAT128_TO_INT32_ROUND_TO_ZERO,
101
    FLOAT128_TO_INT64,
102
    FLOAT128_TO_INT64_ROUND_TO_ZERO,
103
    FLOAT128_TO_FLOAT32,
104
    FLOAT128_TO_FLOAT64,
105
    FLOAT128_TO_FLOATX80,
106
    FLOAT128_ROUND_TO_INT,
107
    FLOAT128_ADD,
108
    FLOAT128_SUB,
109
    FLOAT128_MUL,
110
    FLOAT128_DIV,
111
    FLOAT128_REM,
112
    FLOAT128_SQRT,
113
    FLOAT128_EQ,
114
    FLOAT128_LE,
115
    FLOAT128_LT,
116
    FLOAT128_EQ_SIGNALING,
117
    FLOAT128_LE_QUIET,
118
    FLOAT128_LT_QUIET,
119
    NUM_FUNCTIONS
120
};
121
 
122
typedef struct {
123
    char *name;
124
    int8 numInputs;
125
    flag roundingPrecision, roundingMode;
126
} functionT;
127
extern const functionT functions[ NUM_FUNCTIONS ];
128
extern const flag functionExists[ NUM_FUNCTIONS ];
129
 
130
enum {
131
    ROUND_NEAREST_EVEN = 1,
132
    ROUND_TO_ZERO,
133
    ROUND_DOWN,
134
    ROUND_UP,
135
    NUM_ROUNDINGMODES
136
};
137
 
138
void testFunction( uint8, int8, int8 );
139
 

powered by: WebSVN 2.1.0

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