aboutsummaryrefslogtreecommitdiffstats
path: root/arch/xtensa/lib/strnlen_user.S
diff options
context:
space:
mode:
Diffstat (limited to 'arch/xtensa/lib/strnlen_user.S')
-rw-r--r--arch/xtensa/lib/strnlen_user.S33
1 files changed, 17 insertions, 16 deletions
diff --git a/arch/xtensa/lib/strnlen_user.S b/arch/xtensa/lib/strnlen_user.S
index 5e9c1e709b2e..ad3f616322ca 100644
--- a/arch/xtensa/lib/strnlen_user.S
+++ b/arch/xtensa/lib/strnlen_user.S
@@ -24,18 +24,18 @@
24/* 24/*
25 * size_t __strnlen_user(const char *s, size_t len) 25 * size_t __strnlen_user(const char *s, size_t len)
26 */ 26 */
27.text 27
28.begin literal 28#ifdef __XTENSA_EB__
29.align 4 29# define MASK0 0xff000000
30.Lmask0: 30# define MASK1 0x00ff0000
31 .byte 0xff, 0x00, 0x00, 0x00 31# define MASK2 0x0000ff00
32.Lmask1: 32# define MASK3 0x000000ff
33 .byte 0x00, 0xff, 0x00, 0x00 33#else
34.Lmask2: 34# define MASK0 0x000000ff
35 .byte 0x00, 0x00, 0xff, 0x00 35# define MASK1 0x0000ff00
36.Lmask3: 36# define MASK2 0x00ff0000
37 .byte 0x00, 0x00, 0x00, 0xff 37# define MASK3 0xff000000
38.end literal 38#endif
39 39
40# Register use: 40# Register use:
41# a2/ src 41# a2/ src
@@ -48,6 +48,7 @@
48# a9/ tmp 48# a9/ tmp
49# a10/ tmp 49# a10/ tmp
50 50
51.text
51.align 4 52.align 4
52.global __strnlen_user 53.global __strnlen_user
53.type __strnlen_user,@function 54.type __strnlen_user,@function
@@ -56,10 +57,10 @@ __strnlen_user:
56 # a2/ s, a3/ len 57 # a2/ s, a3/ len
57 addi a4, a2, -4 # because we overincrement at the end; 58 addi a4, a2, -4 # because we overincrement at the end;
58 # we compensate with load offsets of 4 59 # we compensate with load offsets of 4
59 l32r a5, .Lmask0 # mask for byte 0 60 movi a5, MASK0 # mask for byte 0
60 l32r a6, .Lmask1 # mask for byte 1 61 movi a6, MASK1 # mask for byte 1
61 l32r a7, .Lmask2 # mask for byte 2 62 movi a7, MASK2 # mask for byte 2
62 l32r a8, .Lmask3 # mask for byte 3 63 movi a8, MASK3 # mask for byte 3
63 bbsi.l a2, 0, .L1mod2 # if only 8-bit aligned 64 bbsi.l a2, 0, .L1mod2 # if only 8-bit aligned
64 bbsi.l a2, 1, .L2mod4 # if only 16-bit aligned 65 bbsi.l a2, 1, .L2mod4 # if only 16-bit aligned
65 66