about summary refs log tree commit diff
path: root/sysdeps/x86_64/fpu
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/x86_64/fpu')
-rw-r--r--sysdeps/x86_64/fpu/e_log10l.S5
-rw-r--r--sysdeps/x86_64/fpu/e_log2l.S5
-rw-r--r--sysdeps/x86_64/fpu/e_logl.S12
-rw-r--r--sysdeps/x86_64/fpu/e_powl.S19
-rw-r--r--sysdeps/x86_64/fpu/math_private.h21
-rw-r--r--sysdeps/x86_64/fpu/s_copysign.S5
-rw-r--r--sysdeps/x86_64/fpu/s_copysignf.S3
-rw-r--r--sysdeps/x86_64/fpu/s_log1pl.S5
8 files changed, 21 insertions, 54 deletions
diff --git a/sysdeps/x86_64/fpu/e_log10l.S b/sysdeps/x86_64/fpu/e_log10l.S
index 633234b744..b4343bef45 100644
--- a/sysdeps/x86_64/fpu/e_log10l.S
+++ b/sysdeps/x86_64/fpu/e_log10l.S
@@ -42,7 +42,7 @@ ENTRY(__ieee754_log10l)
 	fxam
 	fnstsw
 	fld	%st		// x : x : log10(2)
-	testb	$1, %ah
+	andb	$1,%ah
 	jnz	3f		// in case x is NaN or ħInf
 4:	fsubl	MO(one)		// x-1 : x : log10(2)
 	fld	%st		// x-1 : x-1 : x : log10(2)
@@ -59,8 +59,7 @@ ENTRY(__ieee754_log10l)
 	fyl2x			// log10(x)
 	ret
 
-3:	testb	$4, %ah
-	jnz	4b		// in case x is ħInf
+3:	jp	4b		// in case x is ħInf
 	fstp	%st(1)
 	fstp	%st(1)
 	ret
diff --git a/sysdeps/x86_64/fpu/e_log2l.S b/sysdeps/x86_64/fpu/e_log2l.S
index f04d30a05a..7a89b94d9f 100644
--- a/sysdeps/x86_64/fpu/e_log2l.S
+++ b/sysdeps/x86_64/fpu/e_log2l.S
@@ -39,7 +39,7 @@ ENTRY(__ieee754_log2l)
 	fxam
 	fnstsw
 	fld	%st		// x : x : 1
-	testb	$1, %ah
+	andb	$1,%ah
 	jnz	3f		// in case x is NaN or ħInf
 4:	fsub	%st(2), %st	// x-1 : x : 1
 	fld	%st		// x-1 : x-1 : x : 1
@@ -56,8 +56,7 @@ ENTRY(__ieee754_log2l)
 	fyl2x			// log(x)
 	ret
 
-3:	testb	$4, %ah
-	jnz	4b		// in case x is ħInf
+3:	jp	4b		// in case x is ħInf
 	fstp	%st(1)
 	fstp	%st(1)
 	ret
diff --git a/sysdeps/x86_64/fpu/e_logl.S b/sysdeps/x86_64/fpu/e_logl.S
index 2ba91eedfd..a0bed663c8 100644
--- a/sysdeps/x86_64/fpu/e_logl.S
+++ b/sysdeps/x86_64/fpu/e_logl.S
@@ -38,12 +38,8 @@ limit:	.double 0.29
 ENTRY(__ieee754_logl)
 	fldln2			// log(2)
 	fldt	8(%rsp)		// x : log(2)
-	fxam
-	fnstsw
 	fld	%st		// x : x : log(2)
-	testb	$1, %ah
-	jnz	3f		// in case x is NaN or +-Inf
-4:	fsubl	MO(one)		// x-1 : x : log(2)
+	fsubl	MO(one)		// x-1 : x : log(2)
 	fld	%st		// x-1 : x-1 : x : log(2)
 	fabs			// |x-1| : x-1 : x : log(2)
 	fcompl	MO(limit)	// x-1 : x : log(2)
@@ -57,10 +53,4 @@ ENTRY(__ieee754_logl)
 2:	fstp	%st(0)		// x : log(2)
 	fyl2x			// log(x)
 	ret
-
-3:	testb	$4, %ah
-	jnz	4b		// in case x is +-Inf
-	fstp	%st(1)
-	fstp	%st(1)
-	ret
 END (__ieee754_logl)
diff --git a/sysdeps/x86_64/fpu/e_powl.S b/sysdeps/x86_64/fpu/e_powl.S
index 4959bea7ac..85f4deb3c7 100644
--- a/sysdeps/x86_64/fpu/e_powl.S
+++ b/sysdeps/x86_64/fpu/e_powl.S
@@ -1,6 +1,5 @@
 /* ix87 specific implementation of pow function.
-   Copyright (C) 1996, 1997, 1998, 1999, 2001, 2004, 2007
-   Free Software Foundation, Inc.
+   Copyright (C) 1996, 1997, 1998, 1999, 2001, 2004 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
 
@@ -147,11 +146,10 @@ ENTRY(__ieee754_powl)
 2:	/* y is a real number.  */
 	fxch			// x : y
 	fldl	MO(one)		// 1.0 : x : y
-	fldl	MO(limit)	// 0.29 : 1.0 : x : y
-	fld	%st(2)		// x : 0.29 : 1.0 : x : y
-	fsub	%st(2)		// x-1 : 0.29 : 1.0 : x : y
-	fabs			// |x-1| : 0.29 : 1.0 : x : y
-	fucompp			// 1.0 : x : y
+	fld	%st(1)		// x : 1.0 : x : y
+	fsub	%st(1)		// x-1 : 1.0 : x : y
+	fabs			// |x-1| : 1.0 : x : y
+	fcompl	MO(limit)	// 1.0 : x : y
 	fnstsw
 	fxch			// x : 1.0 : y
 	test	$4500,%eax
@@ -192,10 +190,9 @@ ENTRY(__ieee754_powl)
 	// y == ħinf
 	.align ALIGNARG(4)
 12:	fstp	%st(0)		// pop y
-	fldl	MO(one)		// 1
-	fldt	8(%rsp)		// x : 1
-	fabs			// abs(x) : 1
-	fucompp			// < 1, == 1, or > 1
+	fldt	8(%rsp)		// x
+	fabs
+	fcompl	MO(one)		// < 1, == 1, or > 1
 	fnstsw
 	andb	$0x45, %ah
 	cmpb	$0x45, %ah
diff --git a/sysdeps/x86_64/fpu/math_private.h b/sysdeps/x86_64/fpu/math_private.h
deleted file mode 100644
index 4febcbb5ec..0000000000
--- a/sysdeps/x86_64/fpu/math_private.h
+++ /dev/null
@@ -1,21 +0,0 @@
-#ifndef _MATH_PRIVATE_H
-
-#define math_opt_barrier(x) \
-({ __typeof(x) __x;					\
-   if (sizeof (x) <= sizeof (double))			\
-     __asm ("" : "=x" (__x) : "0" (x));			\
-   else							\
-     __asm ("" : "=t" (__x) : "0" (x));			\
-   __x; })
-#define math_force_eval(x) \
-do							\
-  {							\
-    if (sizeof (x) <= sizeof (double))			\
-      __asm __volatile ("" : : "x" (x));		\
-    else						\
-      __asm __volatile ("" : : "f" (x));		\
-  }							\
-while (0)
-
-#include <math/math_private.h>
-#endif
diff --git a/sysdeps/x86_64/fpu/s_copysign.S b/sysdeps/x86_64/fpu/s_copysign.S
index f1ebcf8bf1..f3d9b0cbb4 100644
--- a/sysdeps/x86_64/fpu/s_copysign.S
+++ b/sysdeps/x86_64/fpu/s_copysign.S
@@ -1,5 +1,5 @@
 /* copy sign, double version.
-   Copyright (C) 2002 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2006 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Andreas Jaeger <aj@suse.de>, 2002.
 
@@ -31,6 +31,8 @@
 signmask:
 	.byte 0, 0, 0, 0, 0, 0, 0, 0x80
 	.byte 0, 0, 0, 0, 0, 0, 0, 0
+	ASM_SIZE_DIRECTIVE(signmask)
+	ASM_TYPE_DIRECTIVE(othermask,@object)
 othermask:
 	.byte 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f
 	.byte 0, 0, 0, 0, 0, 0, 0, 0
@@ -42,6 +44,7 @@ othermask:
 #define MO(op) op
 #endif
 
+	.text
 ENTRY(__copysign)
 	andpd MO(othermask),%xmm0
 	andpd MO(signmask),%xmm1
diff --git a/sysdeps/x86_64/fpu/s_copysignf.S b/sysdeps/x86_64/fpu/s_copysignf.S
index f5dc5f78ad..0fbe1d4c96 100644
--- a/sysdeps/x86_64/fpu/s_copysignf.S
+++ b/sysdeps/x86_64/fpu/s_copysignf.S
@@ -1,5 +1,5 @@
 /* copy sign, double version.
-   Copyright (C) 2002 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2006 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Andreas Jaeger <aj@suse.de>, 2002.
 
@@ -38,6 +38,7 @@ mask:
 #define MO(op) op
 #endif
 
+	.text
 ENTRY(__copysignf)
 	movss	MO(mask),%xmm3
 	andps	%xmm3,%xmm0
diff --git a/sysdeps/x86_64/fpu/s_log1pl.S b/sysdeps/x86_64/fpu/s_log1pl.S
index ac2bd22a4f..7fbd0e5aaa 100644
--- a/sysdeps/x86_64/fpu/s_log1pl.S
+++ b/sysdeps/x86_64/fpu/s_log1pl.S
@@ -45,7 +45,7 @@ ENTRY(__log1pl)
 	fxam
 	fnstsw
 	fld	%st
-	testb	$1, %ah
+	andb	$1,%ah
 	jnz	3f		// in case x is NaN or ħInf
 4:
 	fabs
@@ -62,8 +62,7 @@ ENTRY(__log1pl)
 2:	fyl2xp1
 	ret
 
-3:	testb	$4, %ah
-	jnz	4b		// in case x is ħInf
+3:	jp	4b		// in case x is ħInf
 	fstp	%st(1)
 	fstp	%st(1)
 	ret