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
clang doesn't like the 2-operand form of adcs/sbcs/sbc, with errors like these:
This regex converts all 2-operand instructions to 3-operand ones, and it compiles: