summaryrefslogtreecommitdiff
path: root/ports/sysdeps/arm/armv6t2/memchr.S
diff options
context:
space:
mode:
Diffstat (limited to 'ports/sysdeps/arm/armv6t2/memchr.S')
-rw-r--r--ports/sysdeps/arm/armv6t2/memchr.S9
1 files changed, 6 insertions, 3 deletions
diff --git a/ports/sysdeps/arm/armv6t2/memchr.S b/ports/sysdeps/arm/armv6t2/memchr.S
index 7f644c3b85..f758971438 100644
--- a/ports/sysdeps/arm/armv6t2/memchr.S
+++ b/ports/sysdeps/arm/armv6t2/memchr.S
@@ -65,7 +65,8 @@ ENTRY(memchr)
@ Work up to an aligned point
5:
- ldrb r3, [r0],#1
+ sfi_breg r0, \
+ ldrb r3, [\B],#1
subs r2, r2, #1
cmp r3, r1
beq 50f @ If it matches exit found
@@ -90,7 +91,8 @@ ENTRY(memchr)
movs r3, #0
15:
- ldrd r4,r5, [r0],#8
+ sfi_breg r0, \
+ ldrd r4,r5, [\B],#8
#ifndef NO_THUMB
subs r6, r6, #8
#endif
@@ -128,7 +130,8 @@ ENTRY(memchr)
#endif
21: @ Post aligned section, or just a short call
- ldrb r3,[r0],#1
+ sfi_breg r0, \
+ ldrb r3,[\B],#1
#ifndef NO_THUMB
subs r2,r2,#1
eor r3,r3,r1 @ r3 = 0 if match - doesn't break flags from sub