diff --git a/llvm/lib/Target/AMDGPU/AMDGPUInstructions.td b/llvm/lib/Target/AMDGPU/AMDGPUInstructions.td index 5023e5394b86e..0adab52530840 100644 --- a/llvm/lib/Target/AMDGPU/AMDGPUInstructions.td +++ b/llvm/lib/Target/AMDGPU/AMDGPUInstructions.td @@ -123,6 +123,8 @@ def FMA : Predicate<"Subtarget->hasFMA()">; def InstFlag : OperandWithDefaultOps ; +def i1imm_0 : OperandWithDefaultOps; + class CustomOperandClass : AsmOperandClass { diff --git a/llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp b/llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp index cb28f8cdfc9ad..e040feb260a32 100644 --- a/llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp +++ b/llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp @@ -121,7 +121,6 @@ class AMDGPUOperand : public MCParsedAsmOperand { ImmTyOffset1, ImmTySMEMOffsetMod, ImmTyCPol, - ImmTySWZ, ImmTyTFE, ImmTyD16, ImmTyClampSI, @@ -378,7 +377,6 @@ class AMDGPUOperand : public MCParsedAsmOperand { bool isGDS() const { return isImmTy(ImmTyGDS); } bool isLDS() const { return isImmTy(ImmTyLDS); } bool isCPol() const { return isImmTy(ImmTyCPol); } - bool isSWZ() const { return isImmTy(ImmTySWZ); } bool isTFE() const { return isImmTy(ImmTyTFE); } bool isD16() const { return isImmTy(ImmTyD16); } bool isFORMAT() const { return isImmTy(ImmTyFORMAT) && isUInt<7>(getImm()); } @@ -1009,7 +1007,6 @@ class AMDGPUOperand : public MCParsedAsmOperand { case ImmTyOffset1: OS << "Offset1"; break; case ImmTySMEMOffsetMod: OS << "SMEMOffsetMod"; break; case ImmTyCPol: OS << "CPol"; break; - case ImmTySWZ: OS << "SWZ"; break; case ImmTyTFE: OS << "TFE"; break; case ImmTyD16: OS << "D16"; break; case ImmTyFORMAT: OS << "FORMAT"; break; @@ -7650,7 +7647,6 @@ void AMDGPUAsmParser::cvtMubufImpl(MCInst &Inst, addOptionalImmOperand(Inst, Operands, OptionalIdx, AMDGPUOperand::ImmTyOffset); addOptionalImmOperand(Inst, Operands, OptionalIdx, AMDGPUOperand::ImmTyCPol, 0); - addOptionalImmOperand(Inst, Operands, OptionalIdx, AMDGPUOperand::ImmTySWZ); } //===----------------------------------------------------------------------===// diff --git a/llvm/lib/Target/AMDGPU/BUFInstructions.td b/llvm/lib/Target/AMDGPU/BUFInstructions.td index cfca2c3229d36..ea1578e30ae8f 100644 --- a/llvm/lib/Target/AMDGPU/BUFInstructions.td +++ b/llvm/lib/Target/AMDGPU/BUFInstructions.td @@ -157,7 +157,7 @@ class getMTBUFInsDA vdataList, RegisterClass vaddrClass = !if(!empty(vaddrList), ?, !head(vaddrList)); RegisterOperand vdata_op = getLdStRegisterOperand.ret; - dag NonVaddrInputs = (ins SReg_128:$srsrc, SCSrc_b32:$soffset, offset:$offset, FORMAT:$format, CPol:$cpol, SWZ:$swz); + dag NonVaddrInputs = (ins SReg_128:$srsrc, SCSrc_b32:$soffset, offset:$offset, FORMAT:$format, CPol:$cpol, i1imm:$swz); dag Inputs = !if(!empty(vaddrList), NonVaddrInputs, !con((ins vaddrClass:$vaddr), NonVaddrInputs)); dag ret = !if(!empty(vdataList), Inputs, !con((ins vdata_op:$vdata), Inputs)); } @@ -185,7 +185,7 @@ class getMTBUFAsmOps { !if(!eq(addrKind, BUFAddrKind.Addr64), "$vaddr, $srsrc,$format $soffset addr64", ""))))); - string ret = " $vdata, " # Pfx # "$offset$cpol$swz"; + string ret = " $vdata, " # Pfx # "$offset$cpol"; } class MTBUF_SetupAddr { @@ -386,7 +386,7 @@ class getMUBUFInsDA vdataList, RegisterClass vaddrClass = !if(!empty(vaddrList), ?, !head(vaddrList)); RegisterOperand vdata_op = getLdStVDataRegisterOperand.ret; - dag NonVaddrInputs = (ins SReg_128:$srsrc, SCSrc_b32:$soffset, offset:$offset, CPol_0:$cpol, SWZ_0:$swz); + dag NonVaddrInputs = (ins SReg_128:$srsrc, SCSrc_b32:$soffset, offset:$offset, CPol_0:$cpol, i1imm_0:$swz); dag Inputs = !if(!empty(vaddrList), NonVaddrInputs, !con((ins vaddrClass:$vaddr), NonVaddrInputs)); dag ret = !if(!empty(vdataList), Inputs, !con((ins vdata_op:$vdata), Inputs)); } @@ -420,7 +420,7 @@ class getMUBUFIns vdataList, bit isTFE> { (ins)))))); } -class getMUBUFAsmOps { +class getMUBUFAsmOps { string Vdata = !if(noVdata, " ", " $vdata, "); string Lds = !if(isLds, " lds", ""); string TFE = !if(isTFE, " tfe", ""); @@ -433,9 +433,8 @@ class getMUBUFAsmOps { @@ -466,7 +465,7 @@ class MUBUF_Load_Pseudo .ret, !if(HasTiedDest, (ins vdata_op:$vdata_in), (ins))), - getMUBUFAsmOps.ret, + getMUBUFAsmOps.ret, pattern>, MUBUF_SetupAddr { let PseudoInstr = opName # !if(isLds, "_lds", "") # !if(isTFE, "_tfe", "") # @@ -561,7 +560,7 @@ class MUBUF_Store_Pseudo .ret], isTFE>.ret, - getMUBUFAsmOps.ret, + getMUBUFAsmOps.ret, pattern>, MUBUF_SetupAddr { let PseudoInstr = opName # "_" # !if(isTFE, "_tfe", "") # @@ -608,8 +607,8 @@ multiclass MUBUF_Pseudo_Stores : MUBUF_Pseudo { + (ins SReg_128:$srsrc, SCSrc_b32:$soffset, offset:$offset, CPol:$cpol, i1imm:$swz), + " $srsrc, $soffset$offset lds$cpol"> { let LGKM_CNT = 1; let mayLoad = 1; let mayStore = 1; diff --git a/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUInstPrinter.cpp b/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUInstPrinter.cpp index fa4790eb7f924..076079ed8f8fb 100644 --- a/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUInstPrinter.cpp +++ b/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUInstPrinter.cpp @@ -208,10 +208,6 @@ void AMDGPUInstPrinter::printCPol(const MCInst *MI, unsigned OpNo, O << " /* unexpected cache policy bit */"; } -void AMDGPUInstPrinter::printSWZ(const MCInst *MI, unsigned OpNo, - const MCSubtargetInfo &STI, raw_ostream &O) { -} - void AMDGPUInstPrinter::printTFE(const MCInst *MI, unsigned OpNo, const MCSubtargetInfo &STI, raw_ostream &O) { printNamedBit(MI, OpNo, O, "tfe"); diff --git a/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUInstPrinter.h b/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUInstPrinter.h index 96b8e77a0c47d..2dbc47cc78a5f 100644 --- a/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUInstPrinter.h +++ b/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUInstPrinter.h @@ -71,8 +71,6 @@ class AMDGPUInstPrinter : public MCInstPrinter { raw_ostream &O); void printCPol(const MCInst *MI, unsigned OpNo, const MCSubtargetInfo &STI, raw_ostream &O); - void printSWZ(const MCInst *MI, unsigned OpNo, const MCSubtargetInfo &STI, - raw_ostream &O); void printTFE(const MCInst *MI, unsigned OpNo, const MCSubtargetInfo &STI, raw_ostream &O); void printDMask(const MCInst *MI, unsigned OpNo, const MCSubtargetInfo &STI, diff --git a/llvm/lib/Target/AMDGPU/SIInstrInfo.td b/llvm/lib/Target/AMDGPU/SIInstrInfo.td index c0ab4991a14f7..2ebfda4912bea 100644 --- a/llvm/lib/Target/AMDGPU/SIInstrInfo.td +++ b/llvm/lib/Target/AMDGPU/SIInstrInfo.td @@ -1094,8 +1094,6 @@ def CPol_0 : DefaultOperand; def CPol_GLC1 : DefaultOperand; def TFE : NamedBitOperand<"tfe">; -def SWZ : NamedBitOperand<"swz">; -def SWZ_0 : DefaultOperand; def UNorm : NamedBitOperand<"unorm">; def DA : NamedBitOperand<"da">; def R128A16 : CustomOperand;