Skip to content

Commit 4dc7a53

Browse files
committed
xtensa/memcpy.S: Fix invalid asm code
"srli a11, a8, 30" is invalid, srli shifts by 0 to 15 bits. Some assemblers (e.g. gas 2.40) automatically translate a srli statement with > 15 bit shift to an extui statement, some others (clang 16 with espressif patches) don't. Using extui works with both. Closes espressif#11
1 parent ff0b7d9 commit 4dc7a53

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

newlib/libc/machine/xtensa/memcpy.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ memcpy:
258258
unaligned src. */
259259
ssa8 a3 // set shift amount from byte offset
260260
#if UNALIGNED_ADDRESSES_CHECKED
261-
srli a11, a8, 30 // save unalignment offset for below
261+
extui a11, a8, 30, 2 // save unalignment offset for below
262262
sub a3, a3, a11 // align a3
263263
#endif
264264
l32i a6, a3, 0 // load first word

0 commit comments

Comments
 (0)