Skip to content

馃悰 Fix non-normal addend handling in symmetric widening add

Created by: michael-platzer

The FMA produces incorrect results for some symmetric widening adds (i.e., the new ADDS operation that was introduced in #114 when the destination format is wider than the source format) when the addend is subnormal but becomes a normal in the wider destination format.

The reason is that the FMA so far has taken advantage of the fact that the addend is already in destination format to optimize the addend anchored case. However, if this is not the destination format is wider and the addend is a subnormal, then it needs to be normalized. This PR fixes this by adding a normalization shift to the regular shift of the addend in case it is a subnormal number and its exponent is large enough to allow for that shift (which is the case if the destination format is wider and thus has a larger exponent bias). This requires a LZC over the mantissa of the addend but since it is parallel to the multiplication and summation logic its impact should be minimal.

Merge request reports

Loading