[llvm] [LoongArch] Record the special AMO operand constraint with TableGen (PR #114398)

WÁNG Xuěruì via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 31 06:24:09 PDT 2024


xen0n wrote:

> > The LoongArch Reference Manual says that the 3-register atomic memory operations cannot have their rd equal to either rj or rk [1](#user-content-fn-1-229b5bab4398a513e3058e283dd99671), and both GNU as and LLVM IAS enforce the constraint.
> 
> This is not true. gas 2.43.50.20241031 still accepts `amswap.w $r0, $r0, $r0`.
> 
> And I prefer to provide the users a way to raise an INE.

Ah of course I meant `(rd == rj || rd == rk) && (rd != 0)` for the error condition.

I'd also appreciate an explicit INE trigger for power users. But it would probably require some spec work to avoid providing the footgun too easily. For now though they can always `.word 0x38600400` for that `amswap.w $r0, $r1, $r0`...

https://github.com/llvm/llvm-project/pull/114398


More information about the llvm-commits mailing list