• R/O
  • HTTP
  • SSH
  • HTTPS

提交

标签
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

修订版b56bd489812c685819bdec6d83f7990f21473be8 (tree)
时间2019-05-13 16:11:01
作者Max Filippov <jcmvbkbc@gmai...>
CommiterWaldemar Brodkorb

Log Message

xtensa: don't use l32r opcode explicitly

xtensa assembler is capable of representing register loads with either
movi + addmi, l32r or const16, depending on the core configuration.
Don't use '.literal' and 'l32r' directly in the code, use 'movi' and let
the assembler relax them.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>

更改概述

差异

--- a/libc/string/xtensa/strcmp.S
+++ b/libc/string/xtensa/strcmp.S
@@ -37,11 +37,6 @@
3737 .text
3838 .align 4
3939 .literal_position
40- .literal .Lmask0, MASK0
41- .literal .Lmask1, MASK1
42- .literal .Lmask2, MASK2
43- .literal .Lmask3, MASK3
44- .literal .Lmask4, MASK4
4540 ENTRY (strcmp)
4641 /* a2 = s1, a3 = s2 */
4742
@@ -130,10 +125,9 @@ ENTRY (strcmp)
130125 .align 4
131126 #if XCHAL_HAVE_LOOPS
132127 .Laligned:
133- .begin no-transform
134128 movi a11, 0
135- l32r a4, .Lmask0 /* mask for byte 0 */
136- l32r a7, .Lmask4
129+ movi a4, MASK0 /* mask for byte 0 */
130+ movi a7, MASK4
137131 loop a11, .Laligned_done /* Loop forever. */
138132
139133 /* First unrolled loop body. */
@@ -184,10 +178,10 @@ ENTRY (strcmp)
184178 If not, loop over the rest of string using normal algorithm. */
185179
186180 bnone a8, a4, .Leq /* if byte 0 is zero */
187- l32r a5, .Lmask1 /* mask for byte 1 */
188- l32r a6, .Lmask2 /* mask for byte 2 */
181+ movi a5, MASK1 /* mask for byte 1 */
182+ movi a6, MASK2 /* mask for byte 2 */
189183 bnone a8, a5, .Leq /* if byte 1 is zero */
190- l32r a7, .Lmask3 /* mask for byte 3 */
184+ movi a7, MASK3 /* mask for byte 3 */
191185 bnone a8, a6, .Leq /* if byte 2 is zero */
192186 bnone a8, a7, .Leq /* if byte 3 is zero */
193187 addi.n a2, a2, 4 /* advance s1 pointer */
@@ -196,7 +190,6 @@ ENTRY (strcmp)
196190
197191 /* align (1 mod 4) */
198192 loop a11, .Leq /* loop forever */
199- .end no-transform
200193
201194 l32i a8, a2, 0 /* get word from s1 */
202195 l32i a9, a3, 0 /* get word from s2 */