Skip to content
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

clang compatibility #3

Open
Dirbaio opened this issue Apr 28, 2020 · 0 comments
Open

clang compatibility #3

Dirbaio opened this issue Apr 28, 2020 · 0 comments

Comments

@Dirbaio
Copy link

Dirbaio commented Apr 28, 2020

clang doesn't like the 2-operand form of adcs/sbcs/sbc, with errors like these:

../third_party/x25519-cortex-m4/x25519-cortex-m4-gcc.s:107:2: error: invalid instruction, any one of the following would fix this:
        adcs r2,r8
        ^
../third_party/x25519-cortex-m4/x25519-cortex-m4-gcc.s:107:12: note: too few operands for instruction
        adcs r2,r8
                  ^
../third_party/x25519-cortex-m4/x25519-cortex-m4-gcc.s:107:10: note: operand must be a register in range [r0, r7]
        adcs r2,r8
                ^

This regex converts all 2-operand instructions to 3-operand ones, and it compiles:

perl -0777 -pe 's/(adcs|sbcs|sbc) (r\d+),([^,]+)$/$1 $2,$2,$3/gm' < x25519-cortex-m4-gcc.s > x25519-cortex-m4-clang.s
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

No branches or pull requests

1 participant