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

[PATCH 4/4] arm: Enable ARM mode for armv6 strlen


Current optimized armv6t2 strlen uses the NO_THUMB wrongly to
conditionalize thumb instruction usage.  The flags is meant to be
defined before sysdep.h inclusion and to indicate the assembly
requires to build in ARM mode, not to check whether thumb is
enable or not.  This patch fixes it by using the GCC provided
'__thumb__' instead.

Checked on arm-linux-gnueabihf (with -marm -march=armv6t2).

	* sysdeps/arm/armv6t2/strlen.S (NO_THUMB): Check for __thumb__
	instead.
---
 ChangeLog                    | 3 +++
 sysdeps/arm/armv6t2/strlen.S | 6 +++---
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/sysdeps/arm/armv6t2/strlen.S b/sysdeps/arm/armv6t2/strlen.S
index 6988183..f4111c3 100644
--- a/sysdeps/arm/armv6t2/strlen.S
+++ b/sysdeps/arm/armv6t2/strlen.S
@@ -21,7 +21,7 @@
 
  */
 
-#include <arm-features.h>               /* This might #define NO_THUMB.  */
+#include <arm-features.h>
 #include <sysdep.h>
 
 #ifdef __ARMEB__
@@ -32,7 +32,7 @@
 #define S2HI		lsl
 #endif
 
-#ifndef NO_THUMB
+#ifdef __thumb__
 /* This code is best on Thumb.  */
 	.thumb
 #else
@@ -146,7 +146,7 @@ ENTRY(strlen)
 	tst	tmp1, #4
 	pld	[src, #64]
 	S2HI	tmp2, const_m1, tmp2
-#ifdef NO_THUMB
+#ifndef __thumb__
 	mvn	tmp1, tmp2
 	orr	data1a, data1a, tmp1
 	itt	ne
-- 
2.7.4


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