diff --git a/llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp b/llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp --- a/llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp +++ b/llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp @@ -358,7 +358,7 @@ bool isUNorm() const { return isImmTy(ImmTyUNorm); } bool isDA() const { return isImmTy(ImmTyDA); } bool isR128A16() const { return isImmTy(ImmTyR128A16); } - bool isGFX10A16() const { return isImmTy(ImmTyA16); } + bool isA16() const { return isImmTy(ImmTyA16); } bool isLWE() const { return isImmTy(ImmTyLWE); } bool isOff() const { return isImmTy(ImmTyOff); } bool isExpTgt() const { return isImmTy(ImmTyExpTgt); } @@ -9125,7 +9125,7 @@ case MCK_gds: case MCK_ImmGDS: return parseNamedBit("gds", Operands, AMDGPUOperand::ImmTyGDS); - case MCK_ImmGFX10A16: + case MCK_ImmA16: return parseNamedBit("a16", Operands, AMDGPUOperand::ImmTyA16); case MCK_ImmHigh: return parseNamedBit("high", Operands, AMDGPUOperand::ImmTyHigh); diff --git a/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUInstPrinter.h b/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUInstPrinter.h --- a/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUInstPrinter.h +++ b/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUInstPrinter.h @@ -86,7 +86,7 @@ raw_ostream &O); void printR128A16(const MCInst *MI, unsigned OpNo, const MCSubtargetInfo &STI, raw_ostream &O); - void printGFX10A16(const MCInst *MI, unsigned OpNo, const MCSubtargetInfo &STI, + void printA16(const MCInst *MI, unsigned OpNo, const MCSubtargetInfo &STI, raw_ostream &O); void printLWE(const MCInst *MI, unsigned OpNo, const MCSubtargetInfo &STI, raw_ostream &O); diff --git a/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUInstPrinter.cpp b/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUInstPrinter.cpp --- a/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUInstPrinter.cpp +++ b/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUInstPrinter.cpp @@ -265,8 +265,8 @@ printNamedBit(MI, OpNo, O, "r128"); } -void AMDGPUInstPrinter::printGFX10A16(const MCInst *MI, unsigned OpNo, - const MCSubtargetInfo &STI, raw_ostream &O) { +void AMDGPUInstPrinter::printA16(const MCInst *MI, unsigned OpNo, + const MCSubtargetInfo &STI, raw_ostream &O) { printNamedBit(MI, OpNo, O, "a16"); } diff --git a/llvm/lib/Target/AMDGPU/MIMGInstructions.td b/llvm/lib/Target/AMDGPU/MIMGInstructions.td --- a/llvm/lib/Target/AMDGPU/MIMGInstructions.td +++ b/llvm/lib/Target/AMDGPU/MIMGInstructions.td @@ -371,7 +371,7 @@ : MIMG_gfx10 { let InOperandList = !con((ins AddrRC:$vaddr0, SReg_256:$srsrc, DMask:$dmask, Dim:$dim, UNorm:$unorm, CPol:$cpol, - R128A16:$r128, GFX10A16:$a16, TFE:$tfe, LWE:$lwe), + R128A16:$r128, A16:$a16, TFE:$tfe, LWE:$lwe), !if(BaseOpcode.HasD16, (ins D16:$d16), (ins))); let AsmString = opcode#" $vdata, $vaddr0, $srsrc$dmask$dim$unorm$cpol$r128$a16$tfe$lwe" #!if(BaseOpcode.HasD16, "$d16", ""); @@ -384,7 +384,7 @@ let InOperandList = !con(AddrIns, (ins SReg_256:$srsrc, DMask:$dmask, Dim:$dim, UNorm:$unorm, CPol:$cpol, - R128A16:$r128, GFX10A16:$a16, TFE:$tfe, LWE:$lwe), + R128A16:$r128, A16:$a16, TFE:$tfe, LWE:$lwe), !if(BaseOpcode.HasD16, (ins D16:$d16), (ins))); let AsmString = opcode#" $vdata, "#AddrAsm#", $srsrc$dmask$dim$unorm$cpol$r128$a16$tfe$lwe" #!if(BaseOpcode.HasD16, "$d16", ""); @@ -396,7 +396,7 @@ : MIMG_gfx11 { let InOperandList = !con((ins AddrRC:$vaddr0, SReg_256:$srsrc, DMask:$dmask, Dim:$dim, UNorm:$unorm, CPol:$cpol, - R128A16:$r128, GFX10A16:$a16, TFE:$tfe, LWE:$lwe), + R128A16:$r128, A16:$a16, TFE:$tfe, LWE:$lwe), !if(BaseOpcode.HasD16, (ins D16:$d16), (ins))); let AsmString = opcode#" $vdata, $vaddr0, $srsrc$dmask$dim$unorm$cpol$r128$a16$tfe$lwe" #!if(BaseOpcode.HasD16, "$d16", ""); @@ -409,7 +409,7 @@ let InOperandList = !con(AddrIns, (ins SReg_256:$srsrc, DMask:$dmask, Dim:$dim, UNorm:$unorm, CPol:$cpol, - R128A16:$r128, GFX10A16:$a16, TFE:$tfe, LWE:$lwe), + R128A16:$r128, A16:$a16, TFE:$tfe, LWE:$lwe), !if(BaseOpcode.HasD16, (ins D16:$d16), (ins))); let AsmString = opcode#" $vdata, "#AddrAsm#", $srsrc$dmask$dim$unorm$cpol$r128$a16$tfe$lwe" #!if(BaseOpcode.HasD16, "$d16", ""); @@ -540,7 +540,7 @@ : MIMG_gfx10 { let InOperandList = !con((ins DataRC:$vdata, AddrRC:$vaddr0, SReg_256:$srsrc, DMask:$dmask, Dim:$dim, UNorm:$unorm, CPol:$cpol, - R128A16:$r128, GFX10A16:$a16, TFE:$tfe, LWE:$lwe), + R128A16:$r128, A16:$a16, TFE:$tfe, LWE:$lwe), !if(BaseOpcode.HasD16, (ins D16:$d16), (ins))); let AsmString = opcode#" $vdata, $vaddr0, $srsrc$dmask$dim$unorm$cpol$r128$a16$tfe$lwe" #!if(BaseOpcode.HasD16, "$d16", ""); @@ -554,7 +554,7 @@ AddrIns, (ins SReg_256:$srsrc, DMask:$dmask, Dim:$dim, UNorm:$unorm, CPol:$cpol, - R128A16:$r128, GFX10A16:$a16, TFE:$tfe, LWE:$lwe), + R128A16:$r128, A16:$a16, TFE:$tfe, LWE:$lwe), !if(BaseOpcode.HasD16, (ins D16:$d16), (ins))); let AsmString = opcode#" $vdata, "#AddrAsm#", $srsrc$dmask$dim$unorm$cpol$r128$a16$tfe$lwe" #!if(BaseOpcode.HasD16, "$d16", ""); @@ -566,7 +566,7 @@ : MIMG_gfx11 { let InOperandList = !con((ins DataRC:$vdata, AddrRC:$vaddr0, SReg_256:$srsrc, DMask:$dmask, Dim:$dim, UNorm:$unorm, CPol:$cpol, - R128A16:$r128, GFX10A16:$a16, TFE:$tfe, LWE:$lwe), + R128A16:$r128, A16:$a16, TFE:$tfe, LWE:$lwe), !if(BaseOpcode.HasD16, (ins D16:$d16), (ins))); let AsmString = opcode#" $vdata, $vaddr0, $srsrc$dmask$dim$unorm$cpol$r128$a16$tfe$lwe" #!if(BaseOpcode.HasD16, "$d16", ""); @@ -580,7 +580,7 @@ AddrIns, (ins SReg_256:$srsrc, DMask:$dmask, Dim:$dim, UNorm:$unorm, CPol:$cpol, - R128A16:$r128, GFX10A16:$a16, TFE:$tfe, LWE:$lwe), + R128A16:$r128, A16:$a16, TFE:$tfe, LWE:$lwe), !if(BaseOpcode.HasD16, (ins D16:$d16), (ins))); let AsmString = opcode#" $vdata, "#AddrAsm#", $srsrc$dmask$dim$unorm$cpol$r128$a16$tfe$lwe" #!if(BaseOpcode.HasD16, "$d16", ""); @@ -724,7 +724,7 @@ let InOperandList = (ins DataRC:$vdata, AddrRC:$vaddr0, SReg_256:$srsrc, DMask:$dmask, Dim:$dim, UNorm:$unorm, CPol:$cpol, - R128A16:$r128, GFX10A16:$a16, TFE:$tfe, LWE:$lwe); + R128A16:$r128, A16:$a16, TFE:$tfe, LWE:$lwe); let AsmString = opcode#" $vdst, $vaddr0, $srsrc$dmask$dim$unorm$cpol$r128$a16$tfe$lwe"; } @@ -740,7 +740,7 @@ AddrIns, (ins SReg_256:$srsrc, DMask:$dmask, Dim:$dim, UNorm:$unorm, CPol:$cpol, - R128A16:$r128, GFX10A16:$a16, TFE:$tfe, LWE:$lwe)); + R128A16:$r128, A16:$a16, TFE:$tfe, LWE:$lwe)); let AsmString = opcode#" $vdata, "#AddrAsm#", $srsrc$dmask$dim$unorm$cpol$r128$a16$tfe$lwe"; } @@ -754,7 +754,7 @@ let InOperandList = (ins DataRC:$vdata, AddrRC:$vaddr0, SReg_256:$srsrc, DMask:$dmask, Dim:$dim, UNorm:$unorm, CPol:$cpol, - R128A16:$r128, GFX10A16:$a16, TFE:$tfe, LWE:$lwe); + R128A16:$r128, A16:$a16, TFE:$tfe, LWE:$lwe); let AsmString = opcode#" $vdst, $vaddr0, $srsrc$dmask$dim$unorm$cpol$r128$a16$tfe$lwe"; } @@ -770,7 +770,7 @@ AddrIns, (ins SReg_256:$srsrc, DMask:$dmask, Dim:$dim, UNorm:$unorm, CPol:$cpol, - R128A16:$r128, GFX10A16:$a16, TFE:$tfe, LWE:$lwe)); + R128A16:$r128, A16:$a16, TFE:$tfe, LWE:$lwe)); let AsmString = opcode#" $vdata, "#AddrAsm#", $srsrc$dmask$dim$unorm$cpol$r128$a16$tfe$lwe"; } @@ -898,7 +898,7 @@ : MIMG_gfx10 { let InOperandList = !con((ins AddrRC:$vaddr0, SReg_256:$srsrc, SReg_128:$ssamp, DMask:$dmask, Dim:$dim, UNorm:$unorm, CPol:$cpol, - R128A16:$r128, GFX10A16:$a16, TFE:$tfe, LWE:$lwe), + R128A16:$r128, A16:$a16, TFE:$tfe, LWE:$lwe), !if(BaseOpcode.HasD16, (ins D16:$d16), (ins))); let AsmString = opcode#" $vdata, $vaddr0, $srsrc, $ssamp$dmask$dim$unorm" #"$cpol$r128$a16$tfe$lwe" @@ -912,7 +912,7 @@ let InOperandList = !con(AddrIns, (ins SReg_256:$srsrc, SReg_128:$ssamp, DMask:$dmask, Dim:$dim, UNorm:$unorm, CPol:$cpol, - R128A16:$r128, GFX10A16:$a16, TFE:$tfe, LWE:$lwe), + R128A16:$r128, A16:$a16, TFE:$tfe, LWE:$lwe), !if(BaseOpcode.HasD16, (ins D16:$d16), (ins))); let AsmString = opcode#" $vdata, "#AddrAsm#", $srsrc, $ssamp$dmask$dim$unorm" #"$cpol$r128$a16$tfe$lwe" @@ -925,7 +925,7 @@ : MIMG_gfx11 { let InOperandList = !con((ins AddrRC:$vaddr0, SReg_256:$srsrc, SReg_128:$ssamp, DMask:$dmask, Dim:$dim, UNorm:$unorm, CPol:$cpol, - R128A16:$r128, GFX10A16:$a16, TFE:$tfe, LWE:$lwe), + R128A16:$r128, A16:$a16, TFE:$tfe, LWE:$lwe), !if(BaseOpcode.HasD16, (ins D16:$d16), (ins))); let AsmString = opcode#" $vdata, $vaddr0, $srsrc, $ssamp$dmask$dim$unorm" #"$cpol$r128$a16$tfe$lwe" @@ -939,7 +939,7 @@ let InOperandList = !con(AddrIns, (ins SReg_256:$srsrc, SReg_128:$ssamp, DMask:$dmask, Dim:$dim, UNorm:$unorm, CPol:$cpol, - R128A16:$r128, GFX10A16:$a16, TFE:$tfe, LWE:$lwe), + R128A16:$r128, A16:$a16, TFE:$tfe, LWE:$lwe), !if(BaseOpcode.HasD16, (ins D16:$d16), (ins))); let AsmString = opcode#" $vdata, "#AddrAsm#", $srsrc, $ssamp$dmask$dim$unorm" #"$cpol$r128$a16$tfe$lwe" @@ -1131,63 +1131,63 @@ multiclass MIMG_Gather_WQM : MIMG_Gather; -class MIMG_IntersectRay_Helper { - int num_addrs = !if(Is64, !if(A16, 9, 12), !if(A16, 8, 11)); +class MIMG_IntersectRay_Helper { + int num_addrs = !if(Is64, !if(IsA16, 9, 12), !if(IsA16, 8, 11)); RegisterClass RegClass = MIMGAddrSize.RegClass; int VAddrDwords = !srl(RegClass.Size, 5); - int gfx11_nsa_addrs = !if(A16, 4, 5); + int gfx11_nsa_addrs = !if(IsA16, 4, 5); RegisterClass node_ptr_type = !if(Is64, VReg_64, VGPR_32); list gfx11_addr_types = - !if(A16, + !if(IsA16, [node_ptr_type, VGPR_32, VReg_96, VReg_96], [node_ptr_type, VGPR_32, VReg_96, VReg_96, VReg_96]); } -class MIMG_IntersectRay_gfx10 +class MIMG_IntersectRay_gfx10 : MIMG_gfx10 { let InOperandList = !con((ins AddrRC:$vaddr0, SReg_128:$srsrc), - !if(A16, (ins GFX10A16:$a16), (ins))); - let AsmString = opcode#" $vdata, $vaddr0, $srsrc"#!if(A16, "$a16", ""); + !if(IsA16, (ins A16:$a16), (ins))); + let AsmString = opcode#" $vdata, $vaddr0, $srsrc"#!if(IsA16, "$a16", ""); let nsa = 0; } -class MIMG_IntersectRay_nsa_gfx10 +class MIMG_IntersectRay_nsa_gfx10 : MIMG_nsa_gfx10 { let InOperandList = !con(nsah.AddrIns, (ins SReg_128:$srsrc), - !if(A16, (ins GFX10A16:$a16), (ins))); - let AsmString = opcode#" $vdata, "#nsah.AddrAsm#", $srsrc"#!if(A16, "$a16", ""); + !if(IsA16, (ins A16:$a16), (ins))); + let AsmString = opcode#" $vdata, "#nsah.AddrAsm#", $srsrc"#!if(IsA16, "$a16", ""); } -class MIMG_IntersectRay_gfx11 +class MIMG_IntersectRay_gfx11 : MIMG_gfx11 { let InOperandList = !con((ins AddrRC:$vaddr0, SReg_128:$srsrc), - !if(A16, (ins GFX10A16:$a16), (ins))); - let AsmString = opcode#" $vdata, $vaddr0, $srsrc"#!if(A16, "$a16", ""); + !if(IsA16, (ins A16:$a16), (ins))); + let AsmString = opcode#" $vdata, $vaddr0, $srsrc"#!if(IsA16, "$a16", ""); let nsa = 0; } class MIMG_IntersectRay_nsa_gfx11 addr_types> + bit IsA16, list addr_types> : MIMG_nsa_gfx11 { let InOperandList = !con(nsah.AddrIns, (ins SReg_128:$srsrc), - !if(A16, (ins GFX10A16:$a16), (ins))); - let AsmString = opcode#" $vdata, "#nsah.AddrAsm#", $srsrc"#!if(A16, "$a16", ""); + !if(IsA16, (ins A16:$a16), (ins))); + let AsmString = opcode#" $vdata, "#nsah.AddrAsm#", $srsrc"#!if(IsA16, "$a16", ""); } -multiclass MIMG_IntersectRay { - defvar info = MIMG_IntersectRay_Helper; +multiclass MIMG_IntersectRay { + defvar info = MIMG_IntersectRay_Helper; def "" : MIMGBaseOpcode { let BVH = 1; } - let AsmMatchConverter = !if(A16, "cvtIntersectRay", ""), + let AsmMatchConverter = !if(IsA16, "cvtIntersectRay", ""), dmask = 0xf, unorm = 1, d16 = 0, @@ -1197,21 +1197,21 @@ r128 = 1, ssamp = 0, dim = {0, 0, 0}, - a16 = A16, + a16 = IsA16, d16 = 0, BaseOpcode = !cast(NAME), VDataDwords = 4 in { - def _sa_gfx10 : MIMG_IntersectRay_gfx10 { + def _sa_gfx10 : MIMG_IntersectRay_gfx10 { let VAddrDwords = info.VAddrDwords; } - def _sa_gfx11 : MIMG_IntersectRay_gfx11 { + def _sa_gfx11 : MIMG_IntersectRay_gfx11 { let VAddrDwords = info.VAddrDwords; } - def _nsa_gfx10 : MIMG_IntersectRay_nsa_gfx10 { + def _nsa_gfx10 : MIMG_IntersectRay_nsa_gfx10 { let VAddrDwords = info.num_addrs; } def _nsa_gfx11 : MIMG_IntersectRay_nsa_gfx11 { let VAddrDwords = info.num_addrs; } diff --git a/llvm/lib/Target/AMDGPU/SIInstrInfo.td b/llvm/lib/Target/AMDGPU/SIInstrInfo.td --- a/llvm/lib/Target/AMDGPU/SIInstrInfo.td +++ b/llvm/lib/Target/AMDGPU/SIInstrInfo.td @@ -1236,7 +1236,7 @@ def UNorm : NamedOperandBit<"UNorm", NamedMatchClass<"UNorm">>; def DA : NamedOperandBit<"DA", NamedMatchClass<"DA">>; def R128A16 : NamedOperandBit<"R128A16", NamedMatchClass<"R128A16">>; -def GFX10A16 : NamedOperandBit<"GFX10A16", NamedMatchClass<"GFX10A16">>; +def A16 : NamedOperandBit<"A16", NamedMatchClass<"A16">>; def D16 : NamedOperandBit<"D16", NamedMatchClass<"D16">>; def LWE : NamedOperandBit<"LWE", NamedMatchClass<"LWE">>; def exp_compr : NamedOperandBit<"ExpCompr", NamedMatchClass<"ExpCompr">>;