mirror of git://sourceware.org/git/glibc.git
math: Use math_opt_barrier on ldbl-128 powl underflow/overflow handling
This avoids compiler to move the operation before the 'iy' compare. It fixes math/test-float128-pow regreesions when building with clang [1]: Failure: pow (-0x1.000002p+0, 0xf.ffffffffffff8p+1020): Exception "Underflow" set Failure: pow (-0x1.000002p+0, 0xf.ffffffffffffbffffffffffffcp+1020): Exception "Underflow" set Failure: pow (-0x1.000002p+0, 0xf.fffffffffffffffffffffffffff8p+16380): Exception "Underflow" set Failure: pow (-0x1.000002p+0, 0xf.fffffffffffffffp+16380): Exception "Underflow" set Failure: pow (-0x1.000002p+0, 0xf.fffffp+124): Exception "Underflow" set Failure: pow (-0x1.00000ep+0, 0xf.ffffffffffff8p+1020): Exception "Underflow" set Failure: pow (-0x1.00000ep+0, 0xf.ffffffffffffbffffffffffffcp+1020): Exception "Underflow" set Failure: pow (-0x1.00000ep+0, 0xf.fffffffffffffffffffffffffff8p+16380): Exception "Underflow" set Failure: pow (-0x1.00000ep+0, 0xf.fffffffffffffffp+16380): Exception "Underflow" set Failure: pow (-0x2p+0, -0xf.ffffffffffff8p+1020): Exception "Overflow" set Failure: pow (-0x2p+0, -0xf.ffffffffffffbffffffffffffcp+1020): Exception "Overflow" set Failure: pow (-0x2p+0, -0xf.fffffffffffffffffffffffffff8p+16380): Exception "Overflow" set Failure: pow (-0x2p+0, -0xf.fffffffffffffffp+16380): Exception "Overflow" set Failure: pow (-0x2p+0, -0xf.fffffp+124): Exception "Overflow" set Failure: pow (-0x2p+0, 0xf.ffffffffffff8p+1020): Exception "Underflow" set Failure: pow (-0x2p+0, 0xf.ffffffffffffbffffffffffffcp+1020): Exception "Underflow" set Failure: pow (-0x2p+0, 0xf.fffffffffffffffffffffffffff8p+16380): Exception "Underflow" set Failure: pow (-0x2p+0, 0xf.fffffffffffffffp+16380): Exception "Underflow" set Failure: pow (-0x2p+0, 0xf.fffffp+124): Exception "Underflow" set [...] Checked on x86_64-linux-gnu and aarch64-linux-gnu with gcc-15 and clang-18. [1] https://github.com/llvm/llvm-project/issues/173080 Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
This commit is contained in:
parent
bc78f67ca1
commit
7be72e37e6
|
|
@ -279,9 +279,11 @@ __ieee754_powl (_Float128 x, _Float128 y)
|
|||
if (iy > 0x407d654b)
|
||||
{
|
||||
if (ix <= 0x3ffeffff)
|
||||
return (hy < 0) ? huge * huge : tiny * tiny;
|
||||
return (hy < 0) ? math_opt_barrier (huge * huge)
|
||||
: math_opt_barrier (tiny * tiny);
|
||||
if (ix >= 0x3fff0000)
|
||||
return (hy > 0) ? huge * huge : tiny * tiny;
|
||||
return (hy > 0) ? math_opt_barrier (huge * huge)
|
||||
: math_opt_barrier (tiny * tiny);
|
||||
}
|
||||
/* over/underflow if x is not close to one */
|
||||
if (ix < 0x3ffeffff)
|
||||
|
|
|
|||
Loading…
Reference in New Issue