1
2/*
3===============================================================================
4
5This C header file is part of TestFloat, Release 2a, a package of programs
6for testing the correctness of floating-point arithmetic complying to the
7IEC/IEEE Standard for Floating-Point.
8
9Written by John R. Hauser.  More information is available through the Web
10page `http://HTTP.CS.Berkeley.EDU/~jhauser/arithmetic/TestFloat.html'.
11
12THIS SOFTWARE IS DISTRIBUTED AS IS, FOR FREE.  Although reasonable effort
13has been made to avoid it, THIS SOFTWARE MAY CONTAIN FAULTS THAT WILL AT
14TIMES RESULT IN INCORRECT BEHAVIOR.  USE OF THIS SOFTWARE IS RESTRICTED TO
15PERSONS AND ORGANIZATIONS WHO CAN AND WILL TAKE FULL RESPONSIBILITY FOR ANY
16AND ALL LOSSES, COSTS, OR OTHER PROBLEMS ARISING FROM ITS USE.
17
18Derivative works are acceptable, even for commercial purposes, so long as
19(1) they include prominent notice that the work is derivative, and (2) they
20include prominent notice akin to these four paragraphs for those parts of
21this code that are retained.
22
23===============================================================================
24*/
25
26extern int8 slow_float_rounding_mode;
27extern int8 slow_float_exception_flags;
28extern int8 slow_float_detect_tininess;
29#ifdef FLOATX80
30extern int8 slow_floatx80_rounding_precision;
31#endif
32
33float32 slow_int32_to_float32( int32 );
34float64 slow_int32_to_float64( int32 );
35#ifdef FLOATX80
36floatx80 slow_int32_to_floatx80( int32 );
37#endif
38#ifdef FLOAT128
39float128 slow_int32_to_float128( int32 );
40#endif
41#ifdef BITS64
42float32 slow_int64_to_float32( int64 );
43float64 slow_int64_to_float64( int64 );
44#ifdef FLOATX80
45floatx80 slow_int64_to_floatx80( int64 );
46#endif
47#ifdef FLOAT128
48float128 slow_int64_to_float128( int64 );
49#endif
50#endif
51
52int32 slow_float32_to_int32( float32 );
53int32 slow_float32_to_int32_round_to_zero( float32 );
54#ifdef BITS64
55int64 slow_float32_to_int64( float32 );
56int64 slow_float32_to_int64_round_to_zero( float32 );
57#endif
58float64 slow_float32_to_float64( float32 );
59#ifdef FLOATX80
60floatx80 slow_float32_to_floatx80( float32 );
61#endif
62#ifdef FLOAT128
63float128 slow_float32_to_float128( float32 );
64#endif
65
66float32 slow_float32_round_to_int( float32 );
67float32 slow_float32_add( float32, float32 );
68float32 slow_float32_sub( float32, float32 );
69float32 slow_float32_mul( float32, float32 );
70float32 slow_float32_div( float32, float32 );
71float32 slow_float32_rem( float32, float32 );
72float32 slow_float32_sqrt( float32 );
73flag slow_float32_eq( float32, float32 );
74flag slow_float32_le( float32, float32 );
75flag slow_float32_lt( float32, float32 );
76flag slow_float32_eq_signaling( float32, float32 );
77flag slow_float32_le_quiet( float32, float32 );
78flag slow_float32_lt_quiet( float32, float32 );
79
80int32 slow_float64_to_int32( float64 );
81int32 slow_float64_to_int32_round_to_zero( float64 );
82#ifdef BITS64
83int64 slow_float64_to_int64( float64 );
84int64 slow_float64_to_int64_round_to_zero( float64 );
85#endif
86float32 slow_float64_to_float32( float64 );
87#ifdef FLOATX80
88floatx80 slow_float64_to_floatx80( float64 );
89#endif
90#ifdef FLOAT128
91float128 slow_float64_to_float128( float64 );
92#endif
93
94float64 slow_float64_round_to_int( float64 );
95float64 slow_float64_add( float64, float64 );
96float64 slow_float64_sub( float64, float64 );
97float64 slow_float64_mul( float64, float64 );
98float64 slow_float64_div( float64, float64 );
99float64 slow_float64_rem( float64, float64 );
100float64 slow_float64_sqrt( float64 );
101flag slow_float64_eq( float64, float64 );
102flag slow_float64_le( float64, float64 );
103flag slow_float64_lt( float64, float64 );
104flag slow_float64_eq_signaling( float64, float64 );
105flag slow_float64_le_quiet( float64, float64 );
106flag slow_float64_lt_quiet( float64, float64 );
107
108#ifdef FLOATX80
109
110int32 slow_floatx80_to_int32( floatx80 );
111int32 slow_floatx80_to_int32_round_to_zero( floatx80 );
112#ifdef BITS64
113int64 slow_floatx80_to_int64( floatx80 );
114int64 slow_floatx80_to_int64_round_to_zero( floatx80 );
115#endif
116float32 slow_floatx80_to_float32( floatx80 );
117float64 slow_floatx80_to_float64( floatx80 );
118#ifdef FLOAT128
119float128 slow_floatx80_to_float128( floatx80 );
120#endif
121
122floatx80 slow_floatx80_round_to_int( floatx80 );
123floatx80 slow_floatx80_add( floatx80, floatx80 );
124floatx80 slow_floatx80_sub( floatx80, floatx80 );
125floatx80 slow_floatx80_mul( floatx80, floatx80 );
126floatx80 slow_floatx80_div( floatx80, floatx80 );
127floatx80 slow_floatx80_rem( floatx80, floatx80 );
128floatx80 slow_floatx80_sqrt( floatx80 );
129flag slow_floatx80_eq( floatx80, floatx80 );
130flag slow_floatx80_le( floatx80, floatx80 );
131flag slow_floatx80_lt( floatx80, floatx80 );
132flag slow_floatx80_eq_signaling( floatx80, floatx80 );
133flag slow_floatx80_le_quiet( floatx80, floatx80 );
134flag slow_floatx80_lt_quiet( floatx80, floatx80 );
135
136#endif
137
138#ifdef FLOAT128
139
140int32 slow_float128_to_int32( float128 );
141int32 slow_float128_to_int32_round_to_zero( float128 );
142#ifdef BITS64
143int64 slow_float128_to_int64( float128 );
144int64 slow_float128_to_int64_round_to_zero( float128 );
145#endif
146float32 slow_float128_to_float32( float128 );
147float64 slow_float128_to_float64( float128 );
148#ifdef FLOATX80
149floatx80 slow_float128_to_floatx80( float128 );
150#endif
151
152float128 slow_float128_round_to_int( float128 );
153float128 slow_float128_add( float128, float128 );
154float128 slow_float128_sub( float128, float128 );
155float128 slow_float128_mul( float128, float128 );
156float128 slow_float128_div( float128, float128 );
157float128 slow_float128_rem( float128, float128 );
158float128 slow_float128_sqrt( float128 );
159flag slow_float128_eq( float128, float128 );
160flag slow_float128_le( float128, float128 );
161flag slow_float128_lt( float128, float128 );
162flag slow_float128_eq_signaling( float128, float128 );
163flag slow_float128_le_quiet( float128, float128 );
164flag slow_float128_lt_quiet( float128, float128 );
165
166#endif
167
168