[llvm] [AMDGPU][MC] Disallow null as saddr in flat instructions (PR #101730)

Jun Wang via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 9 12:13:04 PDT 2024


jwanggit86 wrote:

> Does this mean that `global_atomic_add v[1:2], v2, off` will work as before, but `global_atomic_add v[1:2], v2, null` won't be accepted anymore? This doesn't sound ideal if 'null' and 'off' are meant to be aliases (SP3 docs for GFX10 even say that 'off' is a legacy syntax and is translated to 'null').
The instruction `global_atomic_add v[1:2], v2, null` is not valid even without this patch. So already in this case `null` is not treated as an alias for `off`. The problem this patch is address is that the following 2 instructions have the same encoding:
```
global_atomic_add v[1:2], v2, off       ; encoding: [0x00,0x80,0xc8,0xdc,0x01,0x02,0x7d,0x00]
global_atomic_add v1, v2, null          ; encoding: [0x00,0x80,0xc8,0xdc,0x01,0x02,0x7d,0x00]
```


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


More information about the llvm-commits mailing list