[PATCH] D125700: [AMDGPU][GFX9] Support base+soffset+offset SMEM loads.

Ivan Kosarev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 19 06:30:58 PDT 2022


kosarev added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/SMInstructions.td:559
+  // (no-offset + soffset) case, namely:
+  //   imm=0  soffset_en=1  offset=?  soffset=<soffset>
+  //   imm=1  soffset_en=1  offset=0  soffset=<soffset>
----------------
foad wrote:
> kosarev wrote:
> > dp wrote:
> > > kosarev wrote:
> > > > dp wrote:
> > > > > This addressing mode is semantically equivalent to the one where soffset is encoded in the offset field. I'm not sure we really need it. Note that sp3 has no syntactic sugar to enforce this encoding. It may be useful for decoder, but I doubt it worth the trouble.
> > > > Yes, these are not needed for codegen needs and may only be useful for disassembling. Should we leave the TODOs be until we know for sure what to do with this?
> > > Let us see what other people here think. I'd have replaced TODOs with a description of limitations of the current design. But this is a matter of taste.
> > Tagging @foad @arsenm @rampitec for visibility.
> > 
> > Re replacing TODOs with descriptions: my only concern here would be to avoid masking what might be considered a real problem.
> I don't understand why these cases are not supported by the disassembler with the current patch. What happens if you try to disassemble them?
It's being treated as non-instruction. Here's what I get for the example above:
```
; llvm-mc -filetype=obj -triple=amdgcn--amdpal -mcpu=tonga -show-encoding x.s | llvm-objdump -d --mcpu=tonga -
.text
  .long 0xc0024141, 0x00012345
```
```
0000000000000000 <.text>:
    .long 0xc0024141                                           // 000000000000: C0024141
    v_cndmask_b32_e32 v0, v69, v145, vcc                       // 000000000004: 00012345
```

I'm going to look into how subtarget predicates work for decoding facilities first and then as plan B maybe try something like opcode canonicalisation.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D125700/new/

https://reviews.llvm.org/D125700



More information about the llvm-commits mailing list