aboutsummaryrefslogtreecommitdiff
path: root/string/arm/strlen-armv6t2.S
diff options
context:
space:
mode:
Diffstat (limited to 'string/arm/strlen-armv6t2.S')
-rw-r--r--string/arm/strlen-armv6t2.S33
1 files changed, 14 insertions, 19 deletions
diff --git a/string/arm/strlen-armv6t2.S b/string/arm/strlen-armv6t2.S
index 279ec87..76e6930 100644
--- a/string/arm/strlen-armv6t2.S
+++ b/string/arm/strlen-armv6t2.S
@@ -11,13 +11,7 @@
*/
- .macro def_fn f p2align=0
- .text
- .p2align \p2align
- .global \f
- .type \f, %function
-\f:
- .endm
+#include "../asmdefs.h"
#ifdef __ARMEB__
#define S2LO lsl
@@ -44,27 +38,27 @@
#define tmp1 r4 /* Overlaps const_0 */
#define tmp2 r5
-def_fn __strlen_armv6t2 p2align=6
+ENTRY (__strlen_armv6t2)
pld [srcin, #0]
strd r4, r5, [sp, #-8]!
bic src, srcin, #7
mvn const_m1, #0
ands tmp1, srcin, #7 /* (8 - bytes) to alignment. */
pld [src, #32]
- bne.w .Lmisaligned8
+ bne.w L(misaligned8)
mov const_0, #0
mov result, #-8
-.Lloop_aligned:
+L(loop_aligned):
/* Bytes 0-7. */
ldrd data1a, data1b, [src]
pld [src, #64]
add result, result, #8
-.Lstart_realigned:
+L(start_realigned):
uadd8 data1a, data1a, const_m1 /* Saturating GE<0:3> set. */
sel data1a, const_0, const_m1 /* Select based on GE<0:3>. */
uadd8 data1b, data1b, const_m1
sel data1b, data1a, const_m1 /* Only used if d1a == 0. */
- cbnz data1b, .Lnull_found
+ cbnz data1b, L(null_found)
/* Bytes 8-15. */
ldrd data1a, data1b, [src, #8]
@@ -73,7 +67,7 @@ def_fn __strlen_armv6t2 p2align=6
sel data1a, const_0, const_m1 /* Select based on GE<0:3>. */
uadd8 data1b, data1b, const_m1
sel data1b, data1a, const_m1 /* Only used if d1a == 0. */
- cbnz data1b, .Lnull_found
+ cbnz data1b, L(null_found)
/* Bytes 16-23. */
ldrd data1a, data1b, [src, #16]
@@ -82,7 +76,7 @@ def_fn __strlen_armv6t2 p2align=6
sel data1a, const_0, const_m1 /* Select based on GE<0:3>. */
uadd8 data1b, data1b, const_m1
sel data1b, data1a, const_m1 /* Only used if d1a == 0. */
- cbnz data1b, .Lnull_found
+ cbnz data1b, L(null_found)
/* Bytes 24-31. */
ldrd data1a, data1b, [src, #24]
@@ -93,9 +87,9 @@ def_fn __strlen_armv6t2 p2align=6
uadd8 data1b, data1b, const_m1
sel data1b, data1a, const_m1 /* Only used if d1a == 0. */
cmp data1b, #0
- beq .Lloop_aligned
+ beq L(loop_aligned)
-.Lnull_found:
+L(null_found):
cmp data1a, #0
itt eq
addeq result, result, #4
@@ -108,7 +102,7 @@ def_fn __strlen_armv6t2 p2align=6
add result, result, data1a, lsr #3 /* Bits -> Bytes. */
bx lr
-.Lmisaligned8:
+L(misaligned8):
ldrd data1a, data1b, [src]
and tmp2, tmp1, #3
rsb result, tmp1, #0
@@ -121,5 +115,6 @@ def_fn __strlen_armv6t2 p2align=6
ornne data1b, data1b, tmp2
movne data1a, const_m1
mov const_0, #0
- b .Lstart_realigned
- .size __strlen_armv6t2, . - __strlen_armv6t2
+ b L(start_realigned)
+
+END (__strlen_armv6t2)