From patchwork Sun May 25 19:41:43 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 352261 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id BBDF6140096 for ; Mon, 26 May 2014 05:42:44 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references; q=dns; s=default; b=krvuCLz11Q+zuVm3Kcdpd+iPD3+r/6+ 39XE/aaOSY9cxRa1liSg73Ox8rfz2pPtXFd5K8qlIfRicZ99ifWSknjcUuJ1282G kgUUWns6/b64Tmfws3UyaXmvIvzGBZEtQSFkTeXPvNjby4REKUqBywHxWtKobaHr ps/kWygPU5W4= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references; s=default; bh=Sv5qN0fxOFZFc2hmsLPeDTKXchs=; b=C4HSo kLo0zT5pCPqPVA3F+p2UQgc9UjXHSn1OUYV0RkQ5c5I7XUWzeoqb+ZgoJu+8LjB5 K2OAxfIKTwWwESU9NoY3IAmIEztgkjqWAN8WNbBIH6RypWx6pqsDCqoscnjonR7x K0UdRLydnX2/5NMtUEWyPzvhlnyaGN92YbiKDY= Received: (qmail 1920 invoked by alias); 25 May 2014 19:42:10 -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 1850 invoked by uid 89); 25 May 2014 19:42:09 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.5 required=5.0 tests=AWL, BAYES_00, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-qc0-f179.google.com X-Received: by 10.140.46.53 with SMTP id j50mr25218727qga.27.1401046926153; Sun, 25 May 2014 12:42:06 -0700 (PDT) From: Richard Henderson To: libc-alpha@sourceware.org Cc: marcus.shawcroft@gmail.com, Richard Henderson Subject: [PATCH v3 3/9] aarch64: Pass regno parameter to SINGLE_THREAD_P Date: Sun, 25 May 2014 12:41:43 -0700 Message-Id: <1401046909-25821-4-git-send-email-rth@twiddle.net> In-Reply-To: <1401046909-25821-1-git-send-email-rth@twiddle.net> References: <1401046909-25821-1-git-send-email-rth@twiddle.net> From: Richard Henderson Use cbz instead of cmp+b.eq. --- sysdeps/unix/sysv/linux/aarch64/nptl/sysdep-cancel.h | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/sysdeps/unix/sysv/linux/aarch64/nptl/sysdep-cancel.h b/sysdeps/unix/sysv/linux/aarch64/nptl/sysdep-cancel.h index 41502de..bdb5c73 100644 --- a/sysdeps/unix/sysv/linux/aarch64/nptl/sysdep-cancel.h +++ b/sysdeps/unix/sysv/linux/aarch64/nptl/sysdep-cancel.h @@ -36,8 +36,8 @@ ENTRY (__##syscall_name##_nocancel); \ .subsection 2; \ .size __##syscall_name##_nocancel,.-__##syscall_name##_nocancel; \ ENTRY (name); \ - SINGLE_THREAD_P; \ - beq .Lpseudo_nocancel; \ + SINGLE_THREAD_P(16); \ + cbz w16, .Lpseudo_nocancel; \ DOCARGS_##args; /* save syscall args etc. around CENABLE. */ \ CENABLE; \ mov x16, x0; /* put mask in safe place. */ \ @@ -161,10 +161,9 @@ ENTRY (name); \ extern int __local_multiple_threads attribute_hidden; # define SINGLE_THREAD_P __builtin_expect (__local_multiple_threads == 0, 1) # else -# define SINGLE_THREAD_P \ - adrp x16, __local_multiple_threads; \ - ldr w16, [x16, :lo12:__local_multiple_threads]; \ - cmp w16, 0; +# define SINGLE_THREAD_P(R) \ + adrp x##R, __local_multiple_threads; \ + ldr w##R, [x##R, :lo12:__local_multiple_threads] # endif # else /* There is no __local_multiple_threads for librt, so use the TCB. */ @@ -173,19 +172,18 @@ extern int __local_multiple_threads attribute_hidden; __builtin_expect (THREAD_GETMEM (THREAD_SELF, \ header.multiple_threads) == 0, 1) # else -# define SINGLE_THREAD_P \ +# define SINGLE_THREAD_P(R) \ stp x0, x30, [sp, -16]!; \ cfi_adjust_cfa_offset (16); \ cfi_rel_offset (x0, 0); \ cfi_rel_offset (x30, 8); \ bl __read_tp; \ sub x0, x0, PTHREAD_SIZEOF; \ - ldr w16, [x0, PTHREAD_MULTIPLE_THREADS_OFFSET]; \ + ldr w##R, [x0, PTHREAD_MULTIPLE_THREADS_OFFSET]; \ ldp x0, x30, [sp], 16; \ cfi_restore (x0); \ cfi_restore (x30); \ - cfi_adjust_cfa_offset (-16); \ - cmp w16, 0; + cfi_adjust_cfa_offset (-16) # endif # endif