softfloat: return low bits of quotient from floatx80_modrem
authorJoseph Myers <joseph@codesourcery.com>
Mon, 8 Jun 2020 16:57:16 +0000 (16:57 +0000)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 26 Jun 2020 13:39:38 +0000 (09:39 -0400)
commit445810ec915687d37b8ae0ef8d7340ab4a153efa
treebc84f9b462e85bf3340972ca57a14be6da92e233
parent566601f1f9d972e44214696d3cb320e6c18880aa
softfloat: return low bits of quotient from floatx80_modrem

Both x87 and m68k need the low parts of the quotient for their
remainder operations.  Arrange for floatx80_modrem to track those bits
and return them via a pointer.

The architectures using float32_rem and float64_rem do not appear to
need this information, so the *_rem interface is left unchanged and
the information returned only from floatx80_modrem.  The logic used to
determine the low 7 bits of the quotient for m68k
(target/m68k/fpu_helper.c:make_quotient) appears completely bogus (it
looks at the result of converting the remainder to integer, the
quotient having been discarded by that point); this patch does not
change that, but the m68k maintainers may wish to do so.

Signed-off-by: Joseph Myers <joseph@codesourcery.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <alpine.DEB.2.21.2006081656500.23637@digraph.polyomino.org.uk>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
fpu/softfloat.c
include/fpu/softfloat.h