[llvm] [AMDGPU] Add lit() asm operand modifier for SP3 compatibility. (PR #68839)

Ivan Kosarev via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 12 03:32:12 PDT 2023


kosarev wrote:

> Good. I think the operand of lit() should just be a constant. It should not be allowed to include any other modifiers.

Still might be useful to allow (at some point) expressions within?

> Force lit encoding to be patched as a relocation. We have a sort of w/a for this, but not at asm level. Again, this boils down to the available representation bits. MI Operand has target bits, but MCOperand does not.

Well, we can have our own `AMDGPUMCExpr`s.

> abs(neg(x)) could be treated as abs(x).

So far I was under impression that these modifiers are supposed to designate corresponding encoding bits, just as our `id[:value]` instruction modifiers do, in which case the expectation would probably be to not allow combinations that are not supported by the target hardware.

Otherwise, if we see these more like generic expressions, then maybe using the good old minus sign would make more sense than `neg()`?

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


More information about the llvm-commits mailing list