mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-27 15:30:07 +00:00
2cbec36566
nearbyint and nearbyintf should not trigger inexact exceptions, but should still trigger an invalid exception for a sNaN input. The SPARC specific implementations of these functions save the FSR at the beginning of the function and restore it at the end to not trigger an inexact exception. This however doesn't work for an sNaN input which need to trigger an invalid exception. Fix that by adding a fcmp instruction using the input value before saving FSR, so that an invalid exception is triggered for a sNaN input. This fixes the math/test-nearbyint-except test on SPARC. Changelog: * sparc/sparc32/sparcv9/fpu/s_nearbyint.S (__nearbyint): Trigger an invalid exception for a sNaN input. * sparc/sparc32/sparcv9/fpu/s_nearbyintf.S (__nearbyintf): Likewise. * sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyint-vis3.S (__nearbyint_vis3): Likewise * sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyintf-vis3.S (__nearbyintf_vis3): Likewise * sparc/sparc64/fpu/s_nearbyint.S (__nearbyint): Likewise. * sparc/sparc64/fpu/s_nearbyintf.S (__nearbyintf): Likewise. * sparc/sparc64/fpu/multiarch/s_nearbyint-vis3.S (__nearbyint_vis3): Likewise. * sparc/sparc64/fpu/multiarch/s_nearbyintf-vis3.S (__nearbyintf_vis3): Likewise. |
||
---|---|---|
.. | ||
multiarch | ||
s_ceil.S | ||
s_ceilf.S | ||
s_fabs.S | ||
s_fdim.S | ||
s_fdimf.S | ||
s_floor.S | ||
s_floorf.S | ||
s_fmax.S | ||
s_fmaxf.S | ||
s_fmin.S | ||
s_fminf.S | ||
s_isnan.S | ||
s_llrint.S | ||
s_llrintf.S | ||
s_lrint.S | ||
s_lrintf.S | ||
s_nearbyint.S | ||
s_nearbyintf.S | ||
s_rint.S | ||
s_rintf.S | ||
s_trunc.S | ||
s_truncf.S | ||
w_sqrt.S | ||
w_sqrtf.S |