Closed jerryz123 closed 2 months ago
I'm using resizeRawFloat
to upconvert sub-F64 values such that I can use the same F64 RecFNToIN to do IEEE fp-to-int conversions.
The problem I'm seeing is that the conversion of a rawFN to a recFN expressed here: https://github.com/ucb-bar/berkeley-hardfloat/blob/26f00d00c3f3f57480065e02bfcfde3d3b41ec51/hardfloat/src/main/scala/recFNFromFN.scala#L47-L51 does not construct a correct recFN representation of a infinity or NaN when the input rawFloat is resized up (the high non-sign bits of the exponent are not 11
).
Perhaps this expression is not intended to work with resized rawFNs?
Yeah, that expression is only valid in its context; it is (legitimately) making assumptions about what rawFloatFromFN
might return.
The
sAdjustedSexp
calculation does not correctly represent the sExp field when the input is NaN or infinity. This corrects that, I believe.