[Libre-soc-dev] ieee 754 fp bit-exactness
programmerjake at gmail.com
Fri May 28 22:22:44 BST 2021
On Fri, May 28, 2021, 04:08 Lauri Kasanen <cand at gmx.com> wrote:
> On Fri, 28 May 2021 13:55:33 +0300
> Lauri Kasanen <cand at gmx.com> wrote:
> > > > There may be something more, perhaps FPSCR etc. I'm currently
> > > > investigating why int instrs work fine but float regs just stay
> Seems to be a bug in KVM. If I disable single-stepping, the mem dumps
> are good. That doesn't help fixing pypowersim's float instrs, though.
> Good: the dumps are byte-exact to x86s. Not even 1-bit diffs.
Yeah, IEEE 754 specifies the result completely for correctly rounded ops
(add, sub, mul, fma, div, compare, float <-> int, round to integral
(ceil/floor/etc.), etc.) (with one special-case exception for fma) unless
outputting a NaN, in which case it just specifies the output will be a
quiet or signalling NaN as appropriate.
An exception to the above is sign-manipulation instructions (neg, abs,
copysign), which specify that they change the sign bit and leave the rest
of the bits unmodified, NaN or not.
More information about the Libre-soc-dev