Skip to content

clang compatibility #3

Description

@Dirbaio

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions