target/i386: reimplement fyl2x using floatx80 operations
commit1f18a1e6ab8368a4eab2d22894d3b2ae75250cd3
authorJoseph Myers <joseph@codesourcery.com>
Wed, 17 Jun 2020 23:24:29 +0000 (17 23:24 +0000)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 26 Jun 2020 13:39:39 +0000 (26 09:39 -0400)
tree74f4efb45983d3373128b282ddd31c2fb6689391
parent5eebc49d2d0aa5fc7e90eeac97533051bb7b72fa
target/i386: reimplement fyl2x using floatx80 operations

The x87 fyl2x emulation is currently based around conversion to
double.  This is inherently unsuitable for a good emulation of any
floatx80 operation.  Reimplement using the soft-float operations,
building on top of the reimplementation of fyl2xp1 and factoring out
code to be shared between the two instructions.

The included test assumes that the result in round-to-nearest mode
should always be one of the two closest floating-point numbers to the
mathematically exact result (including that it should be exact, in the
exact cases which cover more cases than for fyl2xp1).

Signed-off-by: Joseph Myers <joseph@codesourcery.com>
Message-Id: <alpine.DEB.2.21.2006172321530.20587@digraph.polyomino.org.uk>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
target/i386/fpu_helper.c
tests/tcg/i386/test-i386-fyl2x.c [new file with mode: 0644]