about summary refs log tree commit diff
diff options
context:
space:
mode:
authorSiddhesh Poyarekar <siddhesh@sourceware.org>2018-03-14 18:51:05 +0530
committerWilco Dijkstra <wdijkstr@arm.com>2019-09-06 17:14:47 +0100
commit00fd3acde1475e1bc488ee13ae124d0340da856e (patch)
tree7646027c2faf213cf392a2ad4935ecd363289f66
parentaf9381b734e2218f84235e000cd20d2824a6ed42 (diff)
downloadglibc-00fd3acde1475e1bc488ee13ae124d0340da856e.tar.gz
glibc-00fd3acde1475e1bc488ee13ae124d0340da856e.tar.xz
glibc-00fd3acde1475e1bc488ee13ae124d0340da856e.zip
aarch64/strncmp: Unbreak builds with old binutils
Binutils 2.26.* and older do not support moves with shifted registers,
so use a separate shift instruction instead.

(cherry picked from commit d46f84de745db8f3f06a37048261f4e5ceacf0a3)
-rw-r--r--ChangeLog5
-rw-r--r--sysdeps/aarch64/strncmp.S6
2 files changed, 9 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index b1de9c05c8..2c388920dc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2019-09-06  Siddhesh Poyarekar  <siddhesh@sourceware.org>
 
+	* sysdeps/aarch64/strncmp.S (strncmp): Use a separate shift
+	instruction to unbreak builds with binutils 2.26 and older.
+
+2019-09-06  Siddhesh Poyarekar  <siddhesh@sourceware.org>
+
 	* sysdeps/aarch64/strncmp.S (count): New macro.
 	(strncmp): Store misaligned length in SRC1 in COUNT.
 	(mutual_align): Adjust.
diff --git a/sysdeps/aarch64/strncmp.S b/sysdeps/aarch64/strncmp.S
index 33c07befd8..d1bfa27ca4 100644
--- a/sysdeps/aarch64/strncmp.S
+++ b/sysdeps/aarch64/strncmp.S
@@ -208,13 +208,15 @@ L(done):
 	/* Align the SRC1 to a dword by doing a bytewise compare and then do
 	   the dword loop.  */
 L(try_misaligned_words):
-	mov	limit_wd, limit, lsr #3
+	mov	limit_wd, limit
+	lsr	limit_wd, limit_wd, #3
 	cbz	count, L(do_misaligned)
 
 	neg	count, count
 	and	count, count, #7
 	sub	limit, limit, count
-	mov	limit_wd, limit, lsr #3
+	mov	limit_wd, limit
+	lsr	limit_wd, limit_wd, #3
 
 L(page_end_loop):
 	ldrb	data1w, [src1], #1