Skip to content

Invalid asm code in newlib/libc/machine/xtensa/memcpy.S #11

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
berolinux opened this issue May 31, 2023 · 0 comments · May be fixed by #12
Open

Invalid asm code in newlib/libc/machine/xtensa/memcpy.S #11

berolinux opened this issue May 31, 2023 · 0 comments · May be fixed by #12

Comments

@berolinux
Copy link

Line 261 of newlib/libc/machine/xtensa/memcpy.S says
srli a11, a8, 30
This is undefined; srli shifts only by 0 to 15 bits, not 30.
Some assemblers seem to translate the srli statement to extui a11, a8, 30, 2, but some (e.g. clang) don't.

berolinux added a commit to berolinux/newlib-esp32 that referenced this issue May 31, 2023
"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
@berolinux berolinux linked a pull request May 31, 2023 that will close this issue
berolinux added a commit to berolinux/newlib-esp32 that referenced this issue May 31, 2023
"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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant