Skip to content

Commit 807e39e

Browse files
svens-s390Alexander Gordeev
authored andcommitted
s390/lib: Use exrl instead of ex in string functions
exrl is present in all machines currently supported in the linux kernel, therefore prefer it over ex. This saves one instruction and doesn't need an additional register to hold the address of the target instruction. Reviewed-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Sven Schnelle <svens@linux.ibm.com> Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
1 parent f8107a8 commit 807e39e

1 file changed

Lines changed: 5 additions & 10 deletions

File tree

arch/s390/lib/mem.S

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@ SYM_FUNC_START(__memmove)
3434
la %r3,256(%r3)
3535
brctg %r0,.Lmemmove_forward_loop
3636
.Lmemmove_forward_remainder:
37-
larl %r5,.Lmemmove_mvc
38-
ex %r4,0(%r5)
37+
exrl %r4,.Lmemmove_mvc
3938
.Lmemmove_exit:
4039
BR_EX %r14
4140
.Lmemmove_reverse:
@@ -83,8 +82,7 @@ SYM_FUNC_START(__memset)
8382
la %r1,256(%r1)
8483
brctg %r3,.Lmemset_clear_loop
8584
.Lmemset_clear_remainder:
86-
larl %r3,.Lmemset_xc
87-
ex %r4,0(%r3)
85+
exrl %r4,.Lmemset_xc
8886
.Lmemset_exit:
8987
BR_EX %r14
9088
.Lmemset_fill:
@@ -102,8 +100,7 @@ SYM_FUNC_START(__memset)
102100
brctg %r5,.Lmemset_fill_loop
103101
.Lmemset_fill_remainder:
104102
stc %r3,0(%r1)
105-
larl %r5,.Lmemset_mvc
106-
ex %r4,0(%r5)
103+
exrl %r4,.Lmemset_mvc
107104
BR_EX %r14
108105
.Lmemset_fill_exit:
109106
stc %r3,0(%r1)
@@ -132,8 +129,7 @@ SYM_FUNC_START(__memcpy)
132129
lgr %r1,%r2
133130
jnz .Lmemcpy_loop
134131
.Lmemcpy_remainder:
135-
larl %r5,.Lmemcpy_mvc
136-
ex %r4,0(%r5)
132+
exrl %r4,.Lmemcpy_mvc
137133
.Lmemcpy_exit:
138134
BR_EX %r14
139135
.Lmemcpy_loop:
@@ -175,8 +171,7 @@ SYM_FUNC_START(__memset\bits)
175171
brctg %r5,.L__memset_loop\bits
176172
.L__memset_remainder\bits:
177173
\insn %r3,0(%r1)
178-
larl %r5,.L__memset_mvc\bits
179-
ex %r4,0(%r5)
174+
exrl %r4,.L__memset_mvc\bits
180175
BR_EX %r14
181176
.L__memset_store\bits:
182177
\insn %r3,0(%r2)

0 commit comments

Comments
 (0)