target/i386: fix floating-point load-constant rounding
authorJoseph Myers <joseph@codesourcery.com>
Wed, 13 May 2020 23:49:27 +0000 (23:49 +0000)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 10 Jun 2020 16:10:24 +0000 (12:10 -0400)
commit80b4008c805ebcfd4c0d302ac31c1689e34571e0
tree1b9d77a23eb27cbd12dd9f1b8fe201b2c9486e33
parent5579b524b0d2e4b310157c0b7985d35c24238120
target/i386: fix floating-point load-constant rounding

The implementations of the fldl2t, fldl2e, fldpi, fldlg2 and fldln2
instructions load fixed constants independent of the rounding mode.
Fix them to load a value correctly rounded for the current rounding
mode (but always rounded to 64-bit precision independent of the
precision control, and without setting "inexact") as specified.

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