This is the mail archive of the glibc-cvs@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]

[glibc/release/2.26/master] aarch64/strncmp: Use lsr instead of mov+lsr


https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=e3c35100d32f83aa3c0ec57b83746fea9b98bc2f

commit e3c35100d32f83aa3c0ec57b83746fea9b98bc2f
Author: Siddhesh Poyarekar <siddhesh@sourceware.org>
Date:   Thu Mar 15 08:06:21 2018 +0530

    aarch64/strncmp: Use lsr instead of mov+lsr
    
    A lsr can do what the mov and lsr did.
    
    (cherry picked from commit b47c3e7637efb77818cbef55dcd0ed1f0ea0ddf1)

Diff:
---
 ChangeLog                 | 5 +++++
 sysdeps/aarch64/strncmp.S | 6 ++----
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 2c38892..e9557b8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2019-09-06  Siddhesh Poyarekar  <siddhesh@sourceware.org>
 
+	* sysdeps/aarch64/strncmp.S (strncmp): Use lsr instead of
+	mov + lsr.
+
+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.
 
diff --git a/sysdeps/aarch64/strncmp.S b/sysdeps/aarch64/strncmp.S
index d1bfa27..fc1f633 100644
--- a/sysdeps/aarch64/strncmp.S
+++ b/sysdeps/aarch64/strncmp.S
@@ -208,15 +208,13 @@ 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	limit_wd, limit_wd, #3
+	lsr	limit_wd, limit, #3
 	cbz	count, L(do_misaligned)
 
 	neg	count, count
 	and	count, count, #7
 	sub	limit, limit, count
-	mov	limit_wd, limit
-	lsr	limit_wd, limit_wd, #3
+	lsr	limit_wd, limit, #3
 
 L(page_end_loop):
 	ldrb	data1w, [src1], #1


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