From 166cc47deaa1da2477806e3bb9a1c6bd0b94ff52 Mon Sep 17 00:00:00 2001 From: joseph Date: Wed, 7 Mar 2012 19:31:25 +0000 Subject: Merge changes between r17384 and r17457 from /fsf/trunk. git-svn-id: svn://svn.eglibc.org/trunk@17458 7b3dc134-2b1b-0410-93df-9e9f96275f8d --- libc/sysdeps/generic/dl-osinfo.h | 4 +- libc/sysdeps/i386/fpu/libm-test-ulps | 490 ++++++++++++++ libc/sysdeps/i386/i486/bits/atomic.h | 36 +- libc/sysdeps/ieee754/dbl-64/e_pow.c | 13 +- libc/sysdeps/ieee754/ldbl-128ibm/e_coshl.c | 10 +- libc/sysdeps/ieee754/ldbl-128ibm/e_sinhl.c | 10 +- libc/sysdeps/ieee754/ldbl-96/printf_fphex.c | 3 +- libc/sysdeps/powerpc/fpu/libm-test-ulps | 752 +++++++++++++++++++-- libc/sysdeps/sparc/fpu/libm-test-ulps | 87 +++ libc/sysdeps/sparc/sparc32/sparcv9/fpu/s_llrint.S | 67 ++ libc/sysdeps/sparc/sparc32/sparcv9/fpu/s_llrintf.S | 62 ++ libc/sysdeps/sparc/sparc32/sparcv9/fpu/s_lrint.S | 67 ++ libc/sysdeps/sparc/sparc32/sparcv9/fpu/s_lrintf.S | 62 ++ libc/sysdeps/sparc/sparc64/fpu/s_llrint.S | 1 + libc/sysdeps/sparc/sparc64/fpu/s_llrintf.S | 1 + libc/sysdeps/sparc/sparc64/fpu/s_lrint.S | 63 ++ libc/sysdeps/sparc/sparc64/fpu/s_lrintf.S | 62 ++ libc/sysdeps/unix/sysv/linux/dl-osinfo.h | 4 +- .../unix/sysv/linux/sparc/sparc64/get_clockfreq.c | 27 +- libc/sysdeps/unix/sysv/linux/sparc/sysdep.h | 7 +- libc/sysdeps/unix/sysv/linux/x86_64/gettimeofday.c | 2 +- libc/sysdeps/unix/sysv/linux/x86_64/init-first.c | 4 +- libc/sysdeps/unix/sysv/linux/x86_64/time.c | 2 +- libc/sysdeps/x86_64/bits/atomic.h | 44 +- libc/sysdeps/x86_64/fpu/libm-test-ulps | 482 +++++++++++++ libc/sysdeps/x86_64/fpu/printf_fphex.c | 3 +- 26 files changed, 2217 insertions(+), 148 deletions(-) create mode 100644 libc/sysdeps/sparc/sparc32/sparcv9/fpu/s_llrint.S create mode 100644 libc/sysdeps/sparc/sparc32/sparcv9/fpu/s_llrintf.S create mode 100644 libc/sysdeps/sparc/sparc32/sparcv9/fpu/s_lrint.S create mode 100644 libc/sysdeps/sparc/sparc32/sparcv9/fpu/s_lrintf.S create mode 100644 libc/sysdeps/sparc/sparc64/fpu/s_llrint.S create mode 100644 libc/sysdeps/sparc/sparc64/fpu/s_llrintf.S create mode 100644 libc/sysdeps/sparc/sparc64/fpu/s_lrint.S create mode 100644 libc/sysdeps/sparc/sparc64/fpu/s_lrintf.S (limited to 'libc/sysdeps') diff --git a/libc/sysdeps/generic/dl-osinfo.h b/libc/sysdeps/generic/dl-osinfo.h index 2eaab3b76..548fc4666 100644 --- a/libc/sysdeps/generic/dl-osinfo.h +++ b/libc/sysdeps/generic/dl-osinfo.h @@ -30,8 +30,8 @@ _dl_setup_stack_chk_guard (void *dl_random) if (dl_random == NULL) { - ret.bytes[sizeof (ret) - 2] = 255; - ret.bytes[sizeof (ret) - 3] = '\n'; + ret.bytes[sizeof (ret) - 1] = 255; + ret.bytes[sizeof (ret) - 2] = '\n'; } else { diff --git a/libc/sysdeps/i386/fpu/libm-test-ulps b/libc/sysdeps/i386/fpu/libm-test-ulps index cb22d4565..977a3abd1 100644 --- a/libc/sysdeps/i386/fpu/libm-test-ulps +++ b/libc/sysdeps/i386/fpu/libm-test-ulps @@ -28,13 +28,147 @@ ildouble: 2 ldouble: 1 # cacos +Test "Imaginary part of: cacos (+0 + 0.5 i) == pi/2 - 0.4812118250596034474977589134243684231352 i": +double: 2 +idouble: 2 +Test "Imaginary part of: cacos (+0 + 1.0 i) == pi/2 - 0.8813735870195430252326093249797923090282 i": +double: 2 +float: 1 +idouble: 2 +ifloat: 1 +ildouble: 2 +ldouble: 2 +Test "Imaginary part of: cacos (+0 + 1.5 i) == pi/2 - 1.194763217287109304111930828519090523536 i": +double: 2 +float: 1 +idouble: 2 +ifloat: 1 +Test "Imaginary part of: cacos (+0 - 0.5 i) == pi/2 + 0.4812118250596034474977589134243684231352 i": +float: 1 +ifloat: 1 +Test "Imaginary part of: cacos (+0 - 1.0 i) == pi/2 + 0.8813735870195430252326093249797923090282 i": +double: 1 +float: 1 +idouble: 1 +ifloat: 1 +Test "Imaginary part of: cacos (+0 - 1.5 i) == pi/2 + 1.194763217287109304111930828519090523536 i": +double: 1 +idouble: 1 +Test "Imaginary part of: cacos (-0 + 0.5 i) == pi/2 - 0.4812118250596034474977589134243684231352 i": +double: 2 +idouble: 2 +Test "Imaginary part of: cacos (-0 + 1.0 i) == pi/2 - 0.8813735870195430252326093249797923090282 i": +double: 2 +float: 1 +idouble: 2 +ifloat: 1 +ildouble: 2 +ldouble: 2 +Test "Imaginary part of: cacos (-0 + 1.5 i) == pi/2 - 1.194763217287109304111930828519090523536 i": +double: 2 +float: 1 +idouble: 2 +ifloat: 1 +Test "Imaginary part of: cacos (-0 - 0.5 i) == pi/2 + 0.4812118250596034474977589134243684231352 i": +float: 1 +ifloat: 1 +Test "Imaginary part of: cacos (-0 - 1.0 i) == pi/2 + 0.8813735870195430252326093249797923090282 i": +double: 1 +float: 1 +idouble: 1 +ifloat: 1 +Test "Imaginary part of: cacos (-0 - 1.5 i) == pi/2 + 1.194763217287109304111930828519090523536 i": +double: 1 +idouble: 1 +Test "Imaginary part of: cacos (-1.5 + +0 i) == pi - 0.9624236501192068949955178268487368462704 i": +double: 1 +float: 1 +idouble: 1 +ifloat: 1 +Test "Imaginary part of: cacos (-1.5 - 0 i) == pi + 0.9624236501192068949955178268487368462704 i": +ildouble: 1 +ldouble: 1 +Test "Real part of: cacos (0.5 + +0 i) == 1.047197551196597746154214461093167628066 - 0 i": +double: 1 +idouble: 1 +ildouble: 1 +ldouble: 1 +Test "Real part of: cacos (0.5 - 0 i) == 1.047197551196597746154214461093167628066 + +0 i": +double: 1 +idouble: 1 +ildouble: 1 +ldouble: 1 Test "Imaginary part of: cacos (0.75 + 1.25 i) == 1.11752014915610270578240049553777969 - 1.13239363160530819522266333696834467 i": float: 1 ifloat: 1 ildouble: 2 ldouble: 2 +Test "Imaginary part of: cacos (1.5 + +0 i) == +0 - 0.9624236501192068949955178268487368462704 i": +double: 1 +float: 1 +idouble: 1 +ifloat: 1 +Test "Imaginary part of: cacos (1.5 - 0 i) == +0 + 0.9624236501192068949955178268487368462704 i": +ildouble: 1 +ldouble: 1 # cacosh +Test "Real part of: cacosh (+0 + 0.5 i) == 0.4812118250596034474977589134243684231352 + pi/2 i": +float: 1 +ifloat: 1 +Test "Real part of: cacosh (+0 + 1.0 i) == 0.8813735870195430252326093249797923090282 + pi/2 i": +double: 1 +float: 1 +idouble: 1 +ifloat: 1 +Test "Real part of: cacosh (+0 + 1.5 i) == 1.194763217287109304111930828519090523536 + pi/2 i": +double: 1 +idouble: 1 +Test "Real part of: cacosh (+0 - 0.5 i) == 0.4812118250596034474977589134243684231352 - pi/2 i": +float: 1 +ifloat: 1 +Test "Real part of: cacosh (+0 - 1.0 i) == 0.8813735870195430252326093249797923090282 - pi/2 i": +double: 1 +float: 1 +idouble: 1 +ifloat: 1 +Test "Real part of: cacosh (+0 - 1.5 i) == 1.194763217287109304111930828519090523536 - pi/2 i": +double: 1 +idouble: 1 +Test "Real part of: cacosh (-0 + 0.5 i) == 0.4812118250596034474977589134243684231352 + pi/2 i": +float: 1 +ifloat: 1 +Test "Real part of: cacosh (-0 + 1.0 i) == 0.8813735870195430252326093249797923090282 + pi/2 i": +double: 1 +float: 1 +idouble: 1 +ifloat: 1 +Test "Real part of: cacosh (-0 + 1.5 i) == 1.194763217287109304111930828519090523536 + pi/2 i": +double: 1 +idouble: 1 +Test "Real part of: cacosh (-0 - 0.5 i) == 0.4812118250596034474977589134243684231352 - pi/2 i": +float: 1 +ifloat: 1 +Test "Real part of: cacosh (-0 - 1.0 i) == 0.8813735870195430252326093249797923090282 - pi/2 i": +double: 1 +float: 1 +idouble: 1 +ifloat: 1 +Test "Real part of: cacosh (-0 - 1.5 i) == 1.194763217287109304111930828519090523536 - pi/2 i": +double: 1 +idouble: 1 +Test "Imaginary part of: cacosh (-0.5 + +0 i) == +0 + 2.094395102393195492308428922186335256131 i": +double: 1 +idouble: 1 +Test "Imaginary part of: cacosh (-0.5 - 0 i) == +0 - 2.094395102393195492308428922186335256131 i": +double: 1 +idouble: 1 +Test "Real part of: cacosh (-1.5 + +0 i) == 0.9624236501192068949955178268487368462704 + pi i": +float: 1 +ifloat: 1 +Test "Real part of: cacosh (-1.5 - 0 i) == 0.9624236501192068949955178268487368462704 - pi i": +float: 1 +ifloat: 1 Test "Real part of: cacosh (-2 - 3 i) == 1.9833870299165354323470769028940395 - 2.1414491111159960199416055713254211 i": double: 1 float: 9 @@ -52,8 +186,74 @@ ldouble: 1 Test "Real part of: cacosh (0.75 + 1.25 i) == 1.13239363160530819522266333696834467 + 1.11752014915610270578240049553777969 i": ildouble: 1 ldouble: 1 +Test "Real part of: cacosh (1.5 + +0 i) == 0.9624236501192068949955178268487368462704 + +0 i": +float: 1 +ifloat: 1 +Test "Real part of: cacosh (1.5 - 0 i) == 0.9624236501192068949955178268487368462704 - 0 i": +float: 1 +ifloat: 1 # casin +Test "Imaginary part of: casin (+0 + 0.5 i) == +0 + 0.4812118250596034474977589134243684231352 i": +double: 2 +idouble: 2 +Test "Imaginary part of: casin (+0 + 1.0 i) == +0 + 0.8813735870195430252326093249797923090282 i": +double: 2 +float: 1 +idouble: 2 +ifloat: 1 +ildouble: 2 +ldouble: 2 +Test "Imaginary part of: casin (+0 + 1.5 i) == +0 + 1.194763217287109304111930828519090523536 i": +double: 2 +float: 1 +idouble: 2 +ifloat: 1 +Test "Imaginary part of: casin (+0 - 0.5 i) == +0 - 0.4812118250596034474977589134243684231352 i": +float: 1 +ifloat: 1 +Test "Imaginary part of: casin (+0 - 1.0 i) == +0 - 0.8813735870195430252326093249797923090282 i": +double: 1 +float: 1 +idouble: 1 +ifloat: 1 +Test "Imaginary part of: casin (+0 - 1.5 i) == +0 - 1.194763217287109304111930828519090523536 i": +double: 1 +idouble: 1 +Test "Imaginary part of: casin (-0 + 0.5 i) == -0 + 0.4812118250596034474977589134243684231352 i": +double: 2 +idouble: 2 +Test "Imaginary part of: casin (-0 + 1.0 i) == -0 + 0.8813735870195430252326093249797923090282 i": +double: 2 +float: 1 +idouble: 2 +ifloat: 1 +ildouble: 2 +ldouble: 2 +Test "Imaginary part of: casin (-0 + 1.5 i) == -0 + 1.194763217287109304111930828519090523536 i": +double: 2 +float: 1 +idouble: 2 +ifloat: 1 +Test "Imaginary part of: casin (-0 - 0.5 i) == -0 - 0.4812118250596034474977589134243684231352 i": +float: 1 +ifloat: 1 +Test "Imaginary part of: casin (-0 - 1.0 i) == -0 - 0.8813735870195430252326093249797923090282 i": +double: 1 +float: 1 +idouble: 1 +ifloat: 1 +Test "Imaginary part of: casin (-0 - 1.5 i) == -0 - 1.194763217287109304111930828519090523536 i": +double: 1 +idouble: 1 +Test "Imaginary part of: casin (-1.5 + +0 i) == -pi/2 + 0.9624236501192068949955178268487368462704 i": +double: 1 +float: 1 +idouble: 1 +ifloat: 1 +Test "Imaginary part of: casin (-1.5 - 0 i) == -pi/2 - 0.9624236501192068949955178268487368462704 i": +ildouble: 1 +ldouble: 1 Test "Real part of: casin (0.75 + 1.25 i) == 0.453276177638793913448921196101971749 + 1.13239363160530819522266333696834467 i": double: 1 float: 1 @@ -66,8 +266,62 @@ float: 1 ifloat: 1 ildouble: 2 ldouble: 2 +Test "Imaginary part of: casin (1.5 + +0 i) == pi/2 + 0.9624236501192068949955178268487368462704 i": +double: 1 +float: 1 +idouble: 1 +ifloat: 1 +Test "Imaginary part of: casin (1.5 - 0 i) == pi/2 - 0.9624236501192068949955178268487368462704 i": +ildouble: 1 +ldouble: 1 # casinh +Test "Real part of: casinh (+0 + 1.5 i) == 0.9624236501192068949955178268487368462704 + pi/2 i": +ildouble: 1 +ldouble: 1 +Test "Real part of: casinh (+0 - 1.5 i) == 0.9624236501192068949955178268487368462704 - pi/2 i": +ildouble: 1 +ldouble: 1 +Test "Real part of: casinh (-0 + 1.5 i) == -0.9624236501192068949955178268487368462704 + pi/2 i": +double: 1 +float: 1 +idouble: 1 +ifloat: 1 +Test "Real part of: casinh (-0 - 1.5 i) == -0.9624236501192068949955178268487368462704 - pi/2 i": +double: 1 +float: 1 +idouble: 1 +ifloat: 1 +Test "Real part of: casinh (-0.5 + +0 i) == -0.4812118250596034474977589134243684231352 + +0 i": +double: 2 +idouble: 2 +Test "Real part of: casinh (-0.5 - 0 i) == -0.4812118250596034474977589134243684231352 - 0 i": +double: 2 +idouble: 2 +Test "Real part of: casinh (-1.0 + +0 i) == -0.8813735870195430252326093249797923090282 + +0 i": +double: 2 +float: 1 +idouble: 2 +ifloat: 1 +ildouble: 2 +ldouble: 2 +Test "Real part of: casinh (-1.0 - 0 i) == -0.8813735870195430252326093249797923090282 - 0 i": +double: 2 +float: 1 +idouble: 2 +ifloat: 1 +ildouble: 2 +ldouble: 2 +Test "Real part of: casinh (-1.5 + +0 i) == -1.194763217287109304111930828519090523536 + +0 i": +double: 2 +float: 1 +idouble: 2 +ifloat: 1 +Test "Real part of: casinh (-1.5 - 0 i) == -1.194763217287109304111930828519090523536 - 0 i": +double: 2 +float: 1 +idouble: 2 +ifloat: 1 Test "Real part of: casinh (-2 - 3 i) == -1.9686379257930962917886650952454982 - 0.96465850440760279204541105949953237 i": double: 5 float: 1 @@ -82,6 +336,12 @@ idouble: 3 ifloat: 6 ildouble: 5 ldouble: 5 +Test "Real part of: casinh (0.5 + +0 i) == 0.4812118250596034474977589134243684231352 + +0 i": +float: 1 +ifloat: 1 +Test "Real part of: casinh (0.5 - 0 i) == 0.4812118250596034474977589134243684231352 - 0 i": +float: 1 +ifloat: 1 Test "Real part of: casinh (0.75 + 1.25 i) == 1.03171853444778027336364058631006594 + 0.911738290968487636358489564316731207 i": float: 1 ifloat: 1 @@ -92,6 +352,22 @@ idouble: 1 ifloat: 1 ildouble: 1 ldouble: 1 +Test "Real part of: casinh (1.0 + +0 i) == 0.8813735870195430252326093249797923090282 + +0 i": +double: 1 +float: 1 +idouble: 1 +ifloat: 1 +Test "Real part of: casinh (1.0 - 0 i) == 0.8813735870195430252326093249797923090282 - 0 i": +double: 1 +float: 1 +idouble: 1 +ifloat: 1 +Test "Real part of: casinh (1.5 + +0 i) == 1.194763217287109304111930828519090523536 + +0 i": +double: 1 +idouble: 1 +Test "Real part of: casinh (1.5 - 0 i) == 1.194763217287109304111930828519090523536 - 0 i": +double: 1 +idouble: 1 # catan Test "Imaginary part of: catan (-2 - 3 i) == -1.4099210495965755225306193844604208 - 0.22907268296853876629588180294200276 i": @@ -322,6 +598,9 @@ ldouble: 1 Test "cos_tonearest (8) == -0.1455000338086135258688413818311946826093": ildouble: 1 ldouble: 1 +Test "cos_tonearest (9) == -0.9111302618846769883682947111811653112463": +ildouble: 1 +ldouble: 1 # cos_towardzero Test "cos_towardzero (1) == 0.5403023058681397174009366074429766037323": @@ -408,6 +687,42 @@ ifloat: 1 Test "cosh (0.75) == 1.29468328467684468784170818539018176": ildouble: 1 +# cosh_downward +Test "cosh_downward (22) == 1792456423.065795780980053377632656584997": +double: 1 +float: 1 +ldouble: 2 +Test "cosh_downward (23) == 4872401723.124451300068625740569997090344": +double: 1 +float: 1 +ldouble: 1 +Test "cosh_downward (24) == 13244561064.92173614708845674912733665919": +float: 1 +ldouble: 1 + +# cosh_tonearest +Test "cosh_tonearest (22) == 1792456423.065795780980053377632656584997": +ldouble: 1 + +# cosh_towardzero +Test "cosh_towardzero (22) == 1792456423.065795780980053377632656584997": +double: 1 +float: 1 +ldouble: 2 +Test "cosh_towardzero (23) == 4872401723.124451300068625740569997090344": +double: 1 +float: 1 +ldouble: 1 +Test "cosh_towardzero (24) == 13244561064.92173614708845674912733665919": +float: 1 +ldouble: 1 + +# cosh_upward +Test "cosh_upward (23) == 4872401723.124451300068625740569997090344": +ldouble: 1 +Test "cosh_upward (24) == 13244561064.92173614708845674912733665919": +double: 1 + # cpow Test "Real part of: cpow (0.75 + 1.25 i, 0.0 + 1.0 i) == 0.331825439177608832276067945276730566 + 0.131338600281188544930936345230903032 i": float: 1 @@ -897,6 +1212,42 @@ ifloat: 1 ildouble: 1 ldouble: 1 +# pow_downward +Test "pow_downward (1.0625, 1.125) == 1.070582293028761362162622578677070098674": +double: 1 +idouble: 1 +ildouble: 1 +ldouble: 1 +Test "pow_downward (1.5, 1.03125) == 1.519127098714743184071644334163037684948": +float: 1 +ifloat: 1 +ildouble: 1 +ldouble: 1 + +# pow_towardzero +Test "pow_towardzero (1.0625, 1.125) == 1.070582293028761362162622578677070098674": +double: 1 +idouble: 1 +ildouble: 1 +ldouble: 1 +Test "pow_towardzero (1.5, 1.03125) == 1.519127098714743184071644334163037684948": +float: 1 +ifloat: 1 +ildouble: 1 +ldouble: 1 + +# pow_upward +Test "pow_upward (1.0625, 1.125) == 1.070582293028761362162622578677070098674": +float: 1 +ifloat: 1 +ildouble: 1 +ldouble: 1 +Test "pow_upward (1.5, 1.03125) == 1.519127098714743184071644334163037684948": +double: 1 +idouble: 1 +ildouble: 1 +ldouble: 1 + # sin_downward Test "sin_downward (1) == 0.8414709848078965066525023216302989996226": ildouble: 1 @@ -950,6 +1301,9 @@ ldouble: 1 Test "sin_tonearest (4) == -0.7568024953079282513726390945118290941359": ildouble: 1 ldouble: 1 +Test "sin_tonearest (9) == 0.4121184852417565697562725663524351793439": +ildouble: 1 +ldouble: 1 # sin_towardzero Test "sin_towardzero (1) == 0.8414709848078965066525023216302989996226": @@ -1052,6 +1406,58 @@ Test "sinh (0.75) == 0.822316731935829980703661634446913849": double: 1 ildouble: 1 +# sinh_downward +Test "sinh_downward (22) == 1792456423.065795780701106568345764104225": +double: 1 +float: 1 +idouble: 1 +ifloat: 1 +ldouble: 4 +Test "sinh_downward (23) == 4872401723.124451299966006944252978187305": +double: 1 +float: 1 +idouble: 1 +ifloat: 1 +Test "sinh_downward (24) == 13244561064.92173614705070540368454568168": +float: 1 +ifloat: 1 +ldouble: 5 + +# sinh_tonearest +Test "sinh_tonearest (22) == 1792456423.065795780701106568345764104225": +ldouble: 3 +Test "sinh_tonearest (23) == 4872401723.124451299966006944252978187305": +ldouble: 1 +Test "sinh_tonearest (24) == 13244561064.92173614705070540368454568168": +ldouble: 6 + +# sinh_towardzero +Test "sinh_towardzero (22) == 1792456423.065795780701106568345764104225": +double: 1 +float: 1 +idouble: 1 +ifloat: 1 +ldouble: 4 +Test "sinh_towardzero (23) == 4872401723.124451299966006944252978187305": +double: 1 +float: 1 +idouble: 1 +ifloat: 1 +Test "sinh_towardzero (24) == 13244561064.92173614705070540368454568168": +float: 1 +ifloat: 1 +ldouble: 5 + +# sinh_upward +Test "sinh_upward (22) == 1792456423.065795780701106568345764104225": +ldouble: 16 +Test "sinh_upward (23) == 4872401723.124451299966006944252978187305": +ldouble: 27 +Test "sinh_upward (24) == 13244561064.92173614705070540368454568168": +double: 1 +idouble: 1 +ldouble: 7 + # tan Test "tan (pi/4) == 1": double: 1 @@ -1081,6 +1487,9 @@ float: 1 ifloat: 1 ildouble: 1 ldouble: 1 +Test "tan_downward (5) == -3.3805150062465856369827058794473439087096": +ildouble: 1 +ldouble: 1 Test "tan_downward (6) == -0.2910061913847491570536995888681755428312": double: 1 float: 1 @@ -1130,6 +1539,8 @@ ldouble: 1 Test "tan_towardzero (3) == -0.1425465430742778052956354105339134932261": float: 1 ifloat: 1 +ildouble: 1 +ldouble: 1 Test "tan_towardzero (4) == 1.1578212823495775831373424182673239231198": float: 1 ifloat: 1 @@ -1174,6 +1585,8 @@ ldouble: 1 Test "tan_upward (3) == -0.1425465430742778052956354105339134932261": float: 1 ifloat: 1 +ildouble: 1 +ldouble: 1 Test "tan_upward (4) == 1.1578212823495775831373424182673239231198": double: 1 idouble: 1 @@ -1395,6 +1808,10 @@ idouble: 1 ifloat: 1 # Maximal error of functions: +Function: "acos": +ildouble: 1 +ldouble: 1 + Function: "asin": ildouble: 1 ldouble: 1 @@ -1403,8 +1820,16 @@ Function: "atanh": ildouble: 2 ldouble: 1 +Function: Real part of "cacos": +double: 1 +idouble: 1 +ildouble: 1 +ldouble: 1 + Function: Imaginary part of "cacos": +double: 2 float: 1 +idouble: 2 ifloat: 1 ildouble: 2 ldouble: 2 @@ -1434,7 +1859,9 @@ ildouble: 2 ldouble: 2 Function: Imaginary part of "casin": +double: 2 float: 1 +idouble: 2 ifloat: 1 ildouble: 2 ldouble: 2 @@ -1568,6 +1995,23 @@ ldouble: 1 Function: "cosh": ildouble: 1 +Function: "cosh_downward": +double: 1 +float: 1 +ldouble: 2 + +Function: "cosh_tonearest": +ldouble: 1 + +Function: "cosh_towardzero": +double: 1 +float: 1 +ldouble: 2 + +Function: "cosh_upward": +double: 1 +ldouble: 1 + Function: Real part of "cpow": double: 1 float: 4 @@ -1733,6 +2177,30 @@ ifloat: 1 ildouble: 1 ldouble: 1 +Function: "pow_downward": +double: 1 +float: 1 +idouble: 1 +ifloat: 1 +ildouble: 1 +ldouble: 1 + +Function: "pow_towardzero": +double: 1 +float: 1 +idouble: 1 +ifloat: 1 +ildouble: 1 +ldouble: 1 + +Function: "pow_upward": +double: 1 +float: 1 +idouble: 1 +ifloat: 1 +ildouble: 1 +ldouble: 1 + Function: "sin_downward": double: 1 float: 1 @@ -1773,6 +2241,28 @@ Function: "sinh": double: 1 ildouble: 1 +Function: "sinh_downward": +double: 1 +float: 1 +idouble: 1 +ifloat: 1 +ldouble: 5 + +Function: "sinh_tonearest": +ldouble: 6 + +Function: "sinh_towardzero": +double: 1 +float: 1 +idouble: 1 +ifloat: 1 +ldouble: 5 + +Function: "sinh_upward": +double: 1 +idouble: 1 +ldouble: 27 + Function: "tan": double: 1 idouble: 1 diff --git a/libc/sysdeps/i386/i486/bits/atomic.h b/libc/sysdeps/i386/i486/bits/atomic.h index b633ce984..b59a556db 100644 --- a/libc/sysdeps/i386/i486/bits/atomic.h +++ b/libc/sysdeps/i386/i486/bits/atomic.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2004,2006,2007,2009,2011 Free Software Foundation, Inc. +/* Copyright (C) 2002-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 2002. @@ -55,33 +55,10 @@ typedef uintmax_t uatomic_max_t; #endif -#if __GNUC_PREREQ (4, 1) -# define atomic_compare_and_exchange_val_acq(mem, newval, oldval) \ +#define atomic_compare_and_exchange_val_acq(mem, newval, oldval) \ __sync_val_compare_and_swap (mem, oldval, newval) -# define atomic_compare_and_exchange_bool_acq(mem, newval, oldval) \ +#define atomic_compare_and_exchange_bool_acq(mem, newval, oldval) \ (! __sync_bool_compare_and_swap (mem, oldval, newval)) -#else -# define __arch_compare_and_exchange_val_8_acq(mem, newval, oldval) \ - ({ __typeof (*mem) ret; \ - __asm __volatile (LOCK_PREFIX "cmpxchgb %b2, %1" \ - : "=a" (ret), "=m" (*mem) \ - : "q" (newval), "m" (*mem), "0" (oldval)); \ - ret; }) - -# define __arch_compare_and_exchange_val_16_acq(mem, newval, oldval) \ - ({ __typeof (*mem) ret; \ - __asm __volatile (LOCK_PREFIX "cmpxchgw %w2, %1" \ - : "=a" (ret), "=m" (*mem) \ - : "r" (newval), "m" (*mem), "0" (oldval)); \ - ret; }) - -# define __arch_compare_and_exchange_val_32_acq(mem, newval, oldval) \ - ({ __typeof (*mem) ret; \ - __asm __volatile (LOCK_PREFIX "cmpxchgl %2, %1" \ - : "=a" (ret), "=m" (*mem) \ - : "r" (newval), "m" (*mem), "0" (oldval)); \ - ret; }) -#endif #define __arch_c_compare_and_exchange_val_8_acq(mem, newval, oldval) \ @@ -254,13 +231,8 @@ typedef uintmax_t uatomic_max_t; } \ __result; }) -#if __GNUC_PREREQ (4, 1) -# define atomic_exchange_and_add(mem, value) \ +#define atomic_exchange_and_add(mem, value) \ __sync_fetch_and_add (mem, value) -#else -# define atomic_exchange_and_add(mem, value) \ - __arch_exchange_and_add_body (LOCK_PREFIX, __arch, mem, value) -#endif #define __arch_exchange_and_add_cprefix \ "cmpl $0, %%gs:%P4\n\tje 0f\n\tlock\n0:\t" diff --git a/libc/sysdeps/ieee754/dbl-64/e_pow.c b/libc/sysdeps/ieee754/dbl-64/e_pow.c index 28435fd36..f668b4b5f 100644 --- a/libc/sysdeps/ieee754/dbl-64/e_pow.c +++ b/libc/sysdeps/ieee754/dbl-64/e_pow.c @@ -1,7 +1,7 @@ /* * IBM Accurate Mathematical Library * written by International Business Machines Corp. - * Copyright (C) 2001, 2002, 2004, 2011 Free Software Foundation + * Copyright (C) 2001-2012 Free Software Foundation * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by @@ -41,6 +41,7 @@ #include "MathLib.h" #include "upow.tbl" #include "math_private.h" +#include #ifndef SECTION # define SECTION @@ -84,6 +85,11 @@ __ieee754_pow(double x, double y) { (u.i[HIGH_HALF]==0 && u.i[LOW_HALF]!=0)) && /* 2^-1023< x<= 2^-1023 * 0x1.0000ffffffff */ (v.i[HIGH_HALF]&0x7fffffff) < 0x4ff00000) { /* if y<-1 or y>1 */ + fenv_t env; + double retval; + + libc_feholdexcept_setround (&env, FE_TONEAREST); + z = log1(x,&aa,&error); /* x^y =e^(y log (X)) */ t = y*134217729.0; y1 = t - (t-y); @@ -97,7 +103,10 @@ __ieee754_pow(double x, double y) { a2 = (a-a1)+aa; error = error*ABS(y); t = __exp1(a1,a2,1.9e16*error); /* return -10 or 0 if wasn't computed exactly */ - return (t>0)?t:power1(x,y); + retval = (t>0)?t:power1(x,y); + + libc_feupdateenv (&env); + return retval; } if (x == 0) { diff --git a/libc/sysdeps/ieee754/ldbl-128ibm/e_coshl.c b/libc/sysdeps/ieee754/ldbl-128ibm/e_coshl.c index ebc943639..569b8418b 100644 --- a/libc/sysdeps/ieee754/ldbl-128ibm/e_coshl.c +++ b/libc/sysdeps/ieee754/ldbl-128ibm/e_coshl.c @@ -20,9 +20,9 @@ * 2*exp(x) * * exp(x) + 1/exp(x) - * ln2/2 <= x <= 22 : cosh(x) := ------------------- + * ln2/2 <= x <= 40 : cosh(x) := ------------------- * 2 - * 22 <= x <= lnovft : cosh(x) := exp(x)/2 + * 40 <= x <= lnovft : cosh(x) := exp(x)/2 * lnovft <= x <= ln2ovft: cosh(x) := exp(x/2)/2 * exp(x/2) * ln2ovft < x : cosh(x) := huge*huge (overflow) * @@ -57,13 +57,13 @@ __ieee754_coshl (long double x) return one+(t*t)/(w+w); } - /* |x| in [0.5*ln2,22], return (exp(|x|)+1/exp(|x|)/2; */ - if (ix < 0x4036000000000000LL) { + /* |x| in [0.5*ln2,40], return (exp(|x|)+1/exp(|x|)/2; */ + if (ix < 0x4044000000000000LL) { t = __ieee754_expl(fabsl(x)); return half*t+half/t; } - /* |x| in [22, log(maxdouble)] return half*exp(|x|) */ + /* |x| in [40, log(maxdouble)] return half*exp(|x|) */ if (ix < 0x40862e42fefa39efLL) return half*__ieee754_expl(fabsl(x)); /* |x| in [log(maxdouble), overflowthresold] */ diff --git a/libc/sysdeps/ieee754/ldbl-128ibm/e_sinhl.c b/libc/sysdeps/ieee754/ldbl-128ibm/e_sinhl.c index b8e86b1a6..4b53d90c9 100644 --- a/libc/sysdeps/ieee754/ldbl-128ibm/e_sinhl.c +++ b/libc/sysdeps/ieee754/ldbl-128ibm/e_sinhl.c @@ -16,10 +16,10 @@ * 1. Replace x by |x| (sinh(-x) = -sinh(x)). * 2. * E + E/(E+1) - * 0 <= x <= 22 : sinh(x) := --------------, E=expm1(x) + * 0 <= x <= 40 : sinh(x) := --------------, E=expm1(x) * 2 * - * 22 <= x <= lnovft : sinh(x) := exp(x)/2 + * 40 <= x <= lnovft : sinh(x) := exp(x)/2 * lnovft <= x <= ln2ovft: sinh(x) := exp(x/2)/2 * exp(x/2) * ln2ovft < x : sinh(x) := x*shuge (overflow) * @@ -48,8 +48,8 @@ __ieee754_sinhl(long double x) h = 0.5; if (jx<0) h = -h; - /* |x| in [0,22], return sign(x)*0.5*(E+E/(E+1))) */ - if (ix < 0x4036000000000000LL) { /* |x|<22 */ + /* |x| in [0,40], return sign(x)*0.5*(E+E/(E+1))) */ + if (ix < 0x4044000000000000LL) { /* |x|<40 */ if (ix<0x3e20000000000000LL) /* |x|<2**-29 */ if(shuge+x>one) return x;/* sinhl(tiny) = tiny with inexact */ t = __expm1l(fabsl(x)); @@ -57,7 +57,7 @@ __ieee754_sinhl(long double x) return h*(t+t/(t+one)); } - /* |x| in [22, log(maxdouble)] return 0.5*exp(|x|) */ + /* |x| in [40, log(maxdouble)] return 0.5*exp(|x|) */ if (ix < 0x40862e42fefa39efLL) return h*__ieee754_expl(fabsl(x)); /* |x| in [log(maxdouble), overflowthresold] */ diff --git a/libc/sysdeps/ieee754/ldbl-96/printf_fphex.c b/libc/sysdeps/ieee754/ldbl-96/printf_fphex.c index b1c9d7364..acb0508b8 100644 --- a/libc/sysdeps/ieee754/ldbl-96/printf_fphex.c +++ b/libc/sysdeps/ieee754/ldbl-96/printf_fphex.c @@ -1,5 +1,5 @@ /* Print floating point number in hexadecimal notation according to ISO C99. - Copyright (C) 1997, 1998, 1999, 2000, 2005 Free Software Foundation, Inc. + Copyright (C) 1997-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -58,6 +58,7 @@ do { \ \ /* We use a full nibble for the leading digit. */ \ leading = *numstr++; \ + wnumstr++; \ \ /* We have 3 bits from the mantissa in the leading nibble. \ Therefore we are here using `IEEE854_LONG_DOUBLE_BIAS + 3'. */ \ diff --git a/libc/sysdeps/powerpc/fpu/libm-test-ulps b/libc/sysdeps/powerpc/fpu/libm-test-ulps index 00e994ce7..f3d4dd994 100644 --- a/libc/sysdeps/powerpc/fpu/libm-test-ulps +++ b/libc/sysdeps/powerpc/fpu/libm-test-ulps @@ -32,9 +32,26 @@ float: 1 ifloat: 1 # cabs +Test "cabs (-0.75 + 12.390625 i) == 12.4133028598606664302388810868156657": +float: 1 +ifloat: 1 +Test "cabs (-0.75 - 12.390625 i) == 12.4133028598606664302388810868156657": +float: 1 +ifloat: 1 +Test "cabs (-12.390625 + 0.75 i) == 12.4133028598606664302388810868156657": +float: 1 +ifloat: 1 +Test "cabs (-12.390625 - 0.75 i) == 12.4133028598606664302388810868156657": +float: 1 +ifloat: 1 Test "cabs (0.75 + 1.25 i) == 1.45773797371132511771853821938639577": +float: 1 +ifloat: 1 ildouble: 1 ldouble: 1 +Test "cabs (0.75 + 12.390625 i) == 12.4133028598606664302388810868156657": +float: 1 +ifloat: 1 # cacosh Test "Real part of: cacosh (-2 - 3 i) == 1.9833870299165354323470769028940395 - 2.1414491111159960199416055713254211 i": @@ -172,8 +189,8 @@ ifloat: 3 ildouble: 1 ldouble: 1 Test "Real part of: clog (0.75 + 1.25 i) == 0.376885901188190075998919126749298416 + 1.03037682652431246378774332703115153 i": -float: 1 -ifloat: 1 +float: 2 +ifloat: 2 ildouble: 2 ldouble: 2 Test "Imaginary part of: clog (0.75 + 1.25 i) == 0.376885901188190075998919126749298416 + 1.03037682652431246378774332703115153 i": @@ -195,6 +212,9 @@ idouble: 1 ifloat: 1 ildouble: 1 ldouble: 1 +Test "Real part of: clog10 (-2 - 3 i) == 0.556971676153418384603252578971164214 - 0.937554462986374708541507952140189646 i": +double: 1 +idouble: 1 Test "Imaginary part of: clog10 (-2 - 3 i) == 0.556971676153418384603252578971164214 - 0.937554462986374708541507952140189646 i": double: 1 float: 5 @@ -262,8 +282,8 @@ ifloat: 1 ildouble: 1 ldouble: 1 Test "Real part of: clog10 (0.75 + 1.25 i) == 0.163679467193165171449476605077428975 + 0.447486970040493067069984724340855636 i": -float: 1 -ifloat: 1 +float: 2 +ifloat: 2 ildouble: 3 ldouble: 3 Test "Imaginary part of: clog10 (3 + inf i) == inf + pi/2*log10(e) i": @@ -315,6 +335,152 @@ float: 1 idouble: 1 ifloat: 1 +# cos_downward +Test "cos_downward (1) == 0.5403023058681397174009366074429766037323": +float: 1 +ifloat: 1 +ildouble: 4 +ldouble: 4 +Test "cos_downward (10) == -0.8390715290764524522588639478240648345199": +ildouble: 1 +ldouble: 1 +Test "cos_downward (2) == -0.4161468365471423869975682295007621897660": +float: 1 +ifloat: 1 +Test "cos_downward (3) == -0.9899924966004454572715727947312613023937": +float: 1 +ifloat: 1 +Test "cos_downward (4) == -0.6536436208636119146391681830977503814241": +float: 1 +ifloat: 1 +Test "cos_downward (5) == 0.2836621854632262644666391715135573083344": +float: 1 +ifloat: 1 +Test "cos_downward (6) == 0.9601702866503660205456522979229244054519": +ildouble: 1 +ldouble: 1 +Test "cos_downward (7) == 0.7539022543433046381411975217191820122183": +float: 1 +ifloat: 1 +Test "cos_downward (8) == -0.1455000338086135258688413818311946826093": +float: 1 +ifloat: 1 +ildouble: 2 +ldouble: 2 +Test "cos_downward (9) == -0.9111302618846769883682947111811653112463": +ildouble: 1 +ldouble: 1 + +# cos_tonearest +Test "cos_tonearest (7) == 0.7539022543433046381411975217191820122183": +float: 1 +ifloat: 1 + +# cos_towardzero +Test "cos_towardzero (1) == 0.5403023058681397174009366074429766037323": +ildouble: 2 +ldouble: 2 +Test "cos_towardzero (10) == -0.8390715290764524522588639478240648345199": +ildouble: 1 +ldouble: 1 +Test "cos_towardzero (2) == -0.4161468365471423869975682295007621897660": +float: 1 +ifloat: 1 +Test "cos_towardzero (3) == -0.9899924966004454572715727947312613023937": +float: 1 +ifloat: 1 +Test "cos_towardzero (4) == -0.6536436208636119146391681830977503814241": +ildouble: 1 +ldouble: 1 +Test "cos_towardzero (5) == 0.2836621854632262644666391715135573083344": +float: 1 +ifloat: 1 +Test "cos_towardzero (7) == 0.7539022543433046381411975217191820122183": +float: 1 +ifloat: 1 +Test "cos_towardzero (8) == -0.1455000338086135258688413818311946826093": +float: 1 +ifloat: 1 +ildouble: 2 +ldouble: 2 + +# cos_upward +Test "cos_upward (1) == 0.5403023058681397174009366074429766037323": +ildouble: 2 +ldouble: 2 +Test "cos_upward (10) == -0.8390715290764524522588639478240648345199": +float: 1 +ifloat: 1 +ildouble: 1 +ldouble: 1 +Test "cos_upward (4) == -0.6536436208636119146391681830977503814241": +ildouble: 1 +ldouble: 1 +Test "cos_upward (5) == 0.2836621854632262644666391715135573083344": +ildouble: 1 +ldouble: 1 +Test "cos_upward (6) == 0.9601702866503660205456522979229244054519": +float: 1 +ifloat: 1 +Test "cos_upward (7) == 0.7539022543433046381411975217191820122183": +float: 1 +ifloat: 1 +ildouble: 1 +ldouble: 1 +Test "cos_upward (9) == -0.9111302618846769883682947111811653112463": +float: 2 +ifloat: 2 + +# cosh_downward +Test "cosh_downward (22) == 1792456423.065795780980053377632656584997": +float: 1 +ifloat: 1 +ildouble: 1 +ldouble: 1 +Test "cosh_downward (23) == 4872401723.124451300068625740569997090344": +float: 1 +ifloat: 1 +ildouble: 1 +ldouble: 1 +Test "cosh_downward (24) == 13244561064.92173614708845674912733665919": +float: 1 +ifloat: 1 +ildouble: 1 +ldouble: 1 + +# cosh_tonearest +Test "cosh_tonearest (24) == 13244561064.92173614708845674912733665919": +ildouble: 1 +ldouble: 1 + +# cosh_towardzero +Test "cosh_towardzero (22) == 1792456423.065795780980053377632656584997": +float: 1 +ifloat: 1 +ildouble: 1 +ldouble: 1 +Test "cosh_towardzero (23) == 4872401723.124451300068625740569997090344": +float: 1 +ifloat: 1 +ildouble: 1 +ldouble: 1 +Test "cosh_towardzero (24) == 13244561064.92173614708845674912733665919": +float: 1 +ifloat: 1 +ildouble: 1 +ldouble: 1 + +# cosh_upward +Test "cosh_upward (22) == 1792456423.065795780980053377632656584997": +ildouble: 2 +ldouble: 2 +Test "cosh_upward (23) == 4872401723.124451300068625740569997090344": +ildouble: 2 +ldouble: 2 +Test "cosh_upward (24) == 13244561064.92173614708845674912733665919": +ildouble: 2 +ldouble: 2 + # cpow Test "Real part of: cpow (0.75 + 1.25 i, 0.0 + 1.0 i) == 0.331825439177608832276067945276730566 + 0.131338600281188544930936345230903032 i": float: 1 @@ -322,8 +488,8 @@ ifloat: 1 ildouble: 1 ldouble: 1 Test "Imaginary part of: cpow (0.75 + 1.25 i, 0.0 + 1.0 i) == 0.331825439177608832276067945276730566 + 0.131338600281188544930936345230903032 i": -float: 1 -ifloat: 1 +float: 2 +ifloat: 2 ildouble: 1 ldouble: 1 Test "Real part of: cpow (0.75 + 1.25 i, 0.75 + 1.25 i) == 0.117506293914473555420279832210420483 + 0.346552747708338676483025352060418001 i": @@ -331,14 +497,22 @@ double: 1 float: 4 idouble: 1 ifloat: 4 +Test "Imaginary part of: cpow (0.75 + 1.25 i, 0.75 + 1.25 i) == 0.117506293914473555420279832210420483 + 0.346552747708338676483025352060418001 i": +float: 1 +ifloat: 1 Test "Real part of: cpow (0.75 + 1.25 i, 1.0 + 0.0 i) == 0.75 + 1.25 i": +float: 1 +ifloat: 1 ildouble: 2 ldouble: 2 Test "Real part of: cpow (0.75 + 1.25 i, 1.0 + 1.0 i) == 0.0846958290317209430433805274189191353 + 0.513285749182902449043287190519090481 i": double: 2 -float: 3 +float: 4 idouble: 2 -ifloat: 3 +ifloat: 4 +Test "Imaginary part of: cpow (0.75 + 1.25 i, 1.0 + 1.0 i) == 0.0846958290317209430433805274189191353 + 0.513285749182902449043287190519090481 i": +float: 1 +ifloat: 1 Test "Real part of: cpow (2 + 0 i, 10 + 0 i) == 1024.0 + 0.0 i": ildouble: 1 ldouble: 1 @@ -381,9 +555,21 @@ ldouble: 1 Test "Real part of: csqrt (-2 + 3 i) == 0.89597747612983812471573375529004348 + 1.6741492280355400404480393008490519 i": float: 1 ifloat: 1 +Test "Imaginary part of: csqrt (-2 + 3 i) == 0.89597747612983812471573375529004348 + 1.6741492280355400404480393008490519 i": +float: 1 +ifloat: 1 Test "Real part of: csqrt (-2 - 3 i) == 0.89597747612983812471573375529004348 - 1.6741492280355400404480393008490519 i": float: 1 ifloat: 1 +Test "Imaginary part of: csqrt (-2 - 3 i) == 0.89597747612983812471573375529004348 - 1.6741492280355400404480393008490519 i": +float: 1 +ifloat: 1 +Test "Real part of: csqrt (0 - 1 i) == M_SQRT_2_2 - M_SQRT_2_2 i": +double: 1 +idouble: 1 +Test "Imaginary part of: csqrt (0 - 1 i) == M_SQRT_2_2 - M_SQRT_2_2 i": +double: 1 +idouble: 1 # ctan Test "Real part of: ctan (-2 - 3 i) == 0.376402564150424829275122113032269084e-2 - 1.00323862735360980144635859782192726 i": @@ -474,6 +660,33 @@ Test "exp2 (10) == 1024": ildouble: 2 ldouble: 2 +# exp_downward +Test "exp_downward (2) == e^2": +float: 1 +ifloat: 1 +Test "exp_downward (3) == e^3": +float: 1 +ifloat: 1 +ildouble: 1 +ldouble: 1 + +# exp_towardzero +Test "exp_towardzero (2) == e^2": +float: 1 +ifloat: 1 +Test "exp_towardzero (3) == e^3": +float: 1 +ifloat: 1 +ildouble: 1 +ldouble: 1 + +# exp_upward +Test "exp_upward (1) == e": +float: 1 +ifloat: 1 +ildouble: 1 +ldouble: 1 + # expm1 Test "expm1 (0.75) == 1.11700001661267466854536981983709561": double: 1 @@ -486,31 +699,49 @@ ifloat: 1 # hypot Test "hypot (-0.7, -12.4) == 12.419742348374220601176836866763271": +double: 1 float: 1 +idouble: 1 ifloat: 1 Test "hypot (-0.7, 12.4) == 12.419742348374220601176836866763271": +double: 1 float: 1 +idouble: 1 ifloat: 1 Test "hypot (-12.4, -0.7) == 12.419742348374220601176836866763271": +double: 1 float: 1 +idouble: 1 ifloat: 1 Test "hypot (-12.4, 0.7) == 12.419742348374220601176836866763271": +double: 1 float: 1 +idouble: 1 ifloat: 1 Test "hypot (0.7, -12.4) == 12.419742348374220601176836866763271": +double: 1 float: 1 +idouble: 1 ifloat: 1 Test "hypot (0.7, 12.4) == 12.419742348374220601176836866763271": +double: 1 float: 1 +idouble: 1 ifloat: 1 Test "hypot (0.75, 1.25) == 1.45773797371132511771853821938639577": +float: 1 +ifloat: 1 ildouble: 1 ldouble: 1 Test "hypot (12.4, -0.7) == 12.419742348374220601176836866763271": +double: 1 float: 1 +idouble: 1 ifloat: 1 Test "hypot (12.4, 0.7) == 12.419742348374220601176836866763271": +double: 1 float: 1 +idouble: 1 ifloat: 1 # j0 @@ -529,7 +760,9 @@ ifloat: 1 ildouble: 1 ldouble: 1 Test "j0 (2.0) == 0.223890779141235668051827454649948626": +double: 1 float: 2 +idouble: 1 ifloat: 2 Test "j0 (4.0) == -3.9714980986384737228659076845169804197562E-1": double: 1 @@ -539,7 +772,9 @@ ifloat: 2 ildouble: 1 ldouble: 1 Test "j0 (8.0) == 0.171650807137553906090869407851972001": +double: 1 float: 1 +idouble: 1 ifloat: 1 ildouble: 1 ldouble: 1 @@ -575,7 +810,9 @@ ifloat: 1 ildouble: 1 ldouble: 1 Test "jn (0, 2.0) == 0.223890779141235668051827454649948626": +double: 1 float: 2 +idouble: 1 ifloat: 2 Test "jn (0, 4.0) == -3.9714980986384737228659076845169804197562E-1": double: 1 @@ -585,7 +822,9 @@ ifloat: 2 ildouble: 1 ldouble: 1 Test "jn (0, 8.0) == 0.171650807137553906090869407851972001": +double: 1 float: 1 +idouble: 1 ifloat: 1 ildouble: 1 ldouble: 1 @@ -621,7 +860,9 @@ Test "jn (10, 1.0) == 0.263061512368745320699785368779050294e-9": ildouble: 1 ldouble: 1 Test "jn (10, 10.0) == 0.207486106633358857697278723518753428": +double: 2 float: 1 +idouble: 2 ifloat: 1 ildouble: 4 ldouble: 4 @@ -702,9 +943,9 @@ ifloat: 2 ildouble: 4 ldouble: 4 Test "jn (9, 2.4048255576957729) == 0.12517270977961513005428966643852564E-4": -double: 1 +double: 2 float: 2 -idouble: 1 +idouble: 2 ifloat: 2 ildouble: 7 ldouble: 7 @@ -743,53 +984,308 @@ Test "log2 (e) == M_LOG2El": ildouble: 1 ldouble: 1 +# pow_downward +Test "pow_downward (1.0625, 1.125) == 1.070582293028761362162622578677070098674": +ildouble: 1 +ldouble: 1 +Test "pow_downward (1.5, 1.03125) == 1.519127098714743184071644334163037684948": +float: 1 +ifloat: 1 + +# pow_towardzero +Test "pow_towardzero (1.0625, 1.125) == 1.070582293028761362162622578677070098674": +ildouble: 1 +ldouble: 1 +Test "pow_towardzero (1.5, 1.03125) == 1.519127098714743184071644334163037684948": +float: 1 +ifloat: 1 + +# pow_upward +Test "pow_upward (1.0625, 1.125) == 1.070582293028761362162622578677070098674": +float: 1 +ifloat: 1 +Test "pow_upward (1.5, 1.03125) == 1.519127098714743184071644334163037684948": +ildouble: 1 +ldouble: 1 + # sin Test "sin (16.0) == -0.2879033166650652947844562482186175296207": ildouble: 2 ldouble: 2 -# sincos -Test "sincos (M_PI_6l*2.0, &sin_res, &cos_res) puts 0.5 in cos_res": -double: 1 +# sin_downward +Test "sin_downward (1) == 0.8414709848078965066525023216302989996226": +ildouble: 4 +ldouble: 4 +Test "sin_downward (10) == -0.5440211108893698134047476618513772816836": float: 1 -idouble: 1 ifloat: 1 -Test "sincos (M_PI_6l*2.0, &sin_res, &cos_res) puts 0.86602540378443864676372317075293616 in sin_res": -double: 1 +Test "sin_downward (2) == 0.9092974268256816953960198659117448427023": +ildouble: 1 +ldouble: 1 +Test "sin_downward (3) == 0.1411200080598672221007448028081102798469": float: 1 -idouble: 1 ifloat: 1 -Test "sincos (pi/2, &sin_res, &cos_res) puts 0 in cos_res": -double: 1 +ildouble: 2 +ldouble: 2 +Test "sin_downward (4) == -0.7568024953079282513726390945118290941359": +ildouble: 1 +ldouble: 1 +Test "sin_downward (5) == -0.9589242746631384688931544061559939733525": float: 1 -idouble: 1 ifloat: 1 -Test "sincos (pi/6, &sin_res, &cos_res) puts 0.86602540378443864676372317075293616 in cos_res": +Test "sin_downward (6) == -0.2794154981989258728115554466118947596280": float: 1 ifloat: 1 - -# sinh -Test "sinh (0.75) == 0.822316731935829980703661634446913849": +ildouble: 2 +ldouble: 2 +Test "sin_downward (8) == 0.9893582466233817778081235982452886721164": ildouble: 1 ldouble: 1 -# tan -Test "tan (pi/4) == 1": -double: 1 -idouble: 1 -ildouble: 1 -ldouble: 1 +# sin_tonearest +Test "sin_tonearest (1) == 0.8414709848078965066525023216302989996226": +float: 1 +ifloat: 1 -# tanh -Test "tanh (-0.75) == -0.635148952387287319214434357312496495": +# sin_towardzero +Test "sin_towardzero (1) == 0.8414709848078965066525023216302989996226": +float: 1 +ifloat: 1 +ildouble: 2 +ldouble: 2 +Test "sin_towardzero (10) == -0.5440211108893698134047476618513772816836": +float: 1 +ifloat: 1 +Test "sin_towardzero (2) == 0.9092974268256816953960198659117448427023": ildouble: 1 ldouble: 1 -Test "tanh (0.75) == 0.635148952387287319214434357312496495": +Test "sin_towardzero (3) == 0.1411200080598672221007448028081102798469": ildouble: 1 ldouble: 1 - -# tgamma -Test "tgamma (-0.5) == -2 sqrt (pi)": +Test "sin_towardzero (4) == -0.7568024953079282513726390945118290941359": +float: 1 +ifloat: 1 +Test "sin_towardzero (5) == -0.9589242746631384688931544061559939733525": +float: 1 +ifloat: 1 +Test "sin_towardzero (8) == 0.9893582466233817778081235982452886721164": +ildouble: 1 +ldouble: 1 +Test "sin_towardzero (9) == 0.4121184852417565697562725663524351793439": +float: 1 +ifloat: 1 +ildouble: 1 +ldouble: 1 + +# sin_upward +Test "sin_upward (1) == 0.8414709848078965066525023216302989996226": +float: 1 +ifloat: 1 +ildouble: 2 +ldouble: 2 +Test "sin_upward (2) == 0.9092974268256816953960198659117448427023": +float: 2 +ifloat: 2 +Test "sin_upward (3) == 0.1411200080598672221007448028081102798469": +ildouble: 1 +ldouble: 1 +Test "sin_upward (4) == -0.7568024953079282513726390945118290941359": +float: 1 +ifloat: 1 +ildouble: 1 +ldouble: 1 +Test "sin_upward (6) == -0.2794154981989258728115554466118947596280": +ildouble: 1 +ldouble: 1 +Test "sin_upward (9) == 0.4121184852417565697562725663524351793439": +float: 1 +ifloat: 1 + +# sincos +Test "sincos (M_PI_6l*2.0, &sin_res, &cos_res) puts 0.5 in cos_res": +double: 1 +float: 1 +idouble: 1 +ifloat: 1 +Test "sincos (M_PI_6l*2.0, &sin_res, &cos_res) puts 0.86602540378443864676372317075293616 in sin_res": +double: 1 +float: 1 +idouble: 1 +ifloat: 1 +Test "sincos (pi/2, &sin_res, &cos_res) puts 0 in cos_res": +double: 1 +float: 1 +idouble: 1 +ifloat: 1 +Test "sincos (pi/6, &sin_res, &cos_res) puts 0.86602540378443864676372317075293616 in cos_res": +float: 1 +ifloat: 1 + +# sinh +Test "sinh (0.75) == 0.822316731935829980703661634446913849": +ildouble: 1 +ldouble: 1 + +# sinh_downward +Test "sinh_downward (22) == 1792456423.065795780701106568345764104225": +float: 1 +ifloat: 1 +ildouble: 2 +ldouble: 2 +Test "sinh_downward (23) == 4872401723.124451299966006944252978187305": +float: 1 +ifloat: 1 +Test "sinh_downward (24) == 13244561064.92173614705070540368454568168": +float: 1 +ifloat: 1 +ildouble: 1 +ldouble: 1 + +# sinh_towardzero +Test "sinh_towardzero (22) == 1792456423.065795780701106568345764104225": +float: 1 +ifloat: 1 +ildouble: 2 +ldouble: 2 +Test "sinh_towardzero (23) == 4872401723.124451299966006944252978187305": +float: 1 +ifloat: 1 +Test "sinh_towardzero (24) == 13244561064.92173614705070540368454568168": +float: 1 +ifloat: 1 +ildouble: 1 +ldouble: 1 + +# sinh_upward +Test "sinh_upward (23) == 4872401723.124451299966006944252978187305": +ildouble: 1 +ldouble: 1 +Test "sinh_upward (24) == 13244561064.92173614705070540368454568168": +ildouble: 1 +ldouble: 1 + +# sqrt +Test "sqrt (0.75) == 0.866025403784438646763723170752936183": +double: 1 +idouble: 1 +Test "sqrt (2) == M_SQRT2l": +double: 1 +idouble: 1 + +# tan +Test "tan (pi/4) == 1": +double: 1 +idouble: 1 +ildouble: 1 +ldouble: 1 + +# tan_downward +Test "tan_downward (1) == 1.5574077246549022305069748074583601730873": +float: 1 +ifloat: 1 +ildouble: 2 +ldouble: 2 +Test "tan_downward (10) == 0.6483608274590866712591249330098086768169": +float: 1 +ifloat: 1 +ildouble: 2 +ldouble: 2 +Test "tan_downward (2) == -2.1850398632615189916433061023136825434320": +float: 1 +ifloat: 1 +ildouble: 1 +ldouble: 1 +Test "tan_downward (6) == -0.2910061913847491570536995888681755428312": +float: 1 +ifloat: 1 +ildouble: 1 +ldouble: 1 +Test "tan_downward (8) == -6.7997114552203786999252627596086333648814": +float: 1 +ifloat: 1 +Test "tan_downward (9) == -0.4523156594418098405903708757987855343087": +float: 1 +ifloat: 1 +ildouble: 1 +ldouble: 1 + +# tan_tonearest +Test "tan_tonearest (10) == 0.6483608274590866712591249330098086768169": +ildouble: 1 +ldouble: 1 +Test "tan_tonearest (4) == 1.1578212823495775831373424182673239231198": +ildouble: 1 +ldouble: 1 +Test "tan_tonearest (7) == 0.8714479827243187364564508896003135663222": +ildouble: 1 +ldouble: 1 + +# tan_towardzero +Test "tan_towardzero (10) == 0.6483608274590866712591249330098086768169": +float: 1 +ifloat: 1 +ildouble: 2 +ldouble: 2 +Test "tan_towardzero (3) == -0.1425465430742778052956354105339134932261": +float: 1 +ifloat: 1 +ildouble: 3 +ldouble: 3 +Test "tan_towardzero (4) == 1.1578212823495775831373424182673239231198": +float: 1 +ifloat: 1 +ildouble: 1 +ldouble: 1 +Test "tan_towardzero (5) == -3.3805150062465856369827058794473439087096": +float: 1 +ifloat: 1 +Test "tan_towardzero (6) == -0.2910061913847491570536995888681755428312": +ildouble: 1 +ldouble: 1 +Test "tan_towardzero (7) == 0.8714479827243187364564508896003135663222": +ildouble: 2 +ldouble: 2 +Test "tan_towardzero (9) == -0.4523156594418098405903708757987855343087": +float: 1 +ifloat: 1 +ildouble: 1 +ldouble: 1 + +# tan_upward +Test "tan_upward (10) == 0.6483608274590866712591249330098086768169": +ildouble: 1 +ldouble: 1 +Test "tan_upward (3) == -0.1425465430742778052956354105339134932261": +float: 1 +ifloat: 1 +ildouble: 3 +ldouble: 3 +Test "tan_upward (5) == -3.3805150062465856369827058794473439087096": +float: 1 +ifloat: 1 +ildouble: 1 +ldouble: 1 +Test "tan_upward (6) == -0.2910061913847491570536995888681755428312": +ildouble: 1 +ldouble: 1 +Test "tan_upward (7) == 0.8714479827243187364564508896003135663222": +ildouble: 1 +ldouble: 1 +Test "tan_upward (9) == -0.4523156594418098405903708757987855343087": +ildouble: 1 +ldouble: 1 + +# tanh +Test "tanh (-0.75) == -0.635148952387287319214434357312496495": +ildouble: 1 +ldouble: 1 +Test "tanh (0.75) == 0.635148952387287319214434357312496495": +ildouble: 1 +ldouble: 1 + +# tgamma +Test "tgamma (-0.5) == -2 sqrt (pi)": double: 1 float: 1 idouble: 1 @@ -855,7 +1351,7 @@ ifloat: 1 ildouble: 2 ldouble: 2 Test "y1 (2.0) == -0.107032431540937546888370772277476637": -double: 1 +double: 2 float: 1 idouble: 2 ifloat: 2 @@ -917,9 +1413,9 @@ ifloat: 1 ildouble: 2 ldouble: 2 Test "yn (1, 2.0) == -0.107032431540937546888370772277476637": -double: 1 +double: 2 float: 1 -idouble: 1 +idouble: 2 ifloat: 1 Test "yn (1, 8.0) == -0.158060461731247494255555266187483550": double: 1 @@ -998,6 +1494,8 @@ float: 1 ifloat: 1 Function: "cabs": +float: 1 +ifloat: 1 ildouble: 1 ldouble: 1 @@ -1120,8 +1618,8 @@ ildouble: 1 ldouble: 1 Function: Real part of "clog": -float: 1 -ifloat: 1 +float: 2 +ifloat: 2 ildouble: 2 ldouble: 2 @@ -1132,16 +1630,18 @@ ildouble: 1 ldouble: 1 Function: Real part of "clog10": -float: 1 -ifloat: 1 +double: 1 +float: 2 +idouble: 1 +ifloat: 2 ildouble: 3 ldouble: 3 Function: Imaginary part of "clog10": double: 1 -float: 5 +float: 1 idouble: 1 -ifloat: 5 +ifloat: 1 ildouble: 1 ldouble: 1 @@ -1153,10 +1653,54 @@ ifloat: 1 ildouble: 1 ldouble: 1 +Function: "cos_downward": +float: 1 +ifloat: 1 +ildouble: 4 +ldouble: 4 + +Function: "cos_tonearest": +float: 1 +ifloat: 1 +ildouble: 1 +ldouble: 1 + +Function: "cos_towardzero": +float: 1 +ifloat: 1 +ildouble: 2 +ldouble: 2 + +Function: "cos_upward": +float: 2 +ifloat: 2 +ildouble: 2 +ldouble: 2 + Function: "cosh": ildouble: 1 ldouble: 1 +Function: "cosh_downward": +float: 1 +ifloat: 1 +ildouble: 1 +ldouble: 1 + +Function: "cosh_tonearest": +ildouble: 1 +ldouble: 1 + +Function: "cosh_towardzero": +float: 1 +ifloat: 1 +ildouble: 1 +ldouble: 1 + +Function: "cosh_upward": +ildouble: 2 +ldouble: 2 + Function: Real part of "cpow": double: 2 float: 5 @@ -1196,12 +1740,18 @@ ildouble: 1 ldouble: 1 Function: Real part of "csqrt": +double: 1 float: 1 +idouble: 1 ifloat: 1 ildouble: 1 ldouble: 1 Function: Imaginary part of "csqrt": +double: 1 +float: 1 +idouble: 1 +ifloat: 1 ildouble: 1 ldouble: 1 @@ -1261,6 +1811,28 @@ Function: "exp2": ildouble: 2 ldouble: 2 +Function: "exp_downward": +float: 1 +ifloat: 1 +ildouble: 1 +ldouble: 1 + +Function: "exp_tonearest": +ildouble: 1 +ldouble: 1 + +Function: "exp_towardzero": +float: 1 +ifloat: 1 +ildouble: 1 +ldouble: 1 + +Function: "exp_upward": +float: 1 +ifloat: 1 +ildouble: 1 +ldouble: 1 + Function: "expm1": double: 1 float: 1 @@ -1272,7 +1844,9 @@ ildouble: 1 ldouble: 1 Function: "hypot": +double: 1 float: 1 +idouble: 1 ifloat: 1 ildouble: 1 ldouble: 1 @@ -1335,10 +1909,52 @@ Function: "pow": ildouble: 1 ldouble: 1 +Function: "pow_downward": +float: 1 +ifloat: 1 +ildouble: 1 +ldouble: 1 + +Function: "pow_towardzero": +float: 1 +ifloat: 1 +ildouble: 1 +ldouble: 1 + +Function: "pow_upward": +float: 1 +ifloat: 1 +ildouble: 1 +ldouble: 1 + Function: "sin": ildouble: 1 ldouble: 1 +Function: "sin_downward": +float: 1 +ifloat: 1 +ildouble: 4 +ldouble: 4 + +Function: "sin_tonearest": +float: 1 +ifloat: 1 +ildouble: 1 +ldouble: 1 + +Function: "sin_towardzero": +float: 1 +ifloat: 1 +ildouble: 2 +ldouble: 2 + +Function: "sin_upward": +float: 2 +ifloat: 2 +ildouble: 2 +ldouble: 2 + Function: "sincos": double: 1 float: 1 @@ -1351,12 +1967,58 @@ Function: "sinh": ildouble: 1 ldouble: 1 +Function: "sinh_downward": +float: 1 +ifloat: 1 +ildouble: 2 +ldouble: 2 + +Function: "sinh_tonearest": +ildouble: 1 +ldouble: 1 + +Function: "sinh_towardzero": +float: 1 +ifloat: 1 +ildouble: 2 +ldouble: 2 + +Function: "sinh_upward": +ildouble: 1 +ldouble: 1 + +Function: "sqrt": +double: 1 +idouble: 1 + Function: "tan": double: 1 idouble: 1 ildouble: 1 ldouble: 1 +Function: "tan_downward": +float: 1 +ifloat: 1 +ildouble: 2 +ldouble: 2 + +Function: "tan_tonearest": +ildouble: 1 +ldouble: 1 + +Function: "tan_towardzero": +float: 1 +ifloat: 1 +ildouble: 3 +ldouble: 3 + +Function: "tan_upward": +float: 1 +ifloat: 1 +ildouble: 3 +ldouble: 3 + Function: "tanh": ildouble: 1 ldouble: 1 diff --git a/libc/sysdeps/sparc/fpu/libm-test-ulps b/libc/sysdeps/sparc/fpu/libm-test-ulps index 71937cbc6..178c1971b 100644 --- a/libc/sysdeps/sparc/fpu/libm-test-ulps +++ b/libc/sysdeps/sparc/fpu/libm-test-ulps @@ -415,6 +415,28 @@ ifloat: 2 ildouble: 1 ldouble: 1 +# cosh_downward +Test "cosh_downward (22) == 1792456423.065795780980053377632656584997": +float: 1 +ifloat: 1 +Test "cosh_downward (23) == 4872401723.124451300068625740569997090344": +float: 1 +ifloat: 1 +Test "cosh_downward (24) == 13244561064.92173614708845674912733665919": +float: 1 +ifloat: 1 + +# cosh_towardzero +Test "cosh_towardzero (22) == 1792456423.065795780980053377632656584997": +float: 1 +ifloat: 1 +Test "cosh_towardzero (23) == 4872401723.124451300068625740569997090344": +float: 1 +ifloat: 1 +Test "cosh_towardzero (24) == 13244561064.92173614708845674912733665919": +float: 1 +ifloat: 1 + # cpow Test "Real part of: cpow (0.75 + 1.25 i, 0.0 + 1.0 i) == 0.331825439177608832276067945276730566 + 0.131338600281188544930936345230903032 i": float: 1 @@ -918,6 +940,21 @@ Test "log2 (0.75) == -.415037499278843818546261056052183492": ildouble: 1 ldouble: 1 +# pow_downward +Test "pow_downward (1.5, 1.03125) == 1.519127098714743184071644334163037684948": +float: 1 +ifloat: 1 + +# pow_towardzero +Test "pow_towardzero (1.5, 1.03125) == 1.519127098714743184071644334163037684948": +float: 1 +ifloat: 1 + +# pow_upward +Test "pow_upward (1.0625, 1.125) == 1.070582293028761362162622578677070098674": +float: 1 +ifloat: 1 + # sin_downward Test "sin_downward (1) == 0.8414709848078965066525023216302989996226": ildouble: 1 @@ -1054,6 +1091,28 @@ Test "sincos (pi/6, &sin_res, &cos_res) puts 0.866025403784438646763723170752936 float: 1 ifloat: 1 +# sinh_downward +Test "sinh_downward (22) == 1792456423.065795780701106568345764104225": +float: 1 +ifloat: 1 +Test "sinh_downward (23) == 4872401723.124451299966006944252978187305": +float: 1 +ifloat: 1 +Test "sinh_downward (24) == 13244561064.92173614705070540368454568168": +float: 1 +ifloat: 1 + +# sinh_towardzero +Test "sinh_towardzero (22) == 1792456423.065795780701106568345764104225": +float: 1 +ifloat: 1 +Test "sinh_towardzero (23) == 4872401723.124451299966006944252978187305": +float: 1 +ifloat: 1 +Test "sinh_towardzero (24) == 13244561064.92173614705070540368454568168": +float: 1 +ifloat: 1 + # sqrt Test "sqrt (2) == M_SQRT2l": ildouble: 1 @@ -1524,6 +1583,14 @@ ifloat: 2 ildouble: 1 ldouble: 1 +Function: "cosh_downward": +float: 1 +ifloat: 1 + +Function: "cosh_towardzero": +float: 1 +ifloat: 1 + Function: Real part of "cpow": double: 2 float: 4 @@ -1704,6 +1771,18 @@ Function: "log2": ildouble: 1 ldouble: 1 +Function: "pow_downward": +float: 1 +ifloat: 1 + +Function: "pow_towardzero": +float: 1 +ifloat: 1 + +Function: "pow_upward": +float: 1 +ifloat: 1 + Function: "sin_downward": float: 1 ifloat: 1 @@ -1736,6 +1815,14 @@ ifloat: 1 ildouble: 1 ldouble: 1 +Function: "sinh_downward": +float: 1 +ifloat: 1 + +Function: "sinh_towardzero": +float: 1 +ifloat: 1 + Function: "sqrt": ildouble: 1 ldouble: 1 diff --git a/libc/sysdeps/sparc/sparc32/sparcv9/fpu/s_llrint.S b/libc/sysdeps/sparc/sparc32/sparcv9/fpu/s_llrint.S new file mode 100644 index 000000000..8ec9b4dcb --- /dev/null +++ b/libc/sysdeps/sparc/sparc32/sparcv9/fpu/s_llrint.S @@ -0,0 +1,67 @@ +/* llrint(), sparc32 v9 version. + Copyright (C) 2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by David S. Miller , 2012. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include + + /* We pop constants into the FPU registers using the incoming + argument stack slots, since this avoid having to use any PIC + references. We also thus avoid having to allocate a register + window. + + VIS instructions are used to facilitate the formation of + easier constants, and the propagation of the sign bit. */ + +#define TWO_FIFTYTWO 0x43300000 /* 2**52 */ + +#define ZERO %f10 /* 0.0 */ +#define SIGN_BIT %f12 /* -0.0 */ + +ENTRY (__llrint) + sethi %hi(TWO_FIFTYTWO), %o2 + sllx %o0, 32, %o0 + + or %o0, %o1, %o0 + fzero ZERO + + stx %o0, [%sp + 72] + sllx %o2, 32, %o2 + fnegd ZERO, SIGN_BIT + + ldd [%sp + 72], %f0 + + stx %o2, [%sp + 72] + fabsd %f0, %f14 + + ldd [%sp + 72], %f16 + fcmpd %fcc3, %f14, %f16 + + fmovduge %fcc3, ZERO, %f16 + fand %f0, SIGN_BIT, SIGN_BIT + + for %f16, SIGN_BIT, %f16 + faddd %f0, %f16, %f6 + fsubd %f6, %f16, %f0 + fabsd %f0, %f0 + for %f0, SIGN_BIT, %f0 + fdtox %f0, %f4 + std %f4, [%sp + 72] + retl + ldd [%sp + 72], %o0 +END (__llrint) +weak_alias (__llrint, llrint) diff --git a/libc/sysdeps/sparc/sparc32/sparcv9/fpu/s_llrintf.S b/libc/sysdeps/sparc/sparc32/sparcv9/fpu/s_llrintf.S new file mode 100644 index 000000000..73e9d6487 --- /dev/null +++ b/libc/sysdeps/sparc/sparc32/sparcv9/fpu/s_llrintf.S @@ -0,0 +1,62 @@ +/* llrintf(), sparc32 v9 version. + Copyright (C) 2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by David S. Miller , 2012. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include + + /* We pop constants into the FPU registers using the incoming + argument stack slots, since this avoid having to use any PIC + references. We also thus avoid having to allocate a register + window. + + VIS instructions are used to facilitate the formation of + easier constants, and the propagation of the sign bit. */ + +#define TWO_TWENTYTHREE 0x4b000000 /* 2**23 */ + +#define ZERO %f10 /* 0.0 */ +#define SIGN_BIT %f12 /* -0.0 */ + +ENTRY (__llrintf) + st %o0, [%sp + 68] + sethi %hi(TWO_TWENTYTHREE), %o2 + fzeros ZERO + + ld [%sp + 68], %f1 + fnegs ZERO, SIGN_BIT + + st %o2, [%sp + 68] + fabss %f1, %f14 + + ld [%sp + 68], %f16 + fcmps %fcc3, %f14, %f16 + + fmovsuge %fcc3, ZERO, %f16 + fands %f1, SIGN_BIT, SIGN_BIT + + fors %f16, SIGN_BIT, %f16 + fadds %f1, %f16, %f5 + fsubs %f5, %f16, %f0 + fabss %f0, %f0 + fors %f0, SIGN_BIT, %f0 + fstox %f0, %f4 + std %f4, [%sp + 72] + retl + ldd [%sp + 72], %o0 +END (__llrintf) +weak_alias (__llrintf, llrintf) diff --git a/libc/sysdeps/sparc/sparc32/sparcv9/fpu/s_lrint.S b/libc/sysdeps/sparc/sparc32/sparcv9/fpu/s_lrint.S new file mode 100644 index 000000000..062faba17 --- /dev/null +++ b/libc/sysdeps/sparc/sparc32/sparcv9/fpu/s_lrint.S @@ -0,0 +1,67 @@ +/* lrint(), sparc32 v9 version. + Copyright (C) 2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by David S. Miller , 2012. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include + + /* We pop constants into the FPU registers using the incoming + argument stack slots, since this avoid having to use any PIC + references. We also thus avoid having to allocate a register + window. + + VIS instructions are used to facilitate the formation of + easier constants, and the propagation of the sign bit. */ + +#define TWO_FIFTYTWO 0x43300000 /* 2**52 */ + +#define ZERO %f10 /* 0.0 */ +#define SIGN_BIT %f12 /* -0.0 */ + +ENTRY (__lrint) + sethi %hi(TWO_FIFTYTWO), %o2 + sllx %o0, 32, %o0 + + or %o0, %o1, %o0 + fzero ZERO + + stx %o0, [%sp + 72] + sllx %o2, 32, %o2 + fnegd ZERO, SIGN_BIT + + ldd [%sp + 72], %f0 + + stx %o2, [%sp + 72] + fabsd %f0, %f14 + + ldd [%sp + 72], %f16 + fcmpd %fcc3, %f14, %f16 + + fmovduge %fcc3, ZERO, %f16 + fand %f0, SIGN_BIT, SIGN_BIT + + for %f16, SIGN_BIT, %f16 + faddd %f0, %f16, %f6 + fsubd %f6, %f16, %f0 + fabsd %f0, %f0 + for %f0, SIGN_BIT, %f0 + fdtoi %f0, %f3 + st %f3, [%sp + 72] + retl + ld [%sp + 72], %o0 +END (__lrint) +weak_alias (__lrint, lrint) diff --git a/libc/sysdeps/sparc/sparc32/sparcv9/fpu/s_lrintf.S b/libc/sysdeps/sparc/sparc32/sparcv9/fpu/s_lrintf.S new file mode 100644 index 000000000..c546e67c2 --- /dev/null +++ b/libc/sysdeps/sparc/sparc32/sparcv9/fpu/s_lrintf.S @@ -0,0 +1,62 @@ +/* lrintf(), sparc32 v9 version. + Copyright (C) 2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by David S. Miller , 2012. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include + + /* We pop constants into the FPU registers using the incoming + argument stack slots, since this avoid having to use any PIC + references. We also thus avoid having to allocate a register + window. + + VIS instructions are used to facilitate the formation of + easier constants, and the propagation of the sign bit. */ + +#define TWO_TWENTYTHREE 0x4b000000 /* 2**23 */ + +#define ZERO %f10 /* 0.0 */ +#define SIGN_BIT %f12 /* -0.0 */ + +ENTRY (__lrintf) + st %o0, [%sp + 68] + sethi %hi(TWO_TWENTYTHREE), %o2 + fzeros ZERO + + ld [%sp + 68], %f1 + fnegs ZERO, SIGN_BIT + + st %o2, [%sp + 68] + fabss %f1, %f14 + + ld [%sp + 68], %f16 + fcmps %fcc3, %f14, %f16 + + fmovsuge %fcc3, ZERO, %f16 + fands %f1, SIGN_BIT, SIGN_BIT + + fors %f16, SIGN_BIT, %f16 + fadds %f1, %f16, %f5 + fsubs %f5, %f16, %f0 + fabss %f0, %f0 + fors %f0, SIGN_BIT, %f0 + fstoi %f0, %f3 + st %f3, [%sp + 68] + retl + ld [%sp + 68], %o0 +END (__lrintf) +weak_alias (__lrintf, lrintf) diff --git a/libc/sysdeps/sparc/sparc64/fpu/s_llrint.S b/libc/sysdeps/sparc/sparc64/fpu/s_llrint.S new file mode 100644 index 000000000..7c8e941b7 --- /dev/null +++ b/libc/sysdeps/sparc/sparc64/fpu/s_llrint.S @@ -0,0 +1 @@ +/* llrint is implemented in s_lrint.S */ diff --git a/libc/sysdeps/sparc/sparc64/fpu/s_llrintf.S b/libc/sysdeps/sparc/sparc64/fpu/s_llrintf.S new file mode 100644 index 000000000..abab3b9a2 --- /dev/null +++ b/libc/sysdeps/sparc/sparc64/fpu/s_llrintf.S @@ -0,0 +1 @@ +/* llrintf is implemented in s_lrint.S */ diff --git a/libc/sysdeps/sparc/sparc64/fpu/s_lrint.S b/libc/sysdeps/sparc/sparc64/fpu/s_lrint.S new file mode 100644 index 000000000..6bf56e4d0 --- /dev/null +++ b/libc/sysdeps/sparc/sparc64/fpu/s_lrint.S @@ -0,0 +1,63 @@ +/* lrint(), sparc64 version. + Copyright (C) 2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by David S. Miller , 2012. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include + + /* We pop constants into the FPU registers using the incoming + argument stack slots, since this avoid having to use any PIC + references. We also thus avoid having to allocate a register + window. + + VIS instructions are used to facilitate the formation of + easier constants, and the propagation of the sign bit. */ + +#define TWO_FIFTYTWO 0x43300000 /* 2**52 */ + +#define ZERO %f10 /* 0.0 */ +#define SIGN_BIT %f12 /* -0.0 */ + +ENTRY (__lrint) + sethi %hi(TWO_FIFTYTWO), %o2 + sllx %o2, 32, %o2 + fzero ZERO + + fnegd ZERO, SIGN_BIT + stx %o2, [%sp + STACK_BIAS + 128] + fabsd %f0, %f14 + + ldd [%sp + STACK_BIAS + 128], %f16 + fcmpd %fcc3, %f14, %f16 + + fmovduge %fcc3, ZERO, %f16 + fand %f0, SIGN_BIT, SIGN_BIT + + for %f16, SIGN_BIT, %f16 + faddd %f0, %f16, %f6 + fsubd %f6, %f16, %f0 + fabsd %f0, %f0 + for %f0, SIGN_BIT, %f0 + fdtox %f0, %f4 + std %f4, [%sp + STACK_BIAS + 128] + retl + ldx [%sp + STACK_BIAS + 128], %o0 +END (__lrint) +weak_alias (__lrint, lrint) + +strong_alias (__lrint, __llrint) +weak_alias (__llrint, llrint) diff --git a/libc/sysdeps/sparc/sparc64/fpu/s_lrintf.S b/libc/sysdeps/sparc/sparc64/fpu/s_lrintf.S new file mode 100644 index 000000000..2f2938b98 --- /dev/null +++ b/libc/sysdeps/sparc/sparc64/fpu/s_lrintf.S @@ -0,0 +1,62 @@ +/* lrintf(), sparc64 version. + Copyright (C) 2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by David S. Miller , 2012. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include + + /* We pop constants into the FPU registers using the incoming + argument stack slots, since this avoid having to use any PIC + references. We also thus avoid having to allocate a register + window. + + VIS instructions are used to facilitate the formation of + easier constants, and the propagation of the sign bit. */ + +#define TWO_TWENTYTHREE 0x4b000000 /* 2**23 */ + +#define ZERO %f10 /* 0.0 */ +#define SIGN_BIT %f12 /* -0.0 */ + +ENTRY (__lrintf) + sethi %hi(TWO_TWENTYTHREE), %o2 + fzeros ZERO + + fnegs ZERO, SIGN_BIT + st %o2, [%sp + STACK_BIAS + 128] + fabss %f1, %f14 + + ld [%sp + STACK_BIAS + 128], %f16 + fcmps %fcc3, %f14, %f16 + + fmovsuge %fcc3, ZERO, %f16 + fands %f1, SIGN_BIT, SIGN_BIT + + fors %f16, SIGN_BIT, %f16 + fadds %f1, %f16, %f5 + fsubs %f5, %f16, %f0 + fabss %f0, %f0 + fors %f0, SIGN_BIT, %f0 + fstox %f0, %f4 + std %f4, [%sp + STACK_BIAS + 128] + retl + ldx [%sp + STACK_BIAS + 128], %o0 +END (__lrintf) +weak_alias (__lrintf, lrintf) + +strong_alias (__lrintf, __llrintf) +weak_alias (__llrintf, llrintf) diff --git a/libc/sysdeps/unix/sysv/linux/dl-osinfo.h b/libc/sysdeps/unix/sysv/linux/dl-osinfo.h index 874660be1..780b20ab6 100644 --- a/libc/sysdeps/unix/sysv/linux/dl-osinfo.h +++ b/libc/sysdeps/unix/sysv/linux/dl-osinfo.h @@ -84,8 +84,8 @@ _dl_setup_stack_chk_guard (void *dl_random) return ret.num; } # endif - ret.bytes[filllen - 2] = 255; - ret.bytes[filllen - 3] = '\n'; + ret.bytes[filllen] = 255; + ret.bytes[filllen - 1] = '\n'; } else #endif diff --git a/libc/sysdeps/unix/sysv/linux/sparc/sparc64/get_clockfreq.c b/libc/sysdeps/unix/sysv/linux/sparc/sparc64/get_clockfreq.c index e181d9d36..ba44a61c8 100644 --- a/libc/sysdeps/unix/sysv/linux/sparc/sparc64/get_clockfreq.c +++ b/libc/sysdeps/unix/sysv/linux/sparc/sparc64/get_clockfreq.c @@ -154,6 +154,22 @@ __get_clockfreq_via_proc_openprom (void) return result; } +static void set_obp_int (struct openpromio *op, int val) +{ + char *cp = op->oprom_array; + int *ip = (int *) cp; + + *ip = val; +} + +static int get_obp_int (struct openpromio *op) +{ + char *cp = op->oprom_array; + int *ip = (int *) cp; + + return *ip; +} + static hp_timing_t __get_clockfreq_via_dev_openprom (void) { @@ -171,11 +187,11 @@ __get_clockfreq_via_dev_openprom (void) obp_cmd->oprom_size = sizeof (obp_buf) - sizeof (unsigned int); - *(int *) obp_cmd->oprom_array = 0; + set_obp_int (obp_cmd, 0); ret = ioctl (obp_dev_fd, OPROMCHILD, (char *) obp_cmd); if (ret == 0) { - int cur_node = *(int *) obp_cmd->oprom_array; + int cur_node = get_obp_int (obp_cmd); while (cur_node != 0 && cur_node != -1) { @@ -190,15 +206,14 @@ __get_clockfreq_via_dev_openprom (void) strcpy (obp_cmd->oprom_array, "clock-frequency"); ret = ioctl (obp_dev_fd, OPROMGETPROP, (char *) obp_cmd); if (ret == 0) - result = - (hp_timing_t) *(unsigned int *) obp_cmd->oprom_array; + result = (hp_timing_t) get_obp_int (obp_cmd); } obp_cmd->oprom_size = sizeof (obp_buf) - sizeof (unsigned int); - *(int *) obp_cmd->oprom_array = cur_node; + set_obp_int (obp_cmd, cur_node); ret = ioctl (obp_dev_fd, OPROMNEXT, (char *) obp_cmd); if (ret < 0) break; - cur_node = *(int *)obp_cmd->oprom_array; + cur_node = get_obp_int (obp_cmd); } } } diff --git a/libc/sysdeps/unix/sysv/linux/sparc/sysdep.h b/libc/sysdeps/unix/sysv/linux/sparc/sysdep.h index 336c8538b..30144b9f6 100644 --- a/libc/sysdeps/unix/sysv/linux/sparc/sysdep.h +++ b/libc/sysdeps/unix/sysv/linux/sparc/sysdep.h @@ -23,7 +23,7 @@ #define INLINE_SYSCALL(name, nr, args...) \ ({ INTERNAL_SYSCALL_DECL(err); \ unsigned int resultvar = INTERNAL_SYSCALL(name, err, nr, args); \ - if (__builtin_expect (INTERNAL_SYSCALL_ERROR_P (resultvar, err), 0)) \ + if (INTERNAL_SYSCALL_ERROR_P (resultvar, err)) \ { \ __set_errno (INTERNAL_SYSCALL_ERRNO (resultvar, err)); \ resultvar = 0xffffffff; \ @@ -44,7 +44,8 @@ inline_syscall##nr(__SYSCALL_STRING, err, name, args) #undef INTERNAL_SYSCALL_ERROR_P -#define INTERNAL_SYSCALL_ERROR_P(val, err) ((err) != 0) +#define INTERNAL_SYSCALL_ERROR_P(val, err) \ + ((void) (val), __builtin_expect((err) != 0, 0)) #undef INTERNAL_SYSCALL_ERRNO #define INTERNAL_SYSCALL_ERRNO(val, err) (-(val)) @@ -152,7 +153,7 @@ "0" (__g1), "1" (__o0), "2" (__o1), \ "r" (__o2), "r" (__o3), "r" (__o4) : \ __SYSCALL_CLOBBERS); \ - if (__builtin_expect (INTERNAL_SYSCALL_ERROR_P (__o0, __g1), 0)) \ + if (INTERNAL_SYSCALL_ERROR_P (__o0, __g1)) \ { \ __set_errno (INTERNAL_SYSCALL_ERRNO (__o0, __g1)); \ __o0 = -1L; \ diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/gettimeofday.c b/libc/sysdeps/unix/sysv/linux/x86_64/gettimeofday.c index a13948b10..e41fddb29 100644 --- a/libc/sysdeps/unix/sysv/linux/x86_64/gettimeofday.c +++ b/libc/sysdeps/unix/sysv/linux/x86_64/gettimeofday.c @@ -30,7 +30,7 @@ gettimeofday_ifunc (void) PREPARE_VERSION (linux26, "LINUX_2.6", 61765110); /* If the vDSO is not available we fall back on the old vsyscall. */ - return (_dl_vdso_vsym ("gettimeofday", &linux26) + return (_dl_vdso_vsym ("__vdso_gettimeofday", &linux26) ?: (void *) VSYSCALL_ADDR_vgettimeofday); } __asm (".type __gettimeofday, %gnu_indirect_function"); diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/init-first.c b/libc/sysdeps/unix/sysv/linux/x86_64/init-first.c index 0a9948b3f..e8b52eacb 100644 --- a/libc/sysdeps/unix/sysv/linux/x86_64/init-first.c +++ b/libc/sysdeps/unix/sysv/linux/x86_64/init-first.c @@ -36,13 +36,13 @@ _libc_vdso_platform_setup (void) { PREPARE_VERSION (linux26, "LINUX_2.6", 61765110); - void *p = _dl_vdso_vsym ("clock_gettime", &linux26); + void *p = _dl_vdso_vsym ("__vdso_clock_gettime", &linux26); if (p == NULL) p = __syscall_clock_gettime; PTR_MANGLE (p); __GI___vdso_clock_gettime = p; - p = _dl_vdso_vsym ("getcpu", &linux26); + p = _dl_vdso_vsym ("__vdso_getcpu", &linux26); /* If the vDSO is not available we fall back on the old vsyscall. */ #define VSYSCALL_ADDR_vgetcpu 0xffffffffff600800 if (p == NULL) diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/time.c b/libc/sysdeps/unix/sysv/linux/x86_64/time.c index 67afff306..0e05ddd52 100644 --- a/libc/sysdeps/unix/sysv/linux/x86_64/time.c +++ b/libc/sysdeps/unix/sysv/linux/x86_64/time.c @@ -28,7 +28,7 @@ time_ifunc (void) PREPARE_VERSION (linux26, "LINUX_2.6", 61765110); /* If the vDSO is not available we fall back on the old vsyscall. */ - return _dl_vdso_vsym ("time", &linux26) ?: (void *) VSYSCALL_ADDR_vtime; + return _dl_vdso_vsym ("__vdso_time", &linux26) ?: (void *) VSYSCALL_ADDR_vtime; } __asm (".type time, %gnu_indirect_function"); diff --git a/libc/sysdeps/x86_64/bits/atomic.h b/libc/sysdeps/x86_64/bits/atomic.h index 4a0d40b34..4b8d2ab09 100644 --- a/libc/sysdeps/x86_64/bits/atomic.h +++ b/libc/sysdeps/x86_64/bits/atomic.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2004, 2006, 2007, 2009 Free Software Foundation, Inc. +/* Copyright (C) 2002-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 2002. @@ -55,41 +55,10 @@ typedef uintmax_t uatomic_max_t; #endif -#if __GNUC_PREREQ (4, 1) -# define atomic_compare_and_exchange_val_acq(mem, newval, oldval) \ +#define atomic_compare_and_exchange_val_acq(mem, newval, oldval) \ __sync_val_compare_and_swap (mem, oldval, newval) -# define atomic_compare_and_exchange_bool_acq(mem, newval, oldval) \ +#define atomic_compare_and_exchange_bool_acq(mem, newval, oldval) \ (! __sync_bool_compare_and_swap (mem, oldval, newval)) -#else -# define __arch_compare_and_exchange_val_8_acq(mem, newval, oldval) \ - ({ __typeof (*mem) ret; \ - __asm __volatile (LOCK_PREFIX "cmpxchgb %b2, %1" \ - : "=a" (ret), "=m" (*mem) \ - : "q" (newval), "m" (*mem), "0" (oldval)); \ - ret; }) - -# define __arch_compare_and_exchange_val_16_acq(mem, newval, oldval) \ - ({ __typeof (*mem) ret; \ - __asm __volatile (LOCK_PREFIX "cmpxchgw %w2, %1" \ - : "=a" (ret), "=m" (*mem) \ - : "r" (newval), "m" (*mem), "0" (oldval)); \ - ret; }) - -# define __arch_compare_and_exchange_val_32_acq(mem, newval, oldval) \ - ({ __typeof (*mem) ret; \ - __asm __volatile (LOCK_PREFIX "cmpxchgl %2, %1" \ - : "=a" (ret), "=m" (*mem) \ - : "r" (newval), "m" (*mem), "0" (oldval)); \ - ret; }) - -# define __arch_compare_and_exchange_val_64_acq(mem, newval, oldval) \ - ({ __typeof (*mem) ret; \ - __asm __volatile (LOCK_PREFIX "cmpxchgq %q2, %1" \ - : "=a" (ret), "=m" (*mem) \ - : "r" ((long int) (newval)), "m" (*mem), \ - "0" ((long int) (oldval))); \ - ret; }) -#endif #define __arch_c_compare_and_exchange_val_8_acq(mem, newval, oldval) \ @@ -184,13 +153,8 @@ typedef uintmax_t uatomic_max_t; "i" (offsetof (tcbhead_t, multiple_threads))); \ result; }) -#if __GNUC_PREREQ (4, 1) -# define atomic_exchange_and_add(mem, value) \ +#define atomic_exchange_and_add(mem, value) \ __sync_fetch_and_add (mem, value) -#else -# define atomic_exchange_and_add(mem, value) \ - __arch_exchange_and_add_body (LOCK_PREFIX, mem, value) -#endif #define __arch_exchange_and_add_cprefix \ "cmpl $0, %%fs:%P4\n\tje 0f\n\tlock\n0:\t" diff --git a/libc/sysdeps/x86_64/fpu/libm-test-ulps b/libc/sysdeps/x86_64/fpu/libm-test-ulps index 0185f285a..867e8dd41 100644 --- a/libc/sysdeps/x86_64/fpu/libm-test-ulps +++ b/libc/sysdeps/x86_64/fpu/libm-test-ulps @@ -41,13 +41,151 @@ ildouble: 1 ldouble: 1 # cacos +Test "Imaginary part of: cacos (+0 + 0.5 i) == pi/2 - 0.4812118250596034474977589134243684231352 i": +double: 2 +float: 1 +idouble: 2 +ifloat: 1 +Test "Imaginary part of: cacos (+0 + 1.0 i) == pi/2 - 0.8813735870195430252326093249797923090282 i": +double: 2 +float: 1 +idouble: 2 +ifloat: 1 +ildouble: 2 +ldouble: 2 +Test "Imaginary part of: cacos (+0 + 1.5 i) == pi/2 - 1.194763217287109304111930828519090523536 i": +double: 2 +float: 1 +idouble: 2 +ifloat: 1 +Test "Imaginary part of: cacos (+0 - 0.5 i) == pi/2 + 0.4812118250596034474977589134243684231352 i": +float: 1 +ifloat: 1 +Test "Imaginary part of: cacos (+0 - 1.0 i) == pi/2 + 0.8813735870195430252326093249797923090282 i": +double: 1 +float: 1 +idouble: 1 +ifloat: 1 +Test "Imaginary part of: cacos (+0 - 1.5 i) == pi/2 + 1.194763217287109304111930828519090523536 i": +double: 1 +idouble: 1 +Test "Imaginary part of: cacos (-0 + 0.5 i) == pi/2 - 0.4812118250596034474977589134243684231352 i": +double: 2 +float: 1 +idouble: 2 +ifloat: 1 +Test "Imaginary part of: cacos (-0 + 1.0 i) == pi/2 - 0.8813735870195430252326093249797923090282 i": +double: 2 +float: 1 +idouble: 2 +ifloat: 1 +ildouble: 2 +ldouble: 2 +Test "Imaginary part of: cacos (-0 + 1.5 i) == pi/2 - 1.194763217287109304111930828519090523536 i": +double: 2 +float: 1 +idouble: 2 +ifloat: 1 +Test "Imaginary part of: cacos (-0 - 0.5 i) == pi/2 + 0.4812118250596034474977589134243684231352 i": +float: 1 +ifloat: 1 +Test "Imaginary part of: cacos (-0 - 1.0 i) == pi/2 + 0.8813735870195430252326093249797923090282 i": +double: 1 +float: 1 +idouble: 1 +ifloat: 1 +Test "Imaginary part of: cacos (-0 - 1.5 i) == pi/2 + 1.194763217287109304111930828519090523536 i": +double: 1 +idouble: 1 +Test "Imaginary part of: cacos (-1.5 + +0 i) == pi - 0.9624236501192068949955178268487368462704 i": +double: 1 +float: 1 +idouble: 1 +ifloat: 1 +Test "Imaginary part of: cacos (-1.5 - 0 i) == pi + 0.9624236501192068949955178268487368462704 i": +ildouble: 1 +ldouble: 1 +Test "Real part of: cacos (0.5 + +0 i) == 1.047197551196597746154214461093167628066 - 0 i": +double: 1 +idouble: 1 +ildouble: 1 +ldouble: 1 +Test "Real part of: cacos (0.5 - 0 i) == 1.047197551196597746154214461093167628066 + +0 i": +double: 1 +idouble: 1 +ildouble: 1 +ldouble: 1 Test "Imaginary part of: cacos (0.75 + 1.25 i) == 1.11752014915610270578240049553777969 - 1.13239363160530819522266333696834467 i": float: 1 ifloat: 1 ildouble: 2 ldouble: 2 +Test "Imaginary part of: cacos (1.5 + +0 i) == +0 - 0.9624236501192068949955178268487368462704 i": +double: 1 +float: 1 +idouble: 1 +ifloat: 1 +Test "Imaginary part of: cacos (1.5 - 0 i) == +0 + 0.9624236501192068949955178268487368462704 i": +ildouble: 1 +ldouble: 1 # cacosh +Test "Real part of: cacosh (+0 + 0.5 i) == 0.4812118250596034474977589134243684231352 + pi/2 i": +float: 1 +ifloat: 1 +Test "Real part of: cacosh (+0 + 1.0 i) == 0.8813735870195430252326093249797923090282 + pi/2 i": +double: 1 +float: 1 +idouble: 1 +ifloat: 1 +Test "Real part of: cacosh (+0 + 1.5 i) == 1.194763217287109304111930828519090523536 + pi/2 i": +double: 1 +idouble: 1 +Test "Real part of: cacosh (+0 - 0.5 i) == 0.4812118250596034474977589134243684231352 - pi/2 i": +float: 1 +ifloat: 1 +Test "Real part of: cacosh (+0 - 1.0 i) == 0.8813735870195430252326093249797923090282 - pi/2 i": +double: 1 +float: 1 +idouble: 1 +ifloat: 1 +Test "Real part of: cacosh (+0 - 1.5 i) == 1.194763217287109304111930828519090523536 - pi/2 i": +double: 1 +idouble: 1 +Test "Real part of: cacosh (-0 + 0.5 i) == 0.4812118250596034474977589134243684231352 + pi/2 i": +float: 1 +ifloat: 1 +Test "Real part of: cacosh (-0 + 1.0 i) == 0.8813735870195430252326093249797923090282 + pi/2 i": +double: 1 +float: 1 +idouble: 1 +ifloat: 1 +Test "Real part of: cacosh (-0 + 1.5 i) == 1.194763217287109304111930828519090523536 + pi/2 i": +double: 1 +idouble: 1 +Test "Real part of: cacosh (-0 - 0.5 i) == 0.4812118250596034474977589134243684231352 - pi/2 i": +float: 1 +ifloat: 1 +Test "Real part of: cacosh (-0 - 1.0 i) == 0.8813735870195430252326093249797923090282 - pi/2 i": +double: 1 +float: 1 +idouble: 1 +ifloat: 1 +Test "Real part of: cacosh (-0 - 1.5 i) == 1.194763217287109304111930828519090523536 - pi/2 i": +double: 1 +idouble: 1 +Test "Imaginary part of: cacosh (-0.5 + +0 i) == +0 + 2.094395102393195492308428922186335256131 i": +double: 1 +idouble: 1 +Test "Imaginary part of: cacosh (-0.5 - 0 i) == +0 - 2.094395102393195492308428922186335256131 i": +double: 1 +idouble: 1 +Test "Real part of: cacosh (-1.5 + +0 i) == 0.9624236501192068949955178268487368462704 + pi i": +float: 1 +ifloat: 1 +Test "Real part of: cacosh (-1.5 - 0 i) == 0.9624236501192068949955178268487368462704 - pi i": +float: 1 +ifloat: 1 Test "Real part of: cacosh (-2 - 3 i) == 1.9833870299165354323470769028940395 - 2.1414491111159960199416055713254211 i": double: 1 float: 7 @@ -65,8 +203,78 @@ ldouble: 1 Test "Real part of: cacosh (0.75 + 1.25 i) == 1.13239363160530819522266333696834467 + 1.11752014915610270578240049553777969 i": ildouble: 1 ldouble: 1 +Test "Real part of: cacosh (1.5 + +0 i) == 0.9624236501192068949955178268487368462704 + +0 i": +float: 1 +ifloat: 1 +Test "Real part of: cacosh (1.5 - 0 i) == 0.9624236501192068949955178268487368462704 - 0 i": +float: 1 +ifloat: 1 # casin +Test "Imaginary part of: casin (+0 + 0.5 i) == +0 + 0.4812118250596034474977589134243684231352 i": +double: 2 +float: 1 +idouble: 2 +ifloat: 1 +Test "Imaginary part of: casin (+0 + 1.0 i) == +0 + 0.8813735870195430252326093249797923090282 i": +double: 2 +float: 1 +idouble: 2 +ifloat: 1 +ildouble: 2 +ldouble: 2 +Test "Imaginary part of: casin (+0 + 1.5 i) == +0 + 1.194763217287109304111930828519090523536 i": +double: 2 +float: 1 +idouble: 2 +ifloat: 1 +Test "Imaginary part of: casin (+0 - 0.5 i) == +0 - 0.4812118250596034474977589134243684231352 i": +float: 1 +ifloat: 1 +Test "Imaginary part of: casin (+0 - 1.0 i) == +0 - 0.8813735870195430252326093249797923090282 i": +double: 1 +float: 1 +idouble: 1 +ifloat: 1 +Test "Imaginary part of: casin (+0 - 1.5 i) == +0 - 1.194763217287109304111930828519090523536 i": +double: 1 +idouble: 1 +Test "Imaginary part of: casin (-0 + 0.5 i) == -0 + 0.4812118250596034474977589134243684231352 i": +double: 2 +float: 1 +idouble: 2 +ifloat: 1 +Test "Imaginary part of: casin (-0 + 1.0 i) == -0 + 0.8813735870195430252326093249797923090282 i": +double: 2 +float: 1 +idouble: 2 +ifloat: 1 +ildouble: 2 +ldouble: 2 +Test "Imaginary part of: casin (-0 + 1.5 i) == -0 + 1.194763217287109304111930828519090523536 i": +double: 2 +float: 1 +idouble: 2 +ifloat: 1 +Test "Imaginary part of: casin (-0 - 0.5 i) == -0 - 0.4812118250596034474977589134243684231352 i": +float: 1 +ifloat: 1 +Test "Imaginary part of: casin (-0 - 1.0 i) == -0 - 0.8813735870195430252326093249797923090282 i": +double: 1 +float: 1 +idouble: 1 +ifloat: 1 +Test "Imaginary part of: casin (-0 - 1.5 i) == -0 - 1.194763217287109304111930828519090523536 i": +double: 1 +idouble: 1 +Test "Imaginary part of: casin (-1.5 + +0 i) == -pi/2 + 0.9624236501192068949955178268487368462704 i": +double: 1 +float: 1 +idouble: 1 +ifloat: 1 +Test "Imaginary part of: casin (-1.5 - 0 i) == -pi/2 - 0.9624236501192068949955178268487368462704 i": +ildouble: 1 +ldouble: 1 Test "Real part of: casin (0.75 + 1.25 i) == 0.453276177638793913448921196101971749 + 1.13239363160530819522266333696834467 i": double: 1 float: 1 @@ -79,8 +287,66 @@ float: 1 ifloat: 1 ildouble: 2 ldouble: 2 +Test "Imaginary part of: casin (1.5 + +0 i) == pi/2 + 0.9624236501192068949955178268487368462704 i": +double: 1 +float: 1 +idouble: 1 +ifloat: 1 +Test "Imaginary part of: casin (1.5 - 0 i) == pi/2 - 0.9624236501192068949955178268487368462704 i": +ildouble: 1 +ldouble: 1 # casinh +Test "Real part of: casinh (+0 + 1.5 i) == 0.9624236501192068949955178268487368462704 + pi/2 i": +ildouble: 1 +ldouble: 1 +Test "Real part of: casinh (+0 - 1.5 i) == 0.9624236501192068949955178268487368462704 - pi/2 i": +ildouble: 1 +ldouble: 1 +Test "Real part of: casinh (-0 + 1.5 i) == -0.9624236501192068949955178268487368462704 + pi/2 i": +double: 1 +float: 1 +idouble: 1 +ifloat: 1 +Test "Real part of: casinh (-0 - 1.5 i) == -0.9624236501192068949955178268487368462704 - pi/2 i": +double: 1 +float: 1 +idouble: 1 +ifloat: 1 +Test "Real part of: casinh (-0.5 + +0 i) == -0.4812118250596034474977589134243684231352 + +0 i": +double: 2 +float: 1 +idouble: 2 +ifloat: 1 +Test "Real part of: casinh (-0.5 - 0 i) == -0.4812118250596034474977589134243684231352 - 0 i": +double: 2 +float: 1 +idouble: 2 +ifloat: 1 +Test "Real part of: casinh (-1.0 + +0 i) == -0.8813735870195430252326093249797923090282 + +0 i": +double: 2 +float: 1 +idouble: 2 +ifloat: 1 +ildouble: 2 +ldouble: 2 +Test "Real part of: casinh (-1.0 - 0 i) == -0.8813735870195430252326093249797923090282 - 0 i": +double: 2 +float: 1 +idouble: 2 +ifloat: 1 +ildouble: 2 +ldouble: 2 +Test "Real part of: casinh (-1.5 + +0 i) == -1.194763217287109304111930828519090523536 + +0 i": +double: 2 +float: 1 +idouble: 2 +ifloat: 1 +Test "Real part of: casinh (-1.5 - 0 i) == -1.194763217287109304111930828519090523536 - 0 i": +double: 2 +float: 1 +idouble: 2 +ifloat: 1 Test "Real part of: casinh (-2 - 3 i) == -1.9686379257930962917886650952454982 - 0.96465850440760279204541105949953237 i": double: 5 float: 1 @@ -95,6 +361,12 @@ idouble: 3 ifloat: 6 ildouble: 5 ldouble: 5 +Test "Real part of: casinh (0.5 + +0 i) == 0.4812118250596034474977589134243684231352 + +0 i": +float: 1 +ifloat: 1 +Test "Real part of: casinh (0.5 - 0 i) == 0.4812118250596034474977589134243684231352 - 0 i": +float: 1 +ifloat: 1 Test "Real part of: casinh (0.75 + 1.25 i) == 1.03171853444778027336364058631006594 + 0.911738290968487636358489564316731207 i": float: 1 ifloat: 1 @@ -105,6 +377,22 @@ idouble: 1 ifloat: 1 ildouble: 1 ldouble: 1 +Test "Real part of: casinh (1.0 + +0 i) == 0.8813735870195430252326093249797923090282 + +0 i": +double: 1 +float: 1 +idouble: 1 +ifloat: 1 +Test "Real part of: casinh (1.0 - 0 i) == 0.8813735870195430252326093249797923090282 - 0 i": +double: 1 +float: 1 +idouble: 1 +ifloat: 1 +Test "Real part of: casinh (1.5 + +0 i) == 1.194763217287109304111930828519090523536 + +0 i": +double: 1 +idouble: 1 +Test "Real part of: casinh (1.5 - 0 i) == 1.194763217287109304111930828519090523536 - 0 i": +double: 1 +idouble: 1 # catan Test "Real part of: catan (-2 - 3 i) == -1.4099210495965755225306193844604208 - 0.22907268296853876629588180294200276 i": @@ -428,6 +716,50 @@ Test "cos_upward (9) == -0.9111302618846769883682947111811653112463": float: 2 ifloat: 2 +# cosh_downward +Test "cosh_downward (22) == 1792456423.065795780980053377632656584997": +float: 1 +ifloat: 1 +ildouble: 2 +ldouble: 2 +Test "cosh_downward (23) == 4872401723.124451300068625740569997090344": +float: 1 +ifloat: 1 +ildouble: 1 +ldouble: 1 +Test "cosh_downward (24) == 13244561064.92173614708845674912733665919": +float: 1 +ifloat: 1 +ildouble: 1 +ldouble: 1 + +# cosh_tonearest +Test "cosh_tonearest (22) == 1792456423.065795780980053377632656584997": +ildouble: 1 +ldouble: 1 + +# cosh_towardzero +Test "cosh_towardzero (22) == 1792456423.065795780980053377632656584997": +float: 1 +ifloat: 1 +ildouble: 2 +ldouble: 2 +Test "cosh_towardzero (23) == 4872401723.124451300068625740569997090344": +float: 1 +ifloat: 1 +ildouble: 1 +ldouble: 1 +Test "cosh_towardzero (24) == 13244561064.92173614708845674912733665919": +float: 1 +ifloat: 1 +ildouble: 1 +ldouble: 1 + +# cosh_upward +Test "cosh_upward (23) == 4872401723.124451300068625740569997090344": +ildouble: 1 +ldouble: 1 + # cpow Test "Real part of: cpow (0.75 + 1.25 i, 0.0 + 1.0 i) == 0.331825439177608832276067945276730566 + 0.131338600281188544930936345230903032 i": float: 1 @@ -932,6 +1264,36 @@ Test "log1p (-0.25) == -0.287682072451780927439219005993827432": float: 1 ifloat: 1 +# pow_downward +Test "pow_downward (1.0625, 1.125) == 1.070582293028761362162622578677070098674": +ildouble: 1 +ldouble: 1 +Test "pow_downward (1.5, 1.03125) == 1.519127098714743184071644334163037684948": +float: 1 +ifloat: 1 +ildouble: 1 +ldouble: 1 + +# pow_towardzero +Test "pow_towardzero (1.0625, 1.125) == 1.070582293028761362162622578677070098674": +ildouble: 1 +ldouble: 1 +Test "pow_towardzero (1.5, 1.03125) == 1.519127098714743184071644334163037684948": +float: 1 +ifloat: 1 +ildouble: 1 +ldouble: 1 + +# pow_upward +Test "pow_upward (1.0625, 1.125) == 1.070582293028761362162622578677070098674": +float: 1 +ifloat: 1 +ildouble: 1 +ldouble: 1 +Test "pow_upward (1.5, 1.03125) == 1.519127098714743184071644334163037684948": +ildouble: 1 +ldouble: 1 + # sin_downward Test "sin_downward (1) == 0.8414709848078965066525023216302989996226": ildouble: 1 @@ -1065,6 +1427,58 @@ Test "sinh (0x8p-32) == 1.86264514923095703232705808926175479e-9": ildouble: 1 ldouble: 1 +# sinh_downward +Test "sinh_downward (22) == 1792456423.065795780701106568345764104225": +float: 1 +ifloat: 1 +ildouble: 4 +ldouble: 4 +Test "sinh_downward (23) == 4872401723.124451299966006944252978187305": +float: 1 +ifloat: 1 +Test "sinh_downward (24) == 13244561064.92173614705070540368454568168": +float: 1 +ifloat: 1 +ildouble: 5 +ldouble: 5 + +# sinh_tonearest +Test "sinh_tonearest (22) == 1792456423.065795780701106568345764104225": +ildouble: 3 +ldouble: 3 +Test "sinh_tonearest (23) == 4872401723.124451299966006944252978187305": +ildouble: 1 +ldouble: 1 +Test "sinh_tonearest (24) == 13244561064.92173614705070540368454568168": +ildouble: 6 +ldouble: 6 + +# sinh_towardzero +Test "sinh_towardzero (22) == 1792456423.065795780701106568345764104225": +float: 1 +ifloat: 1 +ildouble: 4 +ldouble: 4 +Test "sinh_towardzero (23) == 4872401723.124451299966006944252978187305": +float: 1 +ifloat: 1 +Test "sinh_towardzero (24) == 13244561064.92173614705070540368454568168": +float: 1 +ifloat: 1 +ildouble: 5 +ldouble: 5 + +# sinh_upward +Test "sinh_upward (22) == 1792456423.065795780701106568345764104225": +ildouble: 16 +ldouble: 16 +Test "sinh_upward (23) == 4872401723.124451299966006944252978187305": +ildouble: 27 +ldouble: 27 +Test "sinh_upward (24) == 13244561064.92173614705070540368454568168": +ildouble: 7 +ldouble: 7 + # tan Test "tan (pi/4) == 1": double: 1 @@ -1372,8 +1786,16 @@ ifloat: 1 ildouble: 1 ldouble: 1 +Function: Real part of "cacos": +double: 1 +idouble: 1 +ildouble: 1 +ldouble: 1 + Function: Imaginary part of "cacos": +double: 2 float: 1 +idouble: 2 ifloat: 1 ildouble: 2 ldouble: 2 @@ -1403,7 +1825,9 @@ ildouble: 2 ldouble: 2 Function: Imaginary part of "casin": +double: 2 float: 1 +idouble: 2 ifloat: 1 ildouble: 2 ldouble: 2 @@ -1546,6 +1970,26 @@ ifloat: 2 ildouble: 1 ldouble: 1 +Function: "cosh_downward": +float: 1 +ifloat: 1 +ildouble: 2 +ldouble: 2 + +Function: "cosh_tonearest": +ildouble: 1 +ldouble: 1 + +Function: "cosh_towardzero": +float: 1 +ifloat: 1 +ildouble: 2 +ldouble: 2 + +Function: "cosh_upward": +ildouble: 1 +ldouble: 1 + Function: Real part of "cpow": double: 2 float: 5 @@ -1718,6 +2162,24 @@ Function: "log1p": float: 1 ifloat: 1 +Function: "pow_downward": +float: 1 +ifloat: 1 +ildouble: 1 +ldouble: 1 + +Function: "pow_towardzero": +float: 1 +ifloat: 1 +ildouble: 1 +ldouble: 1 + +Function: "pow_upward": +float: 1 +ifloat: 1 +ildouble: 1 +ldouble: 1 + Function: "sin_downward": float: 1 ifloat: 1 @@ -1754,6 +2216,26 @@ Function: "sinh": ildouble: 1 ldouble: 1 +Function: "sinh_downward": +float: 1 +ifloat: 1 +ildouble: 5 +ldouble: 5 + +Function: "sinh_tonearest": +ildouble: 6 +ldouble: 6 + +Function: "sinh_towardzero": +float: 1 +ifloat: 1 +ildouble: 5 +ldouble: 5 + +Function: "sinh_upward": +ildouble: 27 +ldouble: 27 + Function: "tan": double: 1 idouble: 1 diff --git a/libc/sysdeps/x86_64/fpu/printf_fphex.c b/libc/sysdeps/x86_64/fpu/printf_fphex.c index 0b6bfc6bd..7de7283c4 100644 --- a/libc/sysdeps/x86_64/fpu/printf_fphex.c +++ b/libc/sysdeps/x86_64/fpu/printf_fphex.c @@ -1,5 +1,5 @@ /* Print floating point number in hexadecimal notation according to ISO C99. - Copyright (C) 1997,1998,1999,2000,2001,2005 Free Software Foundation, Inc. + Copyright (C) 1997-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -57,6 +57,7 @@ do { \ \ /* We use a full nibble for the leading digit. */ \ leading = *numstr++; \ + wnumstr++; \ \ /* We have 3 bits from the mantissa in the leading nibble. \ Therefore we are here using `IEEE854_LONG_DOUBLE_BIAS + 3'. */ \ -- cgit v1.2.3