[PATCH] D103010: [PowerPC] Export 16 byte load-store instructions

Kai Luo via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 10 19:45:09 PDT 2021


lkail added inline comments.


================
Comment at: llvm/lib/Target/PowerPC/PPCRegisterInfo.td:125
+// GP8Pair - Paired GP8.
+class GP8Pair<string n, GP8 SubReg0, GP8 SubReg1> : PPCReg<n> {
+  let HWEncoding = SubReg0.HWEncoding;
----------------
jsji wrote:
> nit: This doesn't enforce the relationship between SubReg0 and SubReg1 in Pair.
> 
> How about something like?
> ```
> // GP8Pair - Paired GP8.
> class GP8Pair<string n, bits<5> EvenIndex>: PPCReg<n>{
>   assert !eq(EvenIndex{0},0), "Index should be even";
>   let HWEncoding{4-0} = EvenIndex ;
>   let SubRegs = [!cast<GP8>("X"#EvenIndex), !cast<GP8>("X"#!add(EvenIndex, 1))];
>   let DwarfNumbers = [-1,-1] ;
>   let SubRegIndices = [sub_gp8_x0, sub_gp8_x1] ;
> }
> ```
> 
> then we can define pair safely and simply like:
> ```
> // 16 paired even-odd consecutive GP8s.
> foreach Index = { 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30 } in {
>     def G8p#!srl(Index, 1) : GP8Pair<"r"#Index, Index>;
> }
> ```
Nice one.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D103010



More information about the llvm-commits mailing list