This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] x86-64: Use direct TLS initial-exec access to update errno


Replace __errno_location call with direct TLS initial-exec access to
update errno.

Any comments?

H.J.
---
	* sysdeps/x86_64/fpu/s_cosf.S: Use direct TLS initial-exec
	access to update errno.
	* sysdeps/x86_64/fpu/s_sincosf.S: Likewise.
	* sysdeps/x86_64/fpu/s_sinf.S: Likewise.
---
 sysdeps/x86_64/fpu/s_cosf.S    | 11 ++---------
 sysdeps/x86_64/fpu/s_sincosf.S | 11 ++---------
 sysdeps/x86_64/fpu/s_sinf.S    | 11 ++---------
 3 files changed, 6 insertions(+), 27 deletions(-)

diff --git a/sysdeps/x86_64/fpu/s_cosf.S b/sysdeps/x86_64/fpu/s_cosf.S
index 327fd27fd5..33fff5febc 100644
--- a/sysdeps/x86_64/fpu/s_cosf.S
+++ b/sysdeps/x86_64/fpu/s_cosf.S
@@ -310,15 +310,8 @@ L(arg_inf_or_nan):
 	/* Here if |x| is Inf or NAN */
 	jne	L(skip_errno_setting)	/* in case of x is NaN */
 
-	/* Align stack to 16 bytes.  */
-	subq	$8, %rsp
-	cfi_adjust_cfa_offset (8)
-	/* Here if x is Inf. Set errno to EDOM.  */
-	call	JUMPTARGET(__errno_location)
-	addq	$8, %rsp
-	cfi_adjust_cfa_offset (-8)
-
-	movl	$EDOM, (%rax)
+	movq	errno@gottpoff(%rip), %rax
+	movl	$EDOM, %fs:(%rax)
 
 	.p2align	4
 L(skip_errno_setting):
diff --git a/sysdeps/x86_64/fpu/s_sincosf.S b/sysdeps/x86_64/fpu/s_sincosf.S
index f608aa948f..8549537cbb 100644
--- a/sysdeps/x86_64/fpu/s_sincosf.S
+++ b/sysdeps/x86_64/fpu/s_sincosf.S
@@ -354,15 +354,8 @@ L(arg_inf_or_nan):
 	/* Here if |x| is Inf or NAN */
 	jne	L(skip_errno_setting)	/* in case of x is NaN */
 
-	/* Align stack to 16 bytes.  */
-	subq	$8, %rsp
-	cfi_adjust_cfa_offset (8)
-	/* Here if x is Inf. Set errno to EDOM.  */
-	call	JUMPTARGET(__errno_location)
-	addq	$8, %rsp
-	cfi_adjust_cfa_offset (-8)
-
-	movl	$EDOM, (%rax)
+	movq	errno@gottpoff(%rip), %rax
+	movl	$EDOM, %fs:(%rax)
 
 	.p2align	4
 L(skip_errno_setting):
diff --git a/sysdeps/x86_64/fpu/s_sinf.S b/sysdeps/x86_64/fpu/s_sinf.S
index c505d60091..ddf8dedbf9 100644
--- a/sysdeps/x86_64/fpu/s_sinf.S
+++ b/sysdeps/x86_64/fpu/s_sinf.S
@@ -336,15 +336,8 @@ L(arg_inf_or_nan):
 	/* Here if |x| is Inf or NAN */
 	jne	L(skip_errno_setting)	/* in case of x is NaN */
 
-	/* Align stack to 16 bytes.  */
-	subq	$8, %rsp
-	cfi_adjust_cfa_offset (8)
-	/* Here if x is Inf. Set errno to EDOM.  */
-	call	JUMPTARGET(__errno_location)
-	addq	$8, %rsp
-	cfi_adjust_cfa_offset (-8)
-
-	movl	$EDOM, (%rax)
+	movq	errno@gottpoff(%rip), %rax
+	movl	$EDOM, %fs:(%rax)
 
 	.p2align	4
 L(skip_errno_setting):
-- 
2.14.3


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]