1 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 =============================================================================== 24 */ 25 26 /* $FreeBSD$ */ 27 28 #include "softfloat.h" 29 #include "milieu.h" 30 31 /* 32 ------------------------------------------------------------------------------- 33 The following macros are defined to indicate that the corresponding 34 functions exist. 35 ------------------------------------------------------------------------------- 36 */ 37 #define SYST_INT32_TO_FLOAT32 38 #define SYST_INT32_TO_FLOAT64 39 #define SYST_INT32_TO_FLOAT128 40 #define SYST_INT64_TO_FLOAT32 41 #define SYST_INT64_TO_FLOAT64 42 #define SYST_INT64_TO_FLOAT128 43 #define SYST_FLOAT32_TO_INT32_ROUND_TO_ZERO 44 #define SYST_FLOAT32_TO_INT64_ROUND_TO_ZERO 45 #define SYST_FLOAT32_TO_FLOAT64 46 #define SYST_FLOAT32_TO_FLOAT128 47 #define SYST_FLOAT32_ADD 48 #define SYST_FLOAT32_SUB 49 #define SYST_FLOAT32_MUL 50 #define SYST_FLOAT32_DIV 51 #define SYST_FLOAT32_SQRT 52 #define SYST_FLOAT32_EQ 53 #define SYST_FLOAT32_LE 54 #define SYST_FLOAT32_LT 55 #define SYST_FLOAT32_EQ_SIGNALING 56 #define SYST_FLOAT32_LE_QUIET 57 #define SYST_FLOAT32_LT_QUIET 58 #define SYST_FLOAT64_TO_INT32_ROUND_TO_ZERO 59 #define SYST_FLOAT64_TO_INT64_ROUND_TO_ZERO 60 #define SYST_FLOAT64_TO_FLOAT32 61 #define SYST_FLOAT64_TO_FLOAT128 62 #define SYST_FLOAT64_ADD 63 #define SYST_FLOAT64_SUB 64 #define SYST_FLOAT64_MUL 65 #define SYST_FLOAT64_DIV 66 #define SYST_FLOAT64_SQRT 67 #define SYST_FLOAT64_EQ 68 #define SYST_FLOAT64_LE 69 #define SYST_FLOAT64_LT 70 #define SYST_FLOAT64_EQ_SIGNALING 71 #define SYST_FLOAT64_LE_QUIET 72 #define SYST_FLOAT64_LT_QUIET 73 #define SYST_FLOAT128_TO_INT32_ROUND_TO_ZERO 74 #define SYST_FLOAT128_TO_INT64_ROUND_TO_ZERO 75 #define SYST_FLOAT128_TO_FLOAT32 76 #define SYST_FLOAT128_TO_FLOAT64 77 #define SYST_FLOAT128_ADD 78 #define SYST_FLOAT128_SUB 79 #define SYST_FLOAT128_MUL 80 #define SYST_FLOAT128_DIV 81 #define SYST_FLOAT128_SQRT 82 #define SYST_FLOAT128_EQ 83 #define SYST_FLOAT128_LE 84 #define SYST_FLOAT128_LT 85 #define SYST_FLOAT128_EQ_SIGNALING 86 #define SYST_FLOAT128_LE_QUIET 87 #define SYST_FLOAT128_LT_QUIET 88 89 /* 90 ------------------------------------------------------------------------------- 91 System function declarations. (Some of these functions may not exist.) 92 ------------------------------------------------------------------------------- 93 */ 94 float32 syst_int32_to_float32( int32 ); 95 float64 syst_int32_to_float64( int32 ); 96 #ifdef FLOATX80 97 floatx80 syst_int32_to_floatx80( int32 ); 98 #endif 99 #ifdef FLOAT128 100 float128 syst_int32_to_float128( int32 ); 101 #endif 102 #ifdef BITS64 103 float32 syst_int64_to_float32( int64 ); 104 float64 syst_int64_to_float64( int64 ); 105 #ifdef FLOATX80 106 floatx80 syst_int64_to_floatx80( int64 ); 107 #endif 108 #ifdef FLOAT128 109 float128 syst_int64_to_float128( int64 ); 110 #endif 111 #endif 112 int32 syst_float32_to_int32( float32 ); 113 int32 syst_float32_to_int32_round_to_zero( float32 ); 114 #ifdef BITS64 115 int64 syst_float32_to_int64( float32 ); 116 int64 syst_float32_to_int64_round_to_zero( float32 ); 117 #endif 118 float64 syst_float32_to_float64( float32 ); 119 #ifdef FLOATX80 120 floatx80 syst_float32_to_floatx80( float32 ); 121 #endif 122 #ifdef FLOAT128 123 float128 syst_float32_to_float128( float32 ); 124 #endif 125 float32 syst_float32_round_to_int( float32 ); 126 float32 syst_float32_add( float32, float32 ); 127 float32 syst_float32_sub( float32, float32 ); 128 float32 syst_float32_mul( float32, float32 ); 129 float32 syst_float32_div( float32, float32 ); 130 float32 syst_float32_rem( float32, float32 ); 131 float32 syst_float32_sqrt( float32 ); 132 flag syst_float32_eq( float32, float32 ); 133 flag syst_float32_le( float32, float32 ); 134 flag syst_float32_lt( float32, float32 ); 135 flag syst_float32_eq_signaling( float32, float32 ); 136 flag syst_float32_le_quiet( float32, float32 ); 137 flag syst_float32_lt_quiet( float32, float32 ); 138 int32 syst_float64_to_int32( float64 ); 139 int32 syst_float64_to_int32_round_to_zero( float64 ); 140 #ifdef BITS64 141 int64 syst_float64_to_int64( float64 ); 142 int64 syst_float64_to_int64_round_to_zero( float64 ); 143 #endif 144 float32 syst_float64_to_float32( float64 ); 145 #ifdef FLOATX80 146 floatx80 syst_float64_to_floatx80( float64 ); 147 #endif 148 #ifdef FLOAT128 149 float128 syst_float64_to_float128( float64 ); 150 #endif 151 float64 syst_float64_round_to_int( float64 ); 152 float64 syst_float64_add( float64, float64 ); 153 float64 syst_float64_sub( float64, float64 ); 154 float64 syst_float64_mul( float64, float64 ); 155 float64 syst_float64_div( float64, float64 ); 156 float64 syst_float64_rem( float64, float64 ); 157 float64 syst_float64_sqrt( float64 ); 158 flag syst_float64_eq( float64, float64 ); 159 flag syst_float64_le( float64, float64 ); 160 flag syst_float64_lt( float64, float64 ); 161 flag syst_float64_eq_signaling( float64, float64 ); 162 flag syst_float64_le_quiet( float64, float64 ); 163 flag syst_float64_lt_quiet( float64, float64 ); 164 #ifdef FLOATX80 165 int32 syst_floatx80_to_int32( floatx80 ); 166 int32 syst_floatx80_to_int32_round_to_zero( floatx80 ); 167 #ifdef BITS64 168 int64 syst_floatx80_to_int64( floatx80 ); 169 int64 syst_floatx80_to_int64_round_to_zero( floatx80 ); 170 #endif 171 float32 syst_floatx80_to_float32( floatx80 ); 172 float64 syst_floatx80_to_float64( floatx80 ); 173 #ifdef FLOAT128 174 float128 syst_floatx80_to_float128( floatx80 ); 175 #endif 176 floatx80 syst_floatx80_round_to_int( floatx80 ); 177 floatx80 syst_floatx80_add( floatx80, floatx80 ); 178 floatx80 syst_floatx80_sub( floatx80, floatx80 ); 179 floatx80 syst_floatx80_mul( floatx80, floatx80 ); 180 floatx80 syst_floatx80_div( floatx80, floatx80 ); 181 floatx80 syst_floatx80_rem( floatx80, floatx80 ); 182 floatx80 syst_floatx80_sqrt( floatx80 ); 183 flag syst_floatx80_eq( floatx80, floatx80 ); 184 flag syst_floatx80_le( floatx80, floatx80 ); 185 flag syst_floatx80_lt( floatx80, floatx80 ); 186 flag syst_floatx80_eq_signaling( floatx80, floatx80 ); 187 flag syst_floatx80_le_quiet( floatx80, floatx80 ); 188 flag syst_floatx80_lt_quiet( floatx80, floatx80 ); 189 #endif 190 #ifdef FLOAT128 191 int32 syst_float128_to_int32( float128 ); 192 int32 syst_float128_to_int32_round_to_zero( float128 ); 193 #ifdef BITS64 194 int64 syst_float128_to_int64( float128 ); 195 int64 syst_float128_to_int64_round_to_zero( float128 ); 196 #endif 197 float32 syst_float128_to_float32( float128 ); 198 float64 syst_float128_to_float64( float128 ); 199 #ifdef FLOATX80 200 floatx80 syst_float128_to_floatx80( float128 ); 201 #endif 202 float128 syst_float128_round_to_int( float128 ); 203 float128 syst_float128_add( float128, float128 ); 204 float128 syst_float128_sub( float128, float128 ); 205 float128 syst_float128_mul( float128, float128 ); 206 float128 syst_float128_div( float128, float128 ); 207 float128 syst_float128_rem( float128, float128 ); 208 float128 syst_float128_sqrt( float128 ); 209 flag syst_float128_eq( float128, float128 ); 210 flag syst_float128_le( float128, float128 ); 211 flag syst_float128_lt( float128, float128 ); 212 flag syst_float128_eq_signaling( float128, float128 ); 213 flag syst_float128_le_quiet( float128, float128 ); 214 flag syst_float128_lt_quiet( float128, float128 ); 215 #endif 216 217