diff options
author | Jakub Jelinek <jakub@redhat.com> | 2005-01-06 15:08:34 +0000 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2005-01-06 15:08:34 +0000 |
commit | 6bb54d1be0dcb4f151328393ee4317cbbe99d0f7 (patch) | |
tree | f2363c7108c33f6077cd84fff0fb9098c9f5bb0b /math | |
parent | 0ecfa2580d1aedb744deb5af1b60f92c69b9e9e0 (diff) | |
download | glibc-6bb54d1be0dcb4f151328393ee4317cbbe99d0f7.tar.gz glibc-6bb54d1be0dcb4f151328393ee4317cbbe99d0f7.tar.xz glibc-6bb54d1be0dcb4f151328393ee4317cbbe99d0f7.zip |
2004-12-22 Steven Munroe <sjmunroe@us.ibm.com>
* math/libm-test.inc (rint_test_tonearest): New test. (rint_test_towardzero): New test. (rint_test_downward): New test. (rint_test_upward): New test. * sysdeps/powerpc/powerpc32/fpu/s_ceil.S: Fix -0.0 case. Remove redundant const values. * sysdeps/powerpc/powerpc32/fpu/s_ceilf.S: Fix -0.0 case. Remove redundant const values. Use float const. * sysdeps/powerpc/powerpc32/fpu/s_floor.S: Fix -0.0 case. * sysdeps/powerpc/powerpc32/fpu/s_floorf.S: Fix -0.0 case. Use float const. * sysdeps/powerpc/powerpc32/fpu/s_rint.S: Fix -0.0 case. * sysdeps/powerpc/powerpc32/fpu/s_rintf.S: Fix -0.0 case. Use float const. * sysdeps/powerpc/powerpc32/fpu/s_round.S: Fix -0.0 case. Remove redundant const values. * sysdeps/powerpc/powerpc32/fpu/s_roundf.S: Fix -0.0 case. Remove redundant const values. Use float const. * sysdeps/powerpc/powerpc32/fpu/s_trunc.S: Fix -0.0 case. Remove redundant const values. * sysdeps/powerpc/powerpc32/fpu/s_truncf.S: Fix -0.0 case. Remove redundant const values. Use float const. * sysdeps/powerpc/powerpc64/fpu/s_ceil.S: Use EALIGN for Quadword alignment. Fix -0.0 case. Remove redundant const values. * sysdeps/powerpc/powerpc64/fpu/s_ceilf.S: Use EALIGN for Quadword alignment. Fix -0.0 case. Remove redundant const values. Use float const. * sysdeps/powerpc/powerpc64/fpu/s_floor.S: Use EALIGN for Quadword alignment. Fix -0.0 case. * sysdeps/powerpc/powerpc64/fpu/s_floorf.S: Use EALIGN for Quadword alignment. Fix -0.0 case. Use float const. * sysdeps/powerpc/powerpc64/fpu/s_rint.S: Use EALIGN for Quadword alignment. Fix -0.0 case. * sysdeps/powerpc/powerpc64/fpu/s_rintf.S: Use EALIGN for Quadword alignment. Fix -0.0 case. Use float const. * sysdeps/powerpc/powerpc64/fpu/s_round.S: Use EALIGN for Quadword alignment. Fix -0.0 case. Remove redundant const values. * sysdeps/powerpc/powerpc64/fpu/s_roundf.S: Use EALIGN for Quadword alignment. Fix -0.0 case. Remove redundant const values. Use float const. * sysdeps/powerpc/powerpc64/fpu/s_trunc.S: Use EALIGN for Quadword alignment. Fix -0.0 case. * sysdeps/powerpc/powerpc64/fpu/s_truncf.S: Use EALIGN for Quadword alignment. Fix -0.0 case. Remove redundant const values. Use float const.
Diffstat (limited to 'math')
-rw-r--r-- | math/libm-test.inc | 112 |
1 files changed, 112 insertions, 0 deletions
diff --git a/math/libm-test.inc b/math/libm-test.inc index 60711fabdc..be05222629 100644 --- a/math/libm-test.inc +++ b/math/libm-test.inc @@ -3795,6 +3795,114 @@ rint_test (void) } static void +rint_test_tonearest (void) +{ + int save_round_mode; + START (rint_tonearest); + + save_round_mode = fegetround(); + + if (!fesetround (FE_TONEAREST)) + { + TEST_f_f (rint, 2.0, 2.0); + TEST_f_f (rint, 1.5, 2.0); + TEST_f_f (rint, 1.0, 1.0); + TEST_f_f (rint, 0.5, 0.0); + TEST_f_f (rint, 0.0, 0.0); + TEST_f_f (rint, minus_zero, minus_zero); + TEST_f_f (rint, -0.5, -0.0); + TEST_f_f (rint, -1.0, -1.0); + TEST_f_f (rint, -1.5, -2.0); + TEST_f_f (rint, -2.0, -2.0); + } + + fesetround(save_round_mode); + + END (rint_tonearest); +} + +static void +rint_test_towardzero (void) +{ + int save_round_mode; + START (rint_towardzero); + + save_round_mode = fegetround(); + + if (!fesetround (FE_TOWARDZERO)) + { + TEST_f_f (rint, 2.0, 2.0); + TEST_f_f (rint, 1.5, 1.0); + TEST_f_f (rint, 1.0, 1.0); + TEST_f_f (rint, 0.5, 0.0); + TEST_f_f (rint, 0.0, 0.0); + TEST_f_f (rint, minus_zero, minus_zero); + TEST_f_f (rint, -0.5, -0.0); + TEST_f_f (rint, -1.0, -1.0); + TEST_f_f (rint, -1.5, -1.0); + TEST_f_f (rint, -2.0, -2.0); + } + + fesetround(save_round_mode); + + END (rint_towardzero); +} + +static void +rint_test_downward (void) +{ + int save_round_mode; + START (rint_downward); + + save_round_mode = fegetround(); + + if (!fesetround (FE_DOWNWARD)) + { + TEST_f_f (rint, 2.0, 2.0); + TEST_f_f (rint, 1.5, 1.0); + TEST_f_f (rint, 1.0, 1.0); + TEST_f_f (rint, 0.5, 0.0); + TEST_f_f (rint, 0.0, 0.0); + TEST_f_f (rint, minus_zero, minus_zero); + TEST_f_f (rint, -0.5, -1.0); + TEST_f_f (rint, -1.0, -1.0); + TEST_f_f (rint, -1.5, -2.0); + TEST_f_f (rint, -2.0, -2.0); + } + + fesetround(save_round_mode); + + END (rint_downward); +} + +static void +rint_test_upward (void) +{ + int save_round_mode; + START (rint_upward); + + save_round_mode = fegetround(); + + if (!fesetround (FE_UPWARD)) + { + TEST_f_f (rint, 2.0, 2.0); + TEST_f_f (rint, 1.5, 2.0); + TEST_f_f (rint, 1.0, 1.0); + TEST_f_f (rint, 0.5, 1.0); + TEST_f_f (rint, 0.0, 0.0); + TEST_f_f (rint, minus_zero, minus_zero); + TEST_f_f (rint, -0.5, -0.0); + TEST_f_f (rint, -1.0, -1.0); + TEST_f_f (rint, -1.5, -1.0); + TEST_f_f (rint, -2.0, -2.0); + } + + fesetround(save_round_mode); + + END (rint_upward); +} + +static void round_test (void) { START (round); @@ -4557,6 +4665,10 @@ main (int argc, char **argv) floor_test (); nearbyint_test (); rint_test (); + rint_test_tonearest (); + rint_test_towardzero (); + rint_test_downward (); + rint_test_upward (); lrint_test (); llrint_test (); round_test (); |