From patchwork Mon Dec 4 23:13:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lu, Hongjiu" X-Patchwork-Id: 24720 Received: (qmail 127287 invoked by alias); 4 Dec 2017 23:13:19 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 127277 invoked by uid 89); 4 Dec 2017 23:13:19 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.6 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, NO_DNS_FOR_FROM autolearn=ham version=3.3.2 spammy= X-HELO: mga01.intel.com X-ExtLoop1: 1 Date: Mon, 4 Dec 2017 15:13:15 -0800 From: "H.J. Lu" To: GNU C Library Subject: [PATCH] x86-64: Use direct TLS initial-exec access to update errno Message-ID: <20171204231315.GA17402@intel.com> Reply-To: "H.J. Lu" MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.9.1 (2017-09-22) 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):