ps2autotests icon indicating copy to clipboard operation
ps2autotests copied to clipboard

CF_MIN_EXP[1] = {0x00000001} is zero actually (ee fpu)

Open gregory38 opened this issue 9 years ago • 3 comments
trafficstars

PS2 doesn't support denormal number so 0x00000001 is interpreted as 0.

If the intent was to get the smallest positive number above 0, it ought to be 0x0080_0000 (ie with a biased exponent of 1).

gregory38 avatar Feb 11 '16 12:02 gregory38

This is intentional. 0x7F800001 (CF_MAX_EXP) is also not a number, it's showing the behavior of non-IEEE floats.

-[Unknown]

unknownbrackets avatar Feb 11 '16 15:02 unknownbrackets

Sure. I'm asking because CF_GARBAGE1 is also a denormal number and therefore zero. In this case, I think a very small number might be useful to test underflow too.

Speaking of non-IEEE compliance. Will it be possible to have a couple of extra test for rounding of mult and sub operation.

Mult: It seem to lost some lsb bits. Maybe we could do a test that loop on mantissa 8 lsb. Something like that

for ( a = 1.0; a < 1.0001; a += smallest mantissa)
    for ( b = 1.0; b < 1.0001; b += smallest mantissa)
          do a * b

Sub: It seems IEEE have extra hidden bit (round, guard, sticky bits). It seems that EE is different. I think some test that do a - b with a close of b could help to highlight the behavior.

gregory38 avatar Feb 11 '16 18:02 gregory38

Sure, I'm not at all against adding more constants.

And yes, we had our fun with mult rounding in PPSSPP too. A dedicated test for this is probably a good idea, and I think we created one in pspautotests too.

Sub sounds like a good idea too.

-[Unknown]

unknownbrackets avatar Feb 12 '16 07:02 unknownbrackets