[PATCH] arm/strlen-thumb2-Os.S: Correct assembly syntax for ldrb instruction

Keith Packard via Newlib <[email protected]>
Newsgroups gmane.comp.lib.newlib
Message-ID <[email protected]>
We want to use a post-indexed addressing mode (which means use the
original register contents as the address, then increment that
register) which is only valid in Encoding T3 of the LDRB instruction.

According to the ARMv7-M Architecture Reference Manual, the assembly
syntax for Encoding T3 does not include the '.W' width specifier as
that is used to specify Encoding T2, presumably to provide a wider
immediate field for possible relocations.

GAS allows the .W specifier for this addressing mode and generates
identical output with and without it. clang does not allow the .W
specifier for this addressing mode, so removing it offers wider
portability and closer adherance to the ARM assembly syntax
specification.

Signed-off-by: Keith Packard <[email protected]>
---
 newlib/libc/machine/arm/strlen-thumb2-Os.S | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/newlib/libc/machine/arm/strlen-thumb2-Os.S b/newlib/libc/machine/arm/strlen-thumb2-Os.S
index 961f41a0a..aed8adf33 100644
--- a/newlib/libc/machine/arm/strlen-thumb2-Os.S
+++ b/newlib/libc/machine/arm/strlen-thumb2-Os.S
@@ -45,7 +45,7 @@
 
 def_fn	strlen p2align=1
 	mov     r3, r0
-1:	ldrb.w  r2, [r3], #1
+1:	ldrb    r2, [r3], #1
 	cmp     r2, #0
 	bne	1b
 	subs    r0, r3, r0
-- 
2.26.2
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.