1 2Known Floating-point Bugs Detected by TestFloat 3 4John R. Hauser 51997 December 15 6 7 8------------------------------------------------------------------------------- 9Introduction 10 11Several popular systems have bugs that TestFloat is very likely to run 12across. The ones I know of are documented here. First off, TestFloat finds 13no errors in the following processors/machines: 14 15 AMD 486 DX4's 16 Sun UltraSPARC 1's and 2's 17 18On the other hand, bugs are found in these processors/machines: 19 20 Older Intel Pentiums (with the divide bug) 21 Intel Pentium Pros 22 Sun SPARCstation 1's and IPX's 23 Sun SPARCstation 10's 24 HP Precision Architecture processors, with HP-UX prior to version 10.10 25 26For some reason, most of the bugs found involve conversions from floating- 27point to integer formats. 28 29The bugs are shown as actual TestFloat error lines, along with a brief 30explanation. The error lines given are not necesarily exhaustive and were 31not necessarily output in the order shown. 32 33This document does not pretend to be an authoritative bug listing for all 34commercial processors. The vast majority of processors are absent from this 35list because I have never run TestFloat on such machines and I thus have no 36knowledge of what bugs TestFloat might find in them. 37 38The latest version of this file can be found at the Web page `http:// 39http.cs.berkeley.edu/~jhauser/arithmetic/testfloat.html'. 40 41 42------------------------------------------------------------------------------- 43Older Intel Pentiums (with the divide bug) 44 45The following conversion problems are found on Pentiums that also suffer 46from the infamous floating-point divide bug. These bugs have been fixed on 47newer Pentiums. (TestFloat does not find the divide bug.) 48 49- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 50floatx80_to_int32 51 52-- A few small fractions are treated as though they were zero. 53 54 Errors found in floatx80_to_int32, rounding nearest_even: 55 3FFB.8000000000000000 soft: 00000000 ....x syst: 00000000 ..... 56 3FFC.8000000000000000 soft: 00000000 ....x syst: 00000000 ..... 57 3FFC.C000000000000000 soft: 00000000 ....x syst: 00000000 ..... 58 BFFB.8000000000000000 soft: 00000000 ....x syst: 00000000 ..... 59 BFFC.8000000000000000 soft: 00000000 ....x syst: 00000000 ..... 60 Errors found in floatx80_to_int32, rounding to_zero: 61 3FFB.8000000000000000 soft: 00000000 ....x syst: 00000000 ..... 62 3FFC.8000000000000000 soft: 00000000 ....x syst: 00000000 ..... 63 3FFC.C000000000000000 soft: 00000000 ....x syst: 00000000 ..... 64 BFFB.8000000000000000 soft: 00000000 ....x syst: 00000000 ..... 65 BFFC.8000000000000000 soft: 00000000 ....x syst: 00000000 ..... 66 BFFC.C000000000000000 soft: 00000000 ....x syst: 00000000 ..... 67 Errors found in floatx80_to_int32, rounding down: 68 3FFB.8000000000000000 soft: 00000000 ....x syst: 00000000 ..... 69 3FFC.8000000000000000 soft: 00000000 ....x syst: 00000000 ..... 70 3FFC.C000000000000000 soft: 00000000 ....x syst: 00000000 ..... 71 BFFB.8000000000000000 soft: FFFFFFFF ....x syst: 00000000 ..... 72 BFFC.8000000000000000 soft: FFFFFFFF ....x syst: 00000000 ..... 73 BFFC.C000000000000000 soft: FFFFFFFF ....x syst: 00000000 ..... 74 Errors found in floatx80_to_int32, rounding up: 75 3FFB.8000000000000000 soft: 00000001 ....x syst: 00000000 ..... 76 3FFC.8000000000000000 soft: 00000001 ....x syst: 00000000 ..... 77 3FFC.C000000000000000 soft: 00000001 ....x syst: 00000000 ..... 78 BFFB.8000000000000000 soft: 00000000 ....x syst: 00000000 ..... 79 BFFC.8000000000000000 soft: 00000000 ....x syst: 00000000 ..... 80 81 3FFB.8000000000000000 is the fraction 1/16; 3FFC.8000000000000000 is 1/8; 82 and 3FFC.C000000000000000 is 3/16. Both positive and negative inputs are 83 affected. 84 85-- Some (all?) positive floating-point values between 2^32 - 1/2 86 (401E.FFFFFFFF00000000) and 2^32 (401F.0000000000000000) are rounded to 87 zero when the rounding mode is nearest/even or up. 88 89 Errors found in floatx80_to_int32, rounding nearest_even: 90 401E.FFFFFFFF80000000 soft: 7FFFFFFF v.... syst: 00000000 ....x 91 401E.FFFFFFFFC00001FE soft: 7FFFFFFF v.... syst: 00000000 ....x 92 401E.FFFFFFFFF8000000 soft: 7FFFFFFF v.... syst: 00000000 ....x 93 401E.FFFFFFFFFEC00000 soft: 7FFFFFFF v.... syst: 00000000 ....x 94 401E.FFFFFFFFFF002000 soft: 7FFFFFFF v.... syst: 00000000 ....x 95 401E.FFFFFFFFFFC00000 soft: 7FFFFFFF v.... syst: 00000000 ....x 96 401E.FFFFFFFFFFE00000 soft: 7FFFFFFF v.... syst: 00000000 ....x 97 401E.FFFFFFFFFFFD7FFE soft: 7FFFFFFF v.... syst: 00000000 ....x 98 401E.FFFFFFFFFFFFFFFE soft: 7FFFFFFF v.... syst: 00000000 ....x 99 401E.FFFFFFFFFFFFFFFF soft: 7FFFFFFF v.... syst: 00000000 ....x 100 Errors found in floatx80_to_int32, rounding up: 101 401E.FFFFFFFF00800000 soft: 7FFFFFFF v.... syst: 00000000 ....x 102 401E.FFFFFFFF80000000 soft: 7FFFFFFF v.... syst: 00000000 ....x 103 401E.FFFFFFFFEFFFC000 soft: 7FFFFFFF v.... syst: 00000000 ....x 104 401E.FFFFFFFFFC000000 soft: 7FFFFFFF v.... syst: 00000000 ....x 105 401E.FFFFFFFFFE7FFFFF soft: 7FFFFFFF v.... syst: 00000000 ....x 106 401E.FFFFFFFFFFF00000 soft: 7FFFFFFF v.... syst: 00000000 ....x 107 401E.FFFFFFFFFFFE0800 soft: 7FFFFFFF v.... syst: 00000000 ....x 108 401E.FFFFFFFFFFFF7FFB soft: 7FFFFFFF v.... syst: 00000000 ....x 109 401E.FFFFFFFFFFFFFFFE soft: 7FFFFFFF v.... syst: 00000000 ....x 110 401E.FFFFFFFFFFFFFFFF soft: 7FFFFFFF v.... syst: 00000000 ....x 111 112- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 113 114 115------------------------------------------------------------------------------- 116Intel Pentium Pros 117 118- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 119floatx80_to_int32 120 121-- The inexact flag is sometimes raised instead of the invalid flag for 122 floating-point inputs under -(2^32) (C01F.0000000000000000). This bug is 123 sporadic. It appears to be deterministic but dependent on the sequence 124 of operations executed. 125 126 Errors found in floatx80_to_int32, rounding nearest_even: 127 C01F.C000000000000002 soft: 80000000 v.... syst: 80000000 ....x 128 C021.F00000000000003F soft: 80000000 v.... syst: 80000000 ....x 129 Errors found in floatx80_to_int32, rounding to_zero: 130 C021.F00000000000003F soft: 80000000 v.... syst: 80000000 ....x 131 Errors found in floatx80_to_int32, rounding up: 132 C01F.C000000000000007 soft: 80000000 v.... syst: 80000000 ....x 133 C01F.C000000000001000 soft: 80000000 v.... syst: 80000000 ....x 134 135- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 136 137 138------------------------------------------------------------------------------- 139Sun SPARCstation 1's and IPX's 140 141Some older SPARCstations appear confused about whether underflow tininess is 142detected before or after rounding. For conversions from double precision 143to single precision, tininess is detected after rounding, while for all 144quadruple-precision operations it is detected before rounding. Single- and 145double-precision multipies go both ways: 146 147- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 148float32_mul, float64_mul 149 150-- For multiplies, underflow tininess is detected _before_ rounding if one 151 of the inputs is subnormal, and _after_ rounding otherwise. If tininess 152 is assumed to be detected before rounding, the following errors are 153 generated: 154 155 Errors found in float32_mul, rounding nearest_even: 156 001.000001 07E.7FFFFE soft: 001.000000 ...ux syst: 001.000000 ....x 157 001.000001 87E.7FFFFE soft: 801.000000 ...ux syst: 801.000000 ....x 158 001.000002 07E.7FFFFC soft: 001.000000 ...ux syst: 001.000000 ....x 159 001.000002 87E.7FFFFC soft: 801.000000 ...ux syst: 801.000000 ....x 160 001.000004 07E.7FFFF8 soft: 001.000000 ...ux syst: 001.000000 ....x 161 Errors found in float32_mul, rounding down: 162 001.000001 87E.7FFFFE soft: 801.000000 ...ux syst: 801.000000 ....x 163 001.000002 87E.7FFFFC soft: 801.000000 ...ux syst: 801.000000 ....x 164 001.000004 87E.7FFFF8 soft: 801.000000 ...ux syst: 801.000000 ....x 165 001.000008 87E.7FFFF0 soft: 801.000000 ...ux syst: 801.000000 ....x 166 001.000010 87E.7FFFE0 soft: 801.000000 ...ux syst: 801.000000 ....x 167 Errors found in float32_mul, rounding up: 168 001.000001 07E.7FFFFE soft: 001.000000 ...ux syst: 001.000000 ....x 169 001.000002 07E.7FFFFC soft: 001.000000 ...ux syst: 001.000000 ....x 170 001.000004 07E.7FFFF8 soft: 001.000000 ...ux syst: 001.000000 ....x 171 001.000008 07E.7FFFF0 soft: 001.000000 ...ux syst: 001.000000 ....x 172 001.000010 07E.7FFFE0 soft: 001.000000 ...ux syst: 001.000000 ....x 173 Errors found in float64_mul, rounding nearest_even: 174 001.0000000000001 3FE.FFFFFFFFFFFFE 175 soft: 001.0000000000000 ...ux syst: 001.0000000000000 ....x 176 001.0000000000001 BFE.FFFFFFFFFFFFE 177 soft: 801.0000000000000 ...ux syst: 801.0000000000000 ....x 178 001.0000000000002 3FE.FFFFFFFFFFFFC 179 soft: 001.0000000000000 ...ux syst: 001.0000000000000 ....x 180 001.0000000000002 BFE.FFFFFFFFFFFFC 181 soft: 801.0000000000000 ...ux syst: 801.0000000000000 ....x 182 001.0000000000004 3FE.FFFFFFFFFFFF8 183 soft: 001.0000000000000 ...ux syst: 001.0000000000000 ....x 184 Errors found in float64_mul, rounding down: 185 001.0000000000001 BFE.FFFFFFFFFFFFE 186 soft: 801.0000000000000 ...ux syst: 801.0000000000000 ....x 187 001.0000000000002 BFE.FFFFFFFFFFFFC 188 soft: 801.0000000000000 ...ux syst: 801.0000000000000 ....x 189 001.0000000000004 BFE.FFFFFFFFFFFF8 190 soft: 801.0000000000000 ...ux syst: 801.0000000000000 ....x 191 001.0000000000008 BFE.FFFFFFFFFFFF0 192 soft: 801.0000000000000 ...ux syst: 801.0000000000000 ....x 193 001.0000000000010 BFE.FFFFFFFFFFFE0 194 soft: 801.0000000000000 ...ux syst: 801.0000000000000 ....x 195 Errors found in float64_mul, rounding up: 196 001.0000000000001 3FE.FFFFFFFFFFFFE 197 soft: 001.0000000000000 ...ux syst: 001.0000000000000 ....x 198 001.0000000000002 3FE.FFFFFFFFFFFFC 199 soft: 001.0000000000000 ...ux syst: 001.0000000000000 ....x 200 001.0000000000004 3FE.FFFFFFFFFFFF8 201 soft: 001.0000000000000 ...ux syst: 001.0000000000000 ....x 202 001.0000000000008 3FE.FFFFFFFFFFFF0 203 soft: 001.0000000000000 ...ux syst: 001.0000000000000 ....x 204 001.0000000000010 3FE.FFFFFFFFFFFE0 205 soft: 001.0000000000000 ...ux syst: 001.0000000000000 ....x 206 207 If we assume tininess should be detected after rounding, we get the 208 following errors: 209 210 Errors found in float32_mul, rounding nearest_even: 211 000.7FFC00 07F.000400 soft: 001.000000 ....x syst: 001.000000 ...ux 212 000.7FFC00 87F.000400 soft: 801.000000 ....x syst: 801.000000 ...ux 213 000.7FFE00 07F.000200 soft: 001.000000 ....x syst: 001.000000 ...ux 214 000.7FFE00 87F.000200 soft: 801.000000 ....x syst: 801.000000 ...ux 215 000.7FFF00 07F.000100 soft: 001.000000 ....x syst: 001.000000 ...ux 216 Errors found in float32_mul, rounding down: 217 000.7FFC00 87F.000400 soft: 801.000000 ....x syst: 801.000000 ...ux 218 000.7FFE00 87F.000200 soft: 801.000000 ....x syst: 801.000000 ...ux 219 000.7FFF00 87F.000100 soft: 801.000000 ....x syst: 801.000000 ...ux 220 000.7FFF80 87F.000080 soft: 801.000000 ....x syst: 801.000000 ...ux 221 000.7FFFC0 87F.000040 soft: 801.000000 ....x syst: 801.000000 ...ux 222 Errors found in float32_mul, rounding up: 223 000.7FFC00 07F.000400 soft: 001.000000 ....x syst: 001.000000 ...ux 224 000.7FFE00 07F.000200 soft: 001.000000 ....x syst: 001.000000 ...ux 225 000.7FFF00 07F.000100 soft: 001.000000 ....x syst: 001.000000 ...ux 226 000.7FFF80 07F.000080 soft: 001.000000 ....x syst: 001.000000 ...ux 227 000.7FFFC0 07F.000040 soft: 001.000000 ....x syst: 001.000000 ...ux 228 Errors found in float64_mul, rounding nearest_even: 229 000.FFFFFFE000000 3FF.0000002000000 230 soft: 001.0000000000000 ....x syst: 001.0000000000000 ...ux 231 000.FFFFFFE000000 BFF.0000002000000 232 soft: 801.0000000000000 ....x syst: 801.0000000000000 ...ux 233 000.FFFFFFF000000 3FF.0000001000000 234 soft: 001.0000000000000 ....x syst: 001.0000000000000 ...ux 235 000.FFFFFFF000000 BFF.0000001000000 236 soft: 801.0000000000000 ....x syst: 801.0000000000000 ...ux 237 000.FFFFFFF800000 3FF.0000000800000 238 soft: 001.0000000000000 ....x syst: 001.0000000000000 ...ux 239 Errors found in float64_mul, rounding down: 240 000.FFFFFFE000000 BFF.0000002000000 241 soft: 801.0000000000000 ....x syst: 801.0000000000000 ...ux 242 000.FFFFFFF000000 BFF.0000001000000 243 soft: 801.0000000000000 ....x syst: 801.0000000000000 ...ux 244 000.FFFFFFF800000 BFF.0000000800000 245 soft: 801.0000000000000 ....x syst: 801.0000000000000 ...ux 246 000.FFFFFFFC00000 BFF.0000000400000 247 soft: 801.0000000000000 ....x syst: 801.0000000000000 ...ux 248 000.FFFFFFFE00000 BFF.0000000200000 249 soft: 801.0000000000000 ....x syst: 801.0000000000000 ...ux 250 Errors found in float64_mul, rounding up: 251 000.FFFFFFE000000 3FF.0000002000000 252 soft: 001.0000000000000 ....x syst: 001.0000000000000 ...ux 253 000.FFFFFFF000000 3FF.0000001000000 254 soft: 001.0000000000000 ....x syst: 001.0000000000000 ...ux 255 000.FFFFFFF800000 3FF.0000000800000 256 soft: 001.0000000000000 ....x syst: 001.0000000000000 ...ux 257 000.FFFFFFFC00000 3FF.0000000400000 258 soft: 001.0000000000000 ....x syst: 001.0000000000000 ...ux 259 000.FFFFFFFE00000 3FF.0000000200000 260 soft: 001.0000000000000 ....x syst: 001.0000000000000 ...ux 261 262- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 263 264 265------------------------------------------------------------------------------- 266Sun SPARCstation 10's 267 268Like other SPARCstations, some SPARCstation 10's are inconsistent regarding 269underflow tininess, detecting it after rounding for single- and double- 270precision operations and before rounding for quadruple-precision operations. 271The following bug has also been observed. 272 273- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 274float32_to_int32_round_to_zero, float64_to_int32_round_to_zero 275 276-- Single- and double-precision NaNs are converted to the integer zero. 277 (The invalid exception flag is raised correctly.) 278 279 Errors found in float32_to_int32_round_to_zero: 280 8FF.5D36AC soft: 7FFFFFFF v.... syst: 00000000 v.... 281 0FF.7FFFC0 soft: 7FFFFFFF v.... syst: 00000000 v.... 282 8FF.7C0000 soft: 7FFFFFFF v.... syst: 00000000 v.... 283 0FF.2AB7ED soft: 7FFFFFFF v.... syst: 00000000 v.... 284 0FF.03FFFF soft: 7FFFFFFF v.... syst: 00000000 v.... 285 Errors found in float64_to_int32_round_to_zero: 286 7FF.45AD84DB2524A soft: 7FFFFFFF v.... syst: 00000000 v.... 287 7FF.CFEE063EE0512 soft: 7FFFFFFF v.... syst: 00000000 v.... 288 7FF.89FF03AB7DBA2 soft: 7FFFFFFF v.... syst: 00000000 v.... 289 7FF.FFFFFFFFFF800 soft: 7FFFFFFF v.... syst: 00000000 v.... 290 FFF.68A6410E91BF6 soft: 7FFFFFFF v.... syst: 00000000 v.... 291 292- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 293 294 295------------------------------------------------------------------------------- 296HP Precision Architecture processors, with HP-UX prior to version 10.10 297 298- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 299float32_to_int32_round_to_zero, float64_to_int32_round_to_zero 300 301-- When the floating-point value is too large, the overflow and inexact 302 exception flags are raised instead of the invalid flag. 303 304 Errors found in float32_to_int32_round_to_zero: 305 89E.000007 soft: 80000000 v.... syst: 80000000 ..o.x 306 0A2.000020 soft: 7FFFFFFF v.... syst: 7FFFFFFF ..o.x 307 8FA.7C0000 soft: 80000000 v.... syst: 80000000 ..o.x 308 Errors found in float64_to_int32_round_to_zero: 309 7FD.0448700002F1C soft: 7FFFFFFF v.... syst: 7FFFFFFF ..o.x 310 DAA.F000000000000 soft: 80000000 v.... syst: 80000000 ..o.x 311 41E.063DA00005E65 soft: 7FFFFFFF v.... syst: 7FFFFFFF ..o.x 312 47E.FFFF800000000 soft: 7FFFFFFF v.... syst: 7FFFFFFF ..o.x 313 51F.0000000000004 soft: 7FFFFFFF v.... syst: 7FFFFFFF ..o.x 314 DDA.0000001FFFFFF soft: 80000000 v.... syst: 80000000 ..o.x 315 D70.00000000003FF soft: 80000000 v.... syst: 80000000 ..o.x 316 C7E.0000100000000 soft: 80000000 v.... syst: 80000000 ..o.x 317 47E.000000000007F soft: 7FFFFFFF v.... syst: 7FFFFFFF ..o.x 318 D57.000000000FFFF soft: 80000000 v.... syst: 80000000 ..o.x 319 320 321- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 322 323 324