hercules-390 / hyperion

Hercules 390
Other
246 stars 69 forks source link

bfp-14 bfp-19 errors #254

Closed ghost closed 6 years ago

ghost commented 6 years ago

running the tests on macOS High Sierra rexx ./tests/runtest.rexx Building test script file 'allTests.testin'... Running Hercules to generate test results... Performing analysis of test results... Variable ptrsize is set to "8". Variable platform is set to "Darwin".

line 20429: Storage at R:0000000000005C10 compare mismatch. DXBR Tr max/min ... Want: 606CFFFF FFFFFFFF FFFFFFFF FFFFFFFF ... Have: 7FFF0DEA D0000000 00000000 00000000 Test bfp-014-divide.tst: DEBR, DEB, DDBR, DDB, DXBR. 644 OK compares. One failure. line 32755: Storage at R:0000000000005C50 compare mismatch. MXBR F Ufl 2 Tr ... Want: 1FFDE1E0 00000000 00000000 00000000 ... Have: 7FFF0DEA D0000000 00000000 00000000 Test bfp-019-multiply.tst: MEEBR, MEEB, MDBR, MDB, MXBR. 728 OK compares. One failure. Done 276 tests. 2 failed; 274 OK.

is it borderline, or is it something to worry about

srorso commented 6 years ago

Hi Enrico,

This is definitely something to worry about. The BFP tests run cleanly on a number of platforms, including FreeBSD (clang) and Solaris (older gcc). Solaris has been my favorite system for finding odd issues in code I have written. Maybe macOS will join Solaris in that respect. And in that respect only.

The failing calculations are 128-bit operations that should generate scaled results because they are trappable. Division of NMax by Nmin creates a huge overflow, and IEEE 754 1985 specifies a scaled result. The multiplication (of two subnormal numbers) creates a trappable overflow and should return a scaled result. In both cases, the generated result is a wierd signalling NaN that is intentionally created by softfloat_scaledResult128 when an unconstrained scaled exponent does not fit in a 128-bit BFP.

IEEE dropped scaled results from the 2008 revision, but IBM had already shipped hardware, so in it stayed. Scaled results are likewise not in Dr. Hauser's SoftFloat-3a. So most likely I have done something wrong in the SoftFloat-3a mods for Hercules. At a minimum I have to look at the deliberate SNaN; 0xDEAD should appear in a single fullword.

SoftFloat-3a issue #9 had similar symptoms.

Thanks for posting!

Best Regards, Steve Orso

srorso commented 6 years ago

This issue is caused by an issue in SoftFloat-3a For Hercules(#10). Because the softfloat.h public header will be changed to address this issue, there will be a commit to Hyperion in addition to a SoftFloat-3a For Hercules commit.