diff options
author | Joseph Myers <joseph@codesourcery.com> | 2012-03-16 12:28:25 +0000 |
---|---|---|
committer | Joseph Myers <joseph@codesourcery.com> | 2012-03-16 12:30:05 +0000 |
commit | 8848d99dce1e57168a492d146f5e72195c7665a5 (patch) | |
tree | b08411393dc81052bb86482bbdb044b622b57653 /sysdeps/i386 | |
parent | dd7f470327139a88019b2c5ded8fc2811b0fed00 (diff) | |
download | glibc-8848d99dce1e57168a492d146f5e72195c7665a5.tar.gz glibc-8848d99dce1e57168a492d146f5e72195c7665a5.tar.xz glibc-8848d99dce1e57168a492d146f5e72195c7665a5.zip |
Implement ldbl-96 sinl / cosl / sincosl (bug 13851).
Diffstat (limited to 'sysdeps/i386')
-rw-r--r-- | sysdeps/i386/fpu/e_rem_pio2l.c | 3 | ||||
-rw-r--r-- | sysdeps/i386/fpu/k_rem_pio2.c | 3 | ||||
-rw-r--r-- | sysdeps/i386/fpu/libm-test-ulps | 43 | ||||
-rw-r--r-- | sysdeps/i386/fpu/s_cosl.S | 54 | ||||
-rw-r--r-- | sysdeps/i386/fpu/s_sincosl.S | 64 | ||||
-rw-r--r-- | sysdeps/i386/fpu/s_sinl.S | 54 |
6 files changed, 33 insertions, 188 deletions
diff --git a/sysdeps/i386/fpu/e_rem_pio2l.c b/sysdeps/i386/fpu/e_rem_pio2l.c deleted file mode 100644 index 1347b0468c..0000000000 --- a/sysdeps/i386/fpu/e_rem_pio2l.c +++ /dev/null @@ -1,3 +0,0 @@ -/* Empty. This file is only meant to avoid compiling the file with the - same name in the libm-ieee754 directory. The code is not used since - there is an assembler version for all users of this file. */ diff --git a/sysdeps/i386/fpu/k_rem_pio2.c b/sysdeps/i386/fpu/k_rem_pio2.c deleted file mode 100644 index 1347b0468c..0000000000 --- a/sysdeps/i386/fpu/k_rem_pio2.c +++ /dev/null @@ -1,3 +0,0 @@ -/* Empty. This file is only meant to avoid compiling the file with the - same name in the libm-ieee754 directory. The code is not used since - there is an assembler version for all users of this file. */ diff --git a/sysdeps/i386/fpu/libm-test-ulps b/sysdeps/i386/fpu/libm-test-ulps index 76d25d7518..6f090e1417 100644 --- a/sysdeps/i386/fpu/libm-test-ulps +++ b/sysdeps/i386/fpu/libm-test-ulps @@ -569,12 +569,18 @@ double: 1 float: 1 idouble: 1 ifloat: 1 +ildouble: 1 +ldouble: 1 Test "cos_downward (2) == -0.4161468365471423869975682295007621897660": float: 1 ifloat: 1 +ildouble: 1 +ldouble: 1 Test "cos_downward (3) == -0.9899924966004454572715727947312613023937": double: 1 idouble: 1 +ildouble: 1 +ldouble: 1 Test "cos_downward (4) == -0.6536436208636119146391681830977503814241": float: 1 ifloat: 1 @@ -649,6 +655,8 @@ double: 1 float: 1 idouble: 1 ifloat: 1 +ildouble: 1 +ldouble: 1 # cos_upward Test "cos_upward (1) == 0.5403023058681397174009366074429766037323": @@ -672,6 +680,8 @@ ldouble: 1 Test "cos_upward (4) == -0.6536436208636119146391681830977503814241": double: 1 idouble: 1 +ildouble: 1 +ldouble: 1 Test "cos_upward (5) == 0.2836621854632262644666391715135573083344": double: 1 idouble: 1 @@ -692,6 +702,11 @@ double: 1 float: 1 idouble: 1 ifloat: 1 +ildouble: 1 +ldouble: 1 +Test "cos_upward (9) == -0.9111302618846769883682947111811653112463": +ildouble: 1 +ldouble: 1 # cosh Test "cosh (0.75) == 1.29468328467684468784170818539018176": @@ -1014,8 +1029,8 @@ double: 1 float: 2 idouble: 1 ifloat: 2 -ildouble: 1 -ldouble: 1 +ildouble: 2 +ldouble: 2 Test "j0 (10.0) == -0.245935764451348335197760862485328754": double: 3 float: 1 @@ -1031,8 +1046,8 @@ double: 1 float: 2 idouble: 1 ifloat: 2 -ildouble: 1 -ldouble: 1 +ildouble: 2 +ldouble: 2 Test "j0 (8.0) == 0.171650807137553906090869407851972001": float: 1 ifloat: 1 @@ -1065,8 +1080,8 @@ double: 1 float: 2 idouble: 1 ifloat: 2 -ildouble: 1 -ldouble: 1 +ildouble: 2 +ldouble: 2 Test "jn (0, 10.0) == -0.245935764451348335197760862485328754": double: 3 float: 1 @@ -1082,8 +1097,8 @@ double: 1 float: 2 idouble: 1 ifloat: 2 -ildouble: 1 -ldouble: 1 +ildouble: 2 +ldouble: 2 Test "jn (0, 8.0) == 0.171650807137553906090869407851972001": float: 1 ifloat: 1 @@ -1400,6 +1415,8 @@ ifloat: 1 Test "sin_upward (10) == -0.5440211108893698134047476618513772816836": float: 1 ifloat: 1 +ildouble: 1 +ldouble: 1 Test "sin_upward (2) == 0.9092974268256816953960198659117448427023": float: 1 ifloat: 1 @@ -1410,12 +1427,18 @@ double: 1 float: 1 idouble: 1 ifloat: 1 +ildouble: 1 +ldouble: 1 Test "sin_upward (4) == -0.7568024953079282513726390945118290941359": float: 1 ifloat: 1 +ildouble: 1 +ldouble: 1 Test "sin_upward (5) == -0.9589242746631384688931544061559939733525": float: 1 ifloat: 1 +ildouble: 1 +ldouble: 1 Test "sin_upward (6) == -0.2794154981989258728115554466118947596280": ildouble: 1 ldouble: 1 @@ -2209,8 +2232,8 @@ double: 3 float: 2 idouble: 3 ifloat: 2 -ildouble: 1 -ldouble: 1 +ildouble: 2 +ldouble: 2 Function: "j1": double: 2 diff --git a/sysdeps/i386/fpu/s_cosl.S b/sysdeps/i386/fpu/s_cosl.S deleted file mode 100644 index 27dd74f21b..0000000000 --- a/sysdeps/i386/fpu/s_cosl.S +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Public domain. - * - * Adapted for `long double' by Ulrich Drepper <drepper@cygnus.com>. - * Fixed errno handling by Ulrich Drepper <drepper@redhat.com>. - */ - -#define __need_Emath -#include <bits/errno.h> -#include <machine/asm.h> - -ENTRY(__cosl) - fldt 4(%esp) - fxam - fstsw %ax - movb $0x45, %dh - andb %ah, %dh - cmpb $0x05, %dh - je 3f -4: fcos - fnstsw %ax - testl $0x400,%eax - jnz 1f - ret - .align ALIGNARG(4) -1: fldpi - fadd %st(0) - fxch %st(1) -2: fprem1 - fnstsw %ax - testl $0x400,%eax - jnz 2b - fstp %st(1) - fcos - ret -3: -#ifdef PIC - pushl %ebx - cfi_adjust_cfa_offset (4) - cfi_rel_offset (ebx, 0) - LOAD_PIC_REG (bx) - call __errno_location@PLT - movl $EDOM, (%eax) - popl %ebx - cfi_adjust_cfa_offset (-4) - cfi_restore (ebx) -#else - call __errno_location@PLT - movl $EDOM, (%eax) -#endif - jmp 4b -END (__cosl) -weak_alias (__cosl, cosl) diff --git a/sysdeps/i386/fpu/s_sincosl.S b/sysdeps/i386/fpu/s_sincosl.S deleted file mode 100644 index 42a96257ad..0000000000 --- a/sysdeps/i386/fpu/s_sincosl.S +++ /dev/null @@ -1,64 +0,0 @@ -/* Compute sine and cosine of argument. - Copyright (C) 1997, 2000 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997. - - 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 - <http://www.gnu.org/licenses/>. */ - -#include <machine/asm.h> -#include "bp-sym.h" -#include "bp-asm.h" - -#define PARMS LINKAGE /* no space for saved regs */ -#define ANGLE PARMS -#define SINP ANGLE+12 -#define COSP SINP+PTR_SIZE - - .text -ENTRY (BP_SYM (__sincosl)) - ENTER - - fldt ANGLE(%esp) - fsincos - movl SINP(%esp), %ecx - CHECK_BOUNDS_BOTH_WIDE (%ecx, SINP(%esp), $12) - movl COSP(%esp), %edx - CHECK_BOUNDS_BOTH_WIDE (%edx, COSP(%esp), $12) - fnstsw %ax - testl $0x400,%eax - jnz 1f - fstpt (%edx) - fstpt (%ecx) - - LEAVE - ret - - .align ALIGNARG(4) -1: fldpi - fadd %st(0) - fxch %st(1) -2: fprem1 - fnstsw %ax - testl $0x400,%eax - jnz 2b - fstp %st(1) - fsincos - fstpt (%edx) - fstpt (%ecx) - - LEAVE - ret -END (BP_SYM (__sincosl)) -weak_alias (BP_SYM (__sincosl), BP_SYM (sincosl)) diff --git a/sysdeps/i386/fpu/s_sinl.S b/sysdeps/i386/fpu/s_sinl.S deleted file mode 100644 index 68c4f99668..0000000000 --- a/sysdeps/i386/fpu/s_sinl.S +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Public domain. - * - * Adapted for `long double' by Ulrich Drepper <drepper@cygnus.com>. - * Fixed errno handling by Ulrich Drepper <drepper@redhat.com>. - */ - -#define __need_Emath -#include <bits/errno.h> -#include <machine/asm.h> - -ENTRY(__sinl) - fldt 4(%esp) - fxam - fstsw %ax - movb $0x45, %dh - andb %ah, %dh - cmpb $0x05, %dh - je 3f -4: fsin - fnstsw %ax - testl $0x400,%eax - jnz 1f - ret - .align ALIGNARG(4) -1: fldpi - fadd %st(0) - fxch %st(1) -2: fprem1 - fnstsw %ax - testl $0x400,%eax - jnz 2b - fstp %st(1) - fsin - ret -3: -#ifdef PIC - pushl %ebx - cfi_adjust_cfa_offset (4) - cfi_rel_offset (ebx, 0) - LOAD_PIC_REG (bx) - call __errno_location@PLT - movl $EDOM, (%eax) - popl %ebx - cfi_adjust_cfa_offset (-4) - cfi_restore (ebx) -#else - call __errno_location@PLT - movl $EDOM, (%eax) -#endif - jmp 4b -END (__sinl) -weak_alias (__sinl, sinl) |