aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/x86_64/fpu
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2012-03-16 12:28:25 +0000
committerJoseph Myers <joseph@codesourcery.com>2012-03-16 12:30:05 +0000
commit8848d99dce1e57168a492d146f5e72195c7665a5 (patch)
treeb08411393dc81052bb86482bbdb044b622b57653 /sysdeps/x86_64/fpu
parentdd7f470327139a88019b2c5ded8fc2811b0fed00 (diff)
downloadglibc-8848d99dce1e57168a492d146f5e72195c7665a5.tar
glibc-8848d99dce1e57168a492d146f5e72195c7665a5.tar.gz
glibc-8848d99dce1e57168a492d146f5e72195c7665a5.tar.bz2
glibc-8848d99dce1e57168a492d146f5e72195c7665a5.zip
Implement ldbl-96 sinl / cosl / sincosl (bug 13851).
Diffstat (limited to 'sysdeps/x86_64/fpu')
-rw-r--r--sysdeps/x86_64/fpu/e_rem_pio2l.c3
-rw-r--r--sysdeps/x86_64/fpu/k_cosl.c1
-rw-r--r--sysdeps/x86_64/fpu/k_sinl.c1
-rw-r--r--sysdeps/x86_64/fpu/libm-test-ulps50
-rw-r--r--sysdeps/x86_64/fpu/s_cosl.S42
-rw-r--r--sysdeps/x86_64/fpu/s_sincosl.S59
-rw-r--r--sysdeps/x86_64/fpu/s_sinl.S42
7 files changed, 40 insertions, 158 deletions
diff --git a/sysdeps/x86_64/fpu/e_rem_pio2l.c b/sysdeps/x86_64/fpu/e_rem_pio2l.c
deleted file mode 100644
index 1347b0468c..0000000000
--- a/sysdeps/x86_64/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/x86_64/fpu/k_cosl.c b/sysdeps/x86_64/fpu/k_cosl.c
deleted file mode 100644
index eea55a98d2..0000000000
--- a/sysdeps/x86_64/fpu/k_cosl.c
+++ /dev/null
@@ -1 +0,0 @@
-/* Not needed. */
diff --git a/sysdeps/x86_64/fpu/k_sinl.c b/sysdeps/x86_64/fpu/k_sinl.c
deleted file mode 100644
index eea55a98d2..0000000000
--- a/sysdeps/x86_64/fpu/k_sinl.c
+++ /dev/null
@@ -1 +0,0 @@
-/* Not needed. */
diff --git a/sysdeps/x86_64/fpu/libm-test-ulps b/sysdeps/x86_64/fpu/libm-test-ulps
index 33efe9df51..9a3fd6f8be 100644
--- a/sysdeps/x86_64/fpu/libm-test-ulps
+++ b/sysdeps/x86_64/fpu/libm-test-ulps
@@ -621,12 +621,19 @@ float: 1
ifloat: 1
ildouble: 1
ldouble: 1
+Test "cos_downward (10) == -0.8390715290764524522588639478240648345199":
+ildouble: 1
+ldouble: 1
Test "cos_downward (2) == -0.4161468365471423869975682295007621897660":
float: 1
ifloat: 1
+ildouble: 1
+ldouble: 1
Test "cos_downward (3) == -0.9899924966004454572715727947312613023937":
float: 1
ifloat: 1
+ildouble: 1
+ldouble: 1
Test "cos_downward (4) == -0.6536436208636119146391681830977503814241":
float: 1
ifloat: 1
@@ -688,6 +695,8 @@ ldouble: 1
Test "cos_towardzero (8) == -0.1455000338086135258688413818311946826093":
float: 1
ifloat: 1
+ildouble: 1
+ldouble: 1
# cos_upward
Test "cos_upward (10) == -0.8390715290764524522588639478240648345199":
@@ -701,6 +710,9 @@ ldouble: 1
Test "cos_upward (3) == -0.9899924966004454572715727947312613023937":
ildouble: 1
ldouble: 1
+Test "cos_upward (4) == -0.6536436208636119146391681830977503814241":
+ildouble: 1
+ldouble: 1
Test "cos_upward (5) == 0.2836621854632262644666391715135573083344":
ildouble: 1
ldouble: 1
@@ -712,9 +724,14 @@ ldouble: 1
Test "cos_upward (7) == 0.7539022543433046381411975217191820122183":
float: 1
ifloat: 1
+Test "cos_upward (8) == -0.1455000338086135258688413818311946826093":
+ildouble: 1
+ldouble: 1
Test "cos_upward (9) == -0.9111302618846769883682947111811653112463":
float: 2
ifloat: 2
+ildouble: 1
+ldouble: 1
# cosh_downward
Test "cosh_downward (22) == 1792456423.065795780980053377632656584997":
@@ -799,6 +816,8 @@ double: 1
float: 5
idouble: 1
ifloat: 5
+ildouble: 1
+ldouble: 1
Test "Imaginary part of: cpow (2 + 3 i, 4 + 0 i) == -119.0 - 120.0 i":
float: 2
ifloat: 2
@@ -1059,8 +1078,8 @@ double: 1
float: 1
idouble: 1
ifloat: 1
-ildouble: 1
-ldouble: 1
+ildouble: 2
+ldouble: 2
Test "j0 (0.75) == 0.864242275166648623555731103820923211":
float: 1
ifloat: 1
@@ -1077,8 +1096,8 @@ double: 1
float: 1
idouble: 1
ifloat: 1
-ildouble: 1
-ldouble: 1
+ildouble: 2
+ldouble: 2
Test "j0 (8.0) == 0.171650807137553906090869407851972001":
double: 2
float: 1
@@ -1106,8 +1125,8 @@ double: 1
float: 1
idouble: 1
ifloat: 1
-ildouble: 1
-ldouble: 1
+ildouble: 2
+ldouble: 2
Test "jn (0, 0.75) == 0.864242275166648623555731103820923211":
float: 1
ifloat: 1
@@ -1124,8 +1143,8 @@ double: 1
float: 1
idouble: 1
ifloat: 1
-ildouble: 1
-ldouble: 1
+ildouble: 2
+ldouble: 2
Test "jn (0, 8.0) == 0.171650807137553906090869407851972001":
double: 2
float: 1
@@ -1409,14 +1428,25 @@ ldouble: 1
Test "sin_upward (1) == 0.8414709848078965066525023216302989996226":
float: 1
ifloat: 1
+Test "sin_upward (10) == -0.5440211108893698134047476618513772816836":
+ildouble: 1
+ldouble: 1
Test "sin_upward (2) == 0.9092974268256816953960198659117448427023":
float: 2
ifloat: 2
ildouble: 1
ldouble: 1
+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 (5) == -0.9589242746631384688931544061559939733525":
+ildouble: 1
+ldouble: 1
Test "sin_upward (6) == -0.2794154981989258728115554466118947596280":
ildouble: 1
ldouble: 1
@@ -2162,8 +2192,8 @@ double: 2
float: 2
idouble: 2
ifloat: 2
-ildouble: 1
-ldouble: 1
+ildouble: 2
+ldouble: 2
Function: "j1":
double: 1
diff --git a/sysdeps/x86_64/fpu/s_cosl.S b/sysdeps/x86_64/fpu/s_cosl.S
deleted file mode 100644
index 6921cda567..0000000000
--- a/sysdeps/x86_64/fpu/s_cosl.S
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Written by J.T. Conklin <jtc@netbsd.org>.
- * Public domain.
- *
- * Adapted for `long double' by Ulrich Drepper <drepper@cygnus.com>.
- * Adapted for x86-64 by Andreas Jaeger <aj@suse.de>.
- * Fixed errno handling by Ulrich Drepper <drepper@redhat.com>.
- */
-
-#define __need_Emath
-#include <bits/errno.h>
-#include <machine/asm.h>
-
-ENTRY(__cosl)
- fldt 8(%rsp)
- 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: call __errno_location@PLT
- movl $EDOM, (%rax)
- jmp 4b
-END (__cosl)
-weak_alias (__cosl, cosl)
diff --git a/sysdeps/x86_64/fpu/s_sincosl.S b/sysdeps/x86_64/fpu/s_sincosl.S
deleted file mode 100644
index b394c04ca5..0000000000
--- a/sysdeps/x86_64/fpu/s_sincosl.S
+++ /dev/null
@@ -1,59 +0,0 @@
-/* Compute sine and cosine of argument.
- Copyright (C) 1997, 2000, 2001, 2005 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 8(%rsp)
- fsincos
- fnstsw %ax
- testl $0x400,%eax
- jnz 1f
- fstpt (%rsi)
- fstpt (%rdi)
-
- LEAVE
- retq
-
-1: fldpi
- fadd %st(0)
- fxch %st(1)
-2: fprem1
- fnstsw %ax
- testl $0x400,%eax
- jnz 2b
- fstp %st(1)
- fsincos
- fstpt (%rsi)
- fstpt (%rdi)
-
- LEAVE
- retq
-END (BP_SYM (__sincosl))
-weak_alias (BP_SYM (__sincosl), BP_SYM (sincosl))
diff --git a/sysdeps/x86_64/fpu/s_sinl.S b/sysdeps/x86_64/fpu/s_sinl.S
deleted file mode 100644
index 79fc4af95b..0000000000
--- a/sysdeps/x86_64/fpu/s_sinl.S
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Written by J.T. Conklin <jtc@netbsd.org>.
- * Public domain.
- *
- * Adapted for `long double' by Ulrich Drepper <drepper@cygnus.com>.
- * Adapted for x86-64 by Andreas Jaeger <aj@suse.de>.
- * Fixed errno handling by Ulrich Drepper <drepper@redhat.com>.
- */
-
-#define __need_Emath
-#include <bits/errno.h>
-#include <machine/asm.h>
-
-ENTRY(__sinl)
- fldt 8(%rsp)
- 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: call __errno_location@PLT
- movl $EDOM, (%rax)
- jmp 4b
-END (__sinl)
-weak_alias (__sinl, sinl)