On 7 February 2011 10:17, Christophe Lyon <[email protected]> wrote:
> I was also wondering about the float16 case? The ARM ARM describes it
> uses default_nan too, but I couldn't find that right piece of code to patch
> in softfloat. Any idea? It seems to behave a bit differently from other FP
> formats.
Hm. My suggestion is that the bit of code in float32_to_float16() that does:
if (aSig) {
/* Make sure correct exceptions are raised. */
float32ToCommonNaN(a STATUS_VAR);
aSig |= 0x00400000;
}
return packFloat16(aSign, 0x1f, aSig >> 13);
should be brought into line with the other float*_to_float* functions
by having it use a new commonNaNToFloat16() function rather
than hand-coding the conversion.
AFAICT only ARM uses float16, and that only for float16<->float32
conversions, so the softfloat code support for it is limited to only
what was needed for that.
-- PMM