summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2014-05-25 14:15:14 -0400
committerWill Newton <will.newton@linaro.org>2014-07-03 15:16:34 +0100
commit59192e8755c29f90ad9a1e778c70bb0732a8dffd (patch)
treeb0a3df127e34b6f164a16bf6ec10df6147a0b550
parent9c7dad51d404f38624d8a4301646dde981a285f5 (diff)
aarch64: Pass regno parameter to SINGLE_THREAD_P
Use cbz instead of cmp+b.eq.
-rw-r--r--libc/ports/ChangeLog.aarch64.linaro4
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/aarch64/nptl/sysdep-cancel.h18
2 files changed, 12 insertions, 10 deletions
diff --git a/libc/ports/ChangeLog.aarch64.linaro b/libc/ports/ChangeLog.aarch64.linaro
index 4730abda5..4cf980ec2 100644
--- a/libc/ports/ChangeLog.aarch64.linaro
+++ b/libc/ports/ChangeLog.aarch64.linaro
@@ -1,5 +1,9 @@
2014-05-29 Richard Henderson <rth@twiddle.net>
+ * sysdeps/unix/sysv/linux/aarch64/nptl/sysdep-cancel.h
+ (SINGLE_THREAD_P): New parameter for result regno.
+ (PSEUDO): Update to match; use cbz instead of beq.
+
* sysdeps/unix/sysv/linux/aarch64/nptl/sysdep-cancel.h (PSEUDO):
Use ENTRY to define the _nocancel entry point. Share the syscall
and syscall error check paths with the cancel path.
diff --git a/libc/ports/sysdeps/unix/sysv/linux/aarch64/nptl/sysdep-cancel.h b/libc/ports/sysdeps/unix/sysv/linux/aarch64/nptl/sysdep-cancel.h
index 41502de60..bdb5c7378 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/aarch64/nptl/sysdep-cancel.h
+++ b/libc/ports/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