Open esky-software opened 2 years ago
@llvm/issue-subscribers-backend-arm
The syntax rsbs Rn, Rn, #0
works. I guess rsbs Rn, #0
should be treated as an alias.
To back that up from the manual "ARM Architecture Reference Manual ARMv7-A and ARMv7-R edition". Assembler syntax is:
RSB{S}{<c>}{<q>} {<Rd>,} <Rn>, #<const>
Meaning <Rd>
is optional and takes the value of Rn if not given. From the description of neg
:
Assembler syntax
NEG{<c>}{<q>} <Rd>, <Rm>
This is equivalent to:
RSBS{<c>}{<q>} <Rd>, <Rm>, #0
So it should work. We allow the alias for thumb2 (armv7-m) but not armv6-m so it exists in some form already.
https://godbolt.org/z/eThcvcdch (current main
does the same)
When using clang (LLVM 14.0.0) to process assembler for armv6-m, the instruction 'rsbs Rn, #0' is not recognised, and the equivalent instruction 'negs Rn,Rn' must be used instead.