diff --git a/llvm/lib/Target/DirectX/DXIL.td b/llvm/lib/Target/DirectX/DXIL.td index f878b7c271cd37..852953a6b0df14 100644 --- a/llvm/lib/Target/DirectX/DXIL.td +++ b/llvm/lib/Target/DirectX/DXIL.td @@ -51,195 +51,194 @@ def SplitDoubleTy : DXILOpParamType; class DXILOpClass; -defset list OpClasses = { - def acceptHitAndEndSearch : DXILOpClass; - def allocateNodeOutputRecords : DXILOpClass; - def allocateRayQuery : DXILOpClass; - def annotateHandle : DXILOpClass; - def annotateNodeHandle : DXILOpClass; - def annotateNodeRecordHandle : DXILOpClass; - def atomicBinOp : DXILOpClass; - def atomicCompareExchange : DXILOpClass; - def attributeAtVertex : DXILOpClass; - def barrier : DXILOpClass; - def barrierByMemoryHandle : DXILOpClass; - def barrierByMemoryType : DXILOpClass; - def barrierByNodeRecordHandle : DXILOpClass; - def binary : DXILOpClass; - def binaryWithCarryOrBorrow : DXILOpClass; - def binaryWithTwoOuts : DXILOpClass; - def bitcastF16toI16 : DXILOpClass; - def bitcastF32toI32 : DXILOpClass; - def bitcastF64toI64 : DXILOpClass; - def bitcastI16toF16 : DXILOpClass; - def bitcastI32toF32 : DXILOpClass; - def bitcastI64toF64 : DXILOpClass; - def bufferLoad : DXILOpClass; - def bufferStore : DXILOpClass; - def bufferUpdateCounter : DXILOpClass; - def calculateLOD : DXILOpClass; - def callShader : DXILOpClass; - def cbufferLoad : DXILOpClass; - def cbufferLoadLegacy : DXILOpClass; - def checkAccessFullyMapped : DXILOpClass; - def coverage : DXILOpClass; - def createHandle : DXILOpClass; - def createHandleForLib : DXILOpClass; - def createHandleFromBinding : DXILOpClass; - def createHandleFromHeap : DXILOpClass; - def createNodeInputRecordHandle : DXILOpClass; - def createNodeOutputHandle : DXILOpClass; - def cutStream : DXILOpClass; - def cycleCounterLegacy : DXILOpClass; - def discard : DXILOpClass; - def dispatchMesh : DXILOpClass; - def dispatchRaysDimensions : DXILOpClass; - def dispatchRaysIndex : DXILOpClass; - def domainLocation : DXILOpClass; - def dot2 : DXILOpClass; - def dot2AddHalf : DXILOpClass; - def dot3 : DXILOpClass; - def dot4 : DXILOpClass; - def dot4AddPacked : DXILOpClass; - def emitIndices : DXILOpClass; - def emitStream : DXILOpClass; - def emitThenCutStream : DXILOpClass; - def evalCentroid : DXILOpClass; - def evalSampleIndex : DXILOpClass; - def evalSnapped : DXILOpClass; - def finishedCrossGroupSharing : DXILOpClass; - def flattenedThreadIdInGroup : DXILOpClass; - def geometryIndex : DXILOpClass; - def getDimensions : DXILOpClass; - def getInputRecordCount : DXILOpClass; - def getMeshPayload : DXILOpClass; - def getNodeRecordPtr : DXILOpClass; - def getRemainingRecursionLevels : DXILOpClass; - def groupId : DXILOpClass; - def gsInstanceID : DXILOpClass; - def hitKind : DXILOpClass; - def ignoreHit : DXILOpClass; - def incrementOutputCount : DXILOpClass; - def indexNodeHandle : DXILOpClass; - def innerCoverage : DXILOpClass; - def instanceID : DXILOpClass; - def instanceIndex : DXILOpClass; - def isHelperLane : DXILOpClass; - def isSpecialFloat : DXILOpClass; - def legacyDoubleToFloat : DXILOpClass; - def legacyDoubleToSInt32 : DXILOpClass; - def legacyDoubleToUInt32 : DXILOpClass; - def legacyF16ToF32 : DXILOpClass; - def legacyF32ToF16 : DXILOpClass; - def loadInput : DXILOpClass; - def loadOutputControlPoint : DXILOpClass; - def loadPatchConstant : DXILOpClass; - def makeDouble : DXILOpClass; - def minPrecXRegLoad : DXILOpClass; - def minPrecXRegStore : DXILOpClass; - def nodeOutputIsValid : DXILOpClass; - def objectRayDirection : DXILOpClass; - def objectRayOrigin : DXILOpClass; - def objectToWorld : DXILOpClass; - def outputComplete : DXILOpClass; - def outputControlPointID : DXILOpClass; - def pack4x8 : DXILOpClass; - def primitiveID : DXILOpClass; - def primitiveIndex : DXILOpClass; - def quadOp : DXILOpClass; - def quadReadLaneAt : DXILOpClass; - def quadVote : DXILOpClass; - def quaternary : DXILOpClass; - def rawBufferLoad : DXILOpClass; - def rawBufferStore : DXILOpClass; - def rayFlags : DXILOpClass; - def rayQuery_Abort : DXILOpClass; - def rayQuery_CommitNonOpaqueTriangleHit : DXILOpClass; - def rayQuery_CommitProceduralPrimitiveHit : DXILOpClass; - def rayQuery_Proceed : DXILOpClass; - def rayQuery_StateMatrix : DXILOpClass; - def rayQuery_StateScalar : DXILOpClass; - def rayQuery_StateVector : DXILOpClass; - def rayQuery_TraceRayInline : DXILOpClass; - def rayTCurrent : DXILOpClass; - def rayTMin : DXILOpClass; - def renderTargetGetSampleCount : DXILOpClass; - def renderTargetGetSamplePosition : DXILOpClass; - def reportHit : DXILOpClass; - def sample : DXILOpClass; - def sampleBias : DXILOpClass; - def sampleCmp : DXILOpClass; - def sampleCmpBias : DXILOpClass; - def sampleCmpGrad : DXILOpClass; - def sampleCmpLevel : DXILOpClass; - def sampleCmpLevelZero : DXILOpClass; - def sampleGrad : DXILOpClass; - def sampleIndex : DXILOpClass; - def sampleLevel : DXILOpClass; - def setMeshOutputCounts : DXILOpClass; - def splitDouble : DXILOpClass; - def startInstanceLocation : DXILOpClass; - def startVertexLocation : DXILOpClass; - def storeOutput : DXILOpClass; - def storePatchConstant : DXILOpClass; - def storePrimitiveOutput : DXILOpClass; - def storeVertexOutput : DXILOpClass; - def tempRegLoad : DXILOpClass; - def tempRegStore : DXILOpClass; - def tertiary : DXILOpClass; - def texture2DMSGetSamplePosition : DXILOpClass; - def textureGather : DXILOpClass; - def textureGatherCmp : DXILOpClass; - def textureGatherRaw : DXILOpClass; - def textureLoad : DXILOpClass; - def textureStore : DXILOpClass; - def textureStoreSample : DXILOpClass; - def threadId : DXILOpClass; - def threadIdInGroup : DXILOpClass; - def traceRay : DXILOpClass; - def unary : DXILOpClass; - def unaryBits : DXILOpClass; - def unpack4x8 : DXILOpClass; - def viewID : DXILOpClass; - def waveActiveAllEqual : DXILOpClass; - def waveActiveBallot : DXILOpClass; - def waveActiveBit : DXILOpClass; - def waveActiveOp : DXILOpClass; - def waveAllOp : DXILOpClass; - def waveAllTrue : DXILOpClass; - def waveAnyTrue : DXILOpClass; - def waveGetLaneCount : DXILOpClass; - def waveGetLaneIndex : DXILOpClass; - def waveIsFirstLane : DXILOpClass; - def waveMatch : DXILOpClass; - def waveMatrix_Accumulate : DXILOpClass; - def waveMatrix_Annotate : DXILOpClass; - def waveMatrix_Depth : DXILOpClass; - def waveMatrix_Fill : DXILOpClass; - def waveMatrix_LoadGroupShared : DXILOpClass; - def waveMatrix_LoadRawBuf : DXILOpClass; - def waveMatrix_Multiply : DXILOpClass; - def waveMatrix_ScalarOp : DXILOpClass; - def waveMatrix_StoreGroupShared : DXILOpClass; - def waveMatrix_StoreRawBuf : DXILOpClass; - def waveMultiPrefixBitCount : DXILOpClass; - def waveMultiPrefixOp : DXILOpClass; - def wavePrefixOp : DXILOpClass; - def waveReadLaneAt : DXILOpClass; - def waveReadLaneFirst : DXILOpClass; - def worldRayDirection : DXILOpClass; - def worldRayOrigin : DXILOpClass; - def worldToObject : DXILOpClass; - def writeSamplerFeedback : DXILOpClass; - def writeSamplerFeedbackBias : DXILOpClass; - def writeSamplerFeedbackGrad : DXILOpClass; - def writeSamplerFeedbackLevel: DXILOpClass; - - // This is a sentinel definition. Hence placed at the end here and - // not as part of the above alphabetically sorted valid definitions. - // It is never used to construct the name of DXIL Op call name. - // Additionally it is capitalized unlike all the others. - def UnknownOpClass : DXILOpClass; +defset list OpClasses = {def acceptHitAndEndSearch: DXILOpClass; +def allocateNodeOutputRecords : DXILOpClass; +def allocateRayQuery : DXILOpClass; +def annotateHandle : DXILOpClass; +def annotateNodeHandle : DXILOpClass; +def annotateNodeRecordHandle : DXILOpClass; +def atomicBinOp : DXILOpClass; +def atomicCompareExchange : DXILOpClass; +def attributeAtVertex : DXILOpClass; +def barrier : DXILOpClass; +def barrierByMemoryHandle : DXILOpClass; +def barrierByMemoryType : DXILOpClass; +def barrierByNodeRecordHandle : DXILOpClass; +def binary : DXILOpClass; +def binaryWithCarryOrBorrow : DXILOpClass; +def binaryWithTwoOuts : DXILOpClass; +def bitcastF16toI16 : DXILOpClass; +def bitcastF32toI32 : DXILOpClass; +def bitcastF64toI64 : DXILOpClass; +def bitcastI16toF16 : DXILOpClass; +def bitcastI32toF32 : DXILOpClass; +def bitcastI64toF64 : DXILOpClass; +def bufferLoad : DXILOpClass; +def bufferStore : DXILOpClass; +def bufferUpdateCounter : DXILOpClass; +def calculateLOD : DXILOpClass; +def callShader : DXILOpClass; +def cbufferLoad : DXILOpClass; +def cbufferLoadLegacy : DXILOpClass; +def checkAccessFullyMapped : DXILOpClass; +def coverage : DXILOpClass; +def createHandle : DXILOpClass; +def createHandleForLib : DXILOpClass; +def createHandleFromBinding : DXILOpClass; +def createHandleFromHeap : DXILOpClass; +def createNodeInputRecordHandle : DXILOpClass; +def createNodeOutputHandle : DXILOpClass; +def cutStream : DXILOpClass; +def cycleCounterLegacy : DXILOpClass; +def discard : DXILOpClass; +def dispatchMesh : DXILOpClass; +def dispatchRaysDimensions : DXILOpClass; +def dispatchRaysIndex : DXILOpClass; +def domainLocation : DXILOpClass; +def dot2 : DXILOpClass; +def dot2AddHalf : DXILOpClass; +def dot3 : DXILOpClass; +def dot4 : DXILOpClass; +def dot4AddPacked : DXILOpClass; +def emitIndices : DXILOpClass; +def emitStream : DXILOpClass; +def emitThenCutStream : DXILOpClass; +def evalCentroid : DXILOpClass; +def evalSampleIndex : DXILOpClass; +def evalSnapped : DXILOpClass; +def finishedCrossGroupSharing : DXILOpClass; +def flattenedThreadIdInGroup : DXILOpClass; +def geometryIndex : DXILOpClass; +def getDimensions : DXILOpClass; +def getInputRecordCount : DXILOpClass; +def getMeshPayload : DXILOpClass; +def getNodeRecordPtr : DXILOpClass; +def getRemainingRecursionLevels : DXILOpClass; +def groupId : DXILOpClass; +def gsInstanceID : DXILOpClass; +def hitKind : DXILOpClass; +def ignoreHit : DXILOpClass; +def incrementOutputCount : DXILOpClass; +def indexNodeHandle : DXILOpClass; +def innerCoverage : DXILOpClass; +def instanceID : DXILOpClass; +def instanceIndex : DXILOpClass; +def isHelperLane : DXILOpClass; +def isSpecialFloat : DXILOpClass; +def legacyDoubleToFloat : DXILOpClass; +def legacyDoubleToSInt32 : DXILOpClass; +def legacyDoubleToUInt32 : DXILOpClass; +def legacyF16ToF32 : DXILOpClass; +def legacyF32ToF16 : DXILOpClass; +def loadInput : DXILOpClass; +def loadOutputControlPoint : DXILOpClass; +def loadPatchConstant : DXILOpClass; +def makeDouble : DXILOpClass; +def minPrecXRegLoad : DXILOpClass; +def minPrecXRegStore : DXILOpClass; +def nodeOutputIsValid : DXILOpClass; +def objectRayDirection : DXILOpClass; +def objectRayOrigin : DXILOpClass; +def objectToWorld : DXILOpClass; +def outputComplete : DXILOpClass; +def outputControlPointID : DXILOpClass; +def pack4x8 : DXILOpClass; +def primitiveID : DXILOpClass; +def primitiveIndex : DXILOpClass; +def quadOp : DXILOpClass; +def quadReadLaneAt : DXILOpClass; +def quadVote : DXILOpClass; +def quaternary : DXILOpClass; +def rawBufferLoad : DXILOpClass; +def rawBufferStore : DXILOpClass; +def rayFlags : DXILOpClass; +def rayQuery_Abort : DXILOpClass; +def rayQuery_CommitNonOpaqueTriangleHit : DXILOpClass; +def rayQuery_CommitProceduralPrimitiveHit : DXILOpClass; +def rayQuery_Proceed : DXILOpClass; +def rayQuery_StateMatrix : DXILOpClass; +def rayQuery_StateScalar : DXILOpClass; +def rayQuery_StateVector : DXILOpClass; +def rayQuery_TraceRayInline : DXILOpClass; +def rayTCurrent : DXILOpClass; +def rayTMin : DXILOpClass; +def renderTargetGetSampleCount : DXILOpClass; +def renderTargetGetSamplePosition : DXILOpClass; +def reportHit : DXILOpClass; +def sample : DXILOpClass; +def sampleBias : DXILOpClass; +def sampleCmp : DXILOpClass; +def sampleCmpBias : DXILOpClass; +def sampleCmpGrad : DXILOpClass; +def sampleCmpLevel : DXILOpClass; +def sampleCmpLevelZero : DXILOpClass; +def sampleGrad : DXILOpClass; +def sampleIndex : DXILOpClass; +def sampleLevel : DXILOpClass; +def setMeshOutputCounts : DXILOpClass; +def splitDouble : DXILOpClass; +def startInstanceLocation : DXILOpClass; +def startVertexLocation : DXILOpClass; +def storeOutput : DXILOpClass; +def storePatchConstant : DXILOpClass; +def storePrimitiveOutput : DXILOpClass; +def storeVertexOutput : DXILOpClass; +def tempRegLoad : DXILOpClass; +def tempRegStore : DXILOpClass; +def tertiary : DXILOpClass; +def texture2DMSGetSamplePosition : DXILOpClass; +def textureGather : DXILOpClass; +def textureGatherCmp : DXILOpClass; +def textureGatherRaw : DXILOpClass; +def textureLoad : DXILOpClass; +def textureStore : DXILOpClass; +def textureStoreSample : DXILOpClass; +def threadId : DXILOpClass; +def threadIdInGroup : DXILOpClass; +def traceRay : DXILOpClass; +def unary : DXILOpClass; +def unaryBits : DXILOpClass; +def unpack4x8 : DXILOpClass; +def viewID : DXILOpClass; +def waveActiveAllEqual : DXILOpClass; +def waveActiveBallot : DXILOpClass; +def waveActiveBit : DXILOpClass; +def waveActiveOp : DXILOpClass; +def waveAllOp : DXILOpClass; +def waveAllTrue : DXILOpClass; +def waveAnyTrue : DXILOpClass; +def waveGetLaneCount : DXILOpClass; +def waveGetLaneIndex : DXILOpClass; +def waveIsFirstLane : DXILOpClass; +def waveMatch : DXILOpClass; +def waveMatrix_Accumulate : DXILOpClass; +def waveMatrix_Annotate : DXILOpClass; +def waveMatrix_Depth : DXILOpClass; +def waveMatrix_Fill : DXILOpClass; +def waveMatrix_LoadGroupShared : DXILOpClass; +def waveMatrix_LoadRawBuf : DXILOpClass; +def waveMatrix_Multiply : DXILOpClass; +def waveMatrix_ScalarOp : DXILOpClass; +def waveMatrix_StoreGroupShared : DXILOpClass; +def waveMatrix_StoreRawBuf : DXILOpClass; +def waveMultiPrefixBitCount : DXILOpClass; +def waveMultiPrefixOp : DXILOpClass; +def wavePrefixOp : DXILOpClass; +def waveReadLaneAt : DXILOpClass; +def waveReadLaneFirst : DXILOpClass; +def worldRayDirection : DXILOpClass; +def worldRayOrigin : DXILOpClass; +def worldToObject : DXILOpClass; +def writeSamplerFeedback : DXILOpClass; +def writeSamplerFeedbackBias : DXILOpClass; +def writeSamplerFeedbackGrad : DXILOpClass; +def writeSamplerFeedbackLevel : DXILOpClass; + +// This is a sentinel definition. Hence placed at the end here and +// not as part of the above alphabetically sorted valid definitions. +// It is never used to construct the name of DXIL Op call name. +// Additionally it is capitalized unlike all the others. +def UnknownOpClass : DXILOpClass; } class DXILShaderStage; @@ -305,26 +304,26 @@ class Attributes attrs> { list fn_attrs = attrs; } -defvar BarrierMode_DeviceMemoryBarrier = 2; +defvar BarrierMode_DeviceMemoryBarrier = 2; defvar BarrierMode_DeviceMemoryBarrierWithGroupSync = 3; -defvar BarrierMode_GroupMemoryBarrier = 8; -defvar BarrierMode_GroupMemoryBarrierWithGroupSync = 9; -defvar BarrierMode_AllMemoryBarrier = 10; -defvar BarrierMode_AllMemoryBarrierWithGroupSync = 11; +defvar BarrierMode_GroupMemoryBarrier = 8; +defvar BarrierMode_GroupMemoryBarrierWithGroupSync = 9; +defvar BarrierMode_AllMemoryBarrier = 10; +defvar BarrierMode_AllMemoryBarrierWithGroupSync = 11; // Intrinsic arg selection class IntrinArgSelectType; def IntrinArgSelect_Index : IntrinArgSelectType; -def IntrinArgSelect_I8 : IntrinArgSelectType; -def IntrinArgSelect_I32 : IntrinArgSelectType; +def IntrinArgSelect_I8 : IntrinArgSelectType; +def IntrinArgSelect_I32 : IntrinArgSelectType; class IntrinArgSelect { IntrinArgSelectType type = type_; int value = value_; -} -class IntrinArgIndex : IntrinArgSelect; -class IntrinArgI8 : IntrinArgSelect; -class IntrinArgI32 : IntrinArgSelect; +} class IntrinArgIndex + : IntrinArgSelect; +class IntrinArgI8 : IntrinArgSelect; +class IntrinArgI32 : IntrinArgSelect; // Select which intrinsic to lower from for a DXILOp. // If the intrinsic is the only argument given to IntrinSelect, then the @@ -354,7 +353,8 @@ class IntrinArgI32 : IntrinArgSelect; // >, // ] // -class IntrinSelect arg_selects_=[]> { +class IntrinSelect arg_selects_ = []> { Intrinsic intrinsic = intrinsic_; list arg_selects = arg_selects_; } @@ -392,11 +392,12 @@ class DXILOp { list properties = []; } -// Concrete definitions of DXIL Operations - There are ordered by their OpCode value +// Concrete definitions of DXIL Operations - There are ordered by their OpCode +// value -def Abs : DXILOp<6, unary> { +def Abs : DXILOp<6, unary> { let Doc = "Returns the absolute value of the input."; - let intrinsics = [ IntrinSelect ]; + let intrinsics = [IntrinSelect]; let arguments = [OverloadTy]; let result = OverloadTy; let overloads = [Overloads]; @@ -404,9 +405,10 @@ def Abs : DXILOp<6, unary> { let attributes = [Attributes]; } -def Saturate : DXILOp<7, unary> { - let Doc = "Clamps a single or double precision floating point value to [0.0f...1.0f]."; - let intrinsics = [ IntrinSelect ]; +def Saturate : DXILOp<7, unary> { + let Doc = "Clamps a single or double precision floating point value to " + "[0.0f...1.0f]."; + let intrinsics = [IntrinSelect]; let arguments = [OverloadTy]; let result = OverloadTy; let overloads = [Overloads]; @@ -414,9 +416,9 @@ def Saturate : DXILOp<7, unary> { let attributes = [Attributes]; } -def IsInf : DXILOp<9, isSpecialFloat> { +def IsInf : DXILOp<9, isSpecialFloat> { let Doc = "Determines if the specified value is infinite."; - let intrinsics = [ IntrinSelect ]; + let intrinsics = [IntrinSelect]; let arguments = [OverloadTy]; let result = Int1Ty; let overloads = [Overloads]; @@ -424,9 +426,9 @@ def IsInf : DXILOp<9, isSpecialFloat> { let attributes = [Attributes]; } -def Cos : DXILOp<12, unary> { +def Cos : DXILOp<12, unary> { let Doc = "Returns cosine(theta) for theta in radians."; - let intrinsics = [ IntrinSelect ]; + let intrinsics = [IntrinSelect]; let arguments = [OverloadTy]; let result = OverloadTy; let overloads = [Overloads]; @@ -434,9 +436,9 @@ def Cos : DXILOp<12, unary> { let attributes = [Attributes]; } -def Sin : DXILOp<13, unary> { +def Sin : DXILOp<13, unary> { let Doc = "Returns sine(theta) for theta in radians."; - let intrinsics = [ IntrinSelect ]; + let intrinsics = [IntrinSelect]; let arguments = [OverloadTy]; let result = OverloadTy; let overloads = [Overloads]; @@ -444,9 +446,9 @@ def Sin : DXILOp<13, unary> { let attributes = [Attributes]; } -def Tan : DXILOp<14, unary> { +def Tan : DXILOp<14, unary> { let Doc = "Returns tangent(theta) for theta in radians."; - let intrinsics = [ IntrinSelect ]; + let intrinsics = [IntrinSelect]; let arguments = [OverloadTy]; let result = OverloadTy; let overloads = [Overloads]; @@ -454,9 +456,9 @@ def Tan : DXILOp<14, unary> { let attributes = [Attributes]; } -def ACos : DXILOp<15, unary> { +def ACos : DXILOp<15, unary> { let Doc = "Returns the arccosine of the specified value."; - let intrinsics = [ IntrinSelect ]; + let intrinsics = [IntrinSelect]; let arguments = [OverloadTy]; let result = OverloadTy; let overloads = [Overloads]; @@ -464,9 +466,9 @@ def ACos : DXILOp<15, unary> { let attributes = [Attributes]; } -def ASin : DXILOp<16, unary> { +def ASin : DXILOp<16, unary> { let Doc = "Returns the arcsine of the specified value."; - let intrinsics = [ IntrinSelect ]; + let intrinsics = [IntrinSelect]; let arguments = [OverloadTy]; let result = OverloadTy; let overloads = [Overloads]; @@ -474,9 +476,9 @@ def ASin : DXILOp<16, unary> { let attributes = [Attributes]; } -def ATan : DXILOp<17, unary> { +def ATan : DXILOp<17, unary> { let Doc = "Returns the arctangent of the specified value."; - let intrinsics = [ IntrinSelect ]; + let intrinsics = [IntrinSelect]; let arguments = [OverloadTy]; let result = OverloadTy; let overloads = [Overloads]; @@ -484,9 +486,9 @@ def ATan : DXILOp<17, unary> { let attributes = [Attributes]; } -def HCos : DXILOp<18, unary> { +def HCos : DXILOp<18, unary> { let Doc = "Returns the hyperbolic cosine of the specified value."; - let intrinsics = [ IntrinSelect ]; + let intrinsics = [IntrinSelect]; let arguments = [OverloadTy]; let result = OverloadTy; let overloads = [Overloads]; @@ -494,9 +496,9 @@ def HCos : DXILOp<18, unary> { let attributes = [Attributes]; } -def HSin : DXILOp<19, unary> { +def HSin : DXILOp<19, unary> { let Doc = "Returns the hyperbolic sine of the specified value."; - let intrinsics = [ IntrinSelect ]; + let intrinsics = [IntrinSelect]; let arguments = [OverloadTy]; let result = OverloadTy; let overloads = [Overloads]; @@ -504,9 +506,9 @@ def HSin : DXILOp<19, unary> { let attributes = [Attributes]; } -def HTan : DXILOp<20, unary> { +def HTan : DXILOp<20, unary> { let Doc = "Returns the hyperbolic tan of the specified value."; - let intrinsics = [ IntrinSelect ]; + let intrinsics = [IntrinSelect]; let arguments = [OverloadTy]; let result = OverloadTy; let overloads = [Overloads]; @@ -514,10 +516,10 @@ def HTan : DXILOp<20, unary> { let attributes = [Attributes]; } -def Exp2 : DXILOp<21, unary> { +def Exp2 : DXILOp<21, unary> { let Doc = "Returns the base 2 exponential, or 2**x, of the specified value. " "exp2(x) = 2**x."; - let intrinsics = [ IntrinSelect ]; + let intrinsics = [IntrinSelect]; let arguments = [OverloadTy]; let result = OverloadTy; let overloads = [Overloads]; @@ -525,10 +527,10 @@ def Exp2 : DXILOp<21, unary> { let attributes = [Attributes]; } -def Frac : DXILOp<22, unary> { +def Frac : DXILOp<22, unary> { let Doc = "Returns a fraction from 0 to 1 that represents the decimal part " "of the input."; - let intrinsics = [ IntrinSelect ]; + let intrinsics = [IntrinSelect]; let arguments = [OverloadTy]; let result = OverloadTy; let overloads = [Overloads]; @@ -536,9 +538,9 @@ def Frac : DXILOp<22, unary> { let attributes = [Attributes]; } -def Log2 : DXILOp<23, unary> { +def Log2 : DXILOp<23, unary> { let Doc = "Returns the base-2 logarithm of the specified value."; - let intrinsics = [ IntrinSelect ]; + let intrinsics = [IntrinSelect]; let arguments = [OverloadTy]; let result = OverloadTy; let overloads = [Overloads]; @@ -546,10 +548,10 @@ def Log2 : DXILOp<23, unary> { let attributes = [Attributes]; } -def Sqrt : DXILOp<24, unary> { +def Sqrt : DXILOp<24, unary> { let Doc = "Returns the square root of the specified floating-point value, " "per component."; - let intrinsics = [ IntrinSelect ]; + let intrinsics = [IntrinSelect]; let arguments = [OverloadTy]; let result = OverloadTy; let overloads = [Overloads]; @@ -557,10 +559,10 @@ def Sqrt : DXILOp<24, unary> { let attributes = [Attributes]; } -def RSqrt : DXILOp<25, unary> { +def RSqrt : DXILOp<25, unary> { let Doc = "Returns the reciprocal of the square root of the specified value. " "rsqrt(x) = 1 / sqrt(x)."; - let intrinsics = [ IntrinSelect ]; + let intrinsics = [IntrinSelect]; let arguments = [OverloadTy]; let result = OverloadTy; let overloads = [Overloads]; @@ -568,10 +570,10 @@ def RSqrt : DXILOp<25, unary> { let attributes = [Attributes]; } -def Round : DXILOp<26, unary> { +def Round : DXILOp<26, unary> { let Doc = "Returns the input rounded to the nearest integer within a " "floating-point type."; - let intrinsics = [ IntrinSelect ]; + let intrinsics = [IntrinSelect]; let arguments = [OverloadTy]; let result = OverloadTy; let overloads = [Overloads]; @@ -579,10 +581,10 @@ def Round : DXILOp<26, unary> { let attributes = [Attributes]; } -def Floor : DXILOp<27, unary> { +def Floor : DXILOp<27, unary> { let Doc = "Returns the largest integer that is less than or equal to the input."; - let intrinsics = [ IntrinSelect ]; + let intrinsics = [IntrinSelect]; let arguments = [OverloadTy]; let result = OverloadTy; let overloads = [Overloads]; @@ -590,10 +592,10 @@ def Floor : DXILOp<27, unary> { let attributes = [Attributes]; } -def Ceil : DXILOp<28, unary> { +def Ceil : DXILOp<28, unary> { let Doc = "Returns the smallest integer that is greater than or equal to the " "input."; - let intrinsics = [ IntrinSelect ]; + let intrinsics = [IntrinSelect]; let arguments = [OverloadTy]; let result = OverloadTy; let overloads = [Overloads]; @@ -601,9 +603,9 @@ def Ceil : DXILOp<28, unary> { let attributes = [Attributes]; } -def Trunc : DXILOp<29, unary> { +def Trunc : DXILOp<29, unary> { let Doc = "Returns the specified value truncated to the integer component."; - let intrinsics = [ IntrinSelect ]; + let intrinsics = [IntrinSelect]; let arguments = [OverloadTy]; let result = OverloadTy; let overloads = [Overloads]; @@ -611,157 +613,144 @@ def Trunc : DXILOp<29, unary> { let attributes = [Attributes]; } -def Rbits : DXILOp<30, unary> { +def Rbits : DXILOp<30, unary> { let Doc = "Returns the specified value with its bits reversed."; - let intrinsics = [ IntrinSelect ]; + let intrinsics = [IntrinSelect]; let arguments = [OverloadTy]; let result = OverloadTy; - let overloads = - [Overloads]; + let overloads = [Overloads]; let stages = [Stages]; let attributes = [Attributes]; } -def CountBits : DXILOp<31, unaryBits> { +def CountBits : DXILOp<31, unaryBits> { let Doc = "Returns the number of 1 bits in the specified value."; let arguments = [OverloadTy]; let result = Int32Ty; - let overloads = - [Overloads]; + let overloads = [Overloads]; let stages = [Stages]; let attributes = [Attributes]; } -def FirstbitHi : DXILOp<33, unaryBits> { +def FirstbitHi : DXILOp<33, unaryBits> { let Doc = "Returns the location of the first set bit starting from " "the highest order bit and working downward."; - let intrinsics = [ IntrinSelect ]; + let intrinsics = [IntrinSelect]; let arguments = [OverloadTy]; let result = Int32Ty; - let overloads = - [Overloads]; + let overloads = [Overloads]; let stages = [Stages]; let attributes = [Attributes]; } -def FirstbitSHi : DXILOp<34, unaryBits> { +def FirstbitSHi : DXILOp<34, unaryBits> { let Doc = "Returns the location of the first set bit from " "the highest order bit based on the sign."; - let intrinsics = [ IntrinSelect ]; + let intrinsics = [IntrinSelect]; let arguments = [OverloadTy]; let result = Int32Ty; - let overloads = - [Overloads]; + let overloads = [Overloads]; let stages = [Stages]; let attributes = [Attributes]; } -def FMax : DXILOp<35, binary> { +def FMax : DXILOp<35, binary> { let Doc = "Float maximum. FMax(a,b) = a > b ? a : b"; - let intrinsics = [ IntrinSelect ]; + let intrinsics = [IntrinSelect]; let arguments = [OverloadTy, OverloadTy]; let result = OverloadTy; - let overloads = - [Overloads]; + let overloads = [Overloads]; let stages = [Stages]; let attributes = [Attributes]; } -def FMin : DXILOp<36, binary> { +def FMin : DXILOp<36, binary> { let Doc = "Float minimum. FMin(a,b) = a < b ? a : b"; - let intrinsics = [ IntrinSelect ]; + let intrinsics = [IntrinSelect]; let arguments = [OverloadTy, OverloadTy]; let result = OverloadTy; - let overloads = - [Overloads]; + let overloads = [Overloads]; let stages = [Stages]; let attributes = [Attributes]; } -def SMax : DXILOp<37, binary> { +def SMax : DXILOp<37, binary> { let Doc = "Signed integer maximum. SMax(a,b) = a > b ? a : b"; - let intrinsics = [ IntrinSelect ]; + let intrinsics = [IntrinSelect]; let arguments = [OverloadTy, OverloadTy]; let result = OverloadTy; - let overloads = - [Overloads]; + let overloads = [Overloads]; let stages = [Stages]; let attributes = [Attributes]; } -def SMin : DXILOp<38, binary> { +def SMin : DXILOp<38, binary> { let Doc = "Signed integer minimum. SMin(a,b) = a < b ? a : b"; - let intrinsics = [ IntrinSelect ]; + let intrinsics = [IntrinSelect]; let arguments = [OverloadTy, OverloadTy]; let result = OverloadTy; - let overloads = - [Overloads]; + let overloads = [Overloads]; let stages = [Stages]; let attributes = [Attributes]; } -def UMax : DXILOp<39, binary> { +def UMax : DXILOp<39, binary> { let Doc = "Unsigned integer maximum. UMax(a,b) = a > b ? a : b"; - let intrinsics = [ IntrinSelect ]; + let intrinsics = [IntrinSelect]; let arguments = [OverloadTy, OverloadTy]; let result = OverloadTy; - let overloads = - [Overloads]; + let overloads = [Overloads]; let stages = [Stages]; let attributes = [Attributes]; } -def UMin : DXILOp<40, binary> { +def UMin : DXILOp<40, binary> { let Doc = "Unsigned integer minimum. UMin(a,b) = a < b ? a : b"; - let intrinsics = [ IntrinSelect ]; + let intrinsics = [IntrinSelect]; let arguments = [OverloadTy, OverloadTy]; let result = OverloadTy; - let overloads = - [Overloads]; + let overloads = [Overloads]; let stages = [Stages]; let attributes = [Attributes]; } -def FMad : DXILOp<46, tertiary> { +def FMad : DXILOp<46, tertiary> { let Doc = "Floating point arithmetic multiply/add operation. fmad(m,a,b) = m " "* a + b."; - let intrinsics = [ IntrinSelect ]; + let intrinsics = [IntrinSelect]; let arguments = [OverloadTy, OverloadTy, OverloadTy]; let result = OverloadTy; - let overloads = - [Overloads]; + let overloads = [Overloads]; let stages = [Stages]; let attributes = [Attributes]; } -def IMad : DXILOp<48, tertiary> { +def IMad : DXILOp<48, tertiary> { let Doc = "Signed integer arithmetic multiply/add operation. imad(m,a,b) = m " "* a + b."; - let intrinsics = [ IntrinSelect ]; + let intrinsics = [IntrinSelect]; let arguments = [OverloadTy, OverloadTy, OverloadTy]; let result = OverloadTy; - let overloads = - [Overloads]; + let overloads = [Overloads]; let stages = [Stages]; let attributes = [Attributes]; } -def UMad : DXILOp<49, tertiary> { +def UMad : DXILOp<49, tertiary> { let Doc = "Unsigned integer arithmetic multiply/add operation. umad(m,a, = m " "* a + b."; - let intrinsics = [ IntrinSelect ]; + let intrinsics = [IntrinSelect]; let arguments = [OverloadTy, OverloadTy, OverloadTy]; let result = OverloadTy; - let overloads = - [Overloads]; + let overloads = [Overloads]; let stages = [Stages]; let attributes = [Attributes]; } -def Dot2 : DXILOp<54, dot2> { +def Dot2 : DXILOp<54, dot2> { let Doc = "dot product of two float vectors Dot(a,b) = a[0]*b[0] + ... + " "a[n]*b[n] where n is 0 to 1 inclusive"; - let intrinsics = [ IntrinSelect ]; + let intrinsics = [IntrinSelect]; let arguments = !listsplat(OverloadTy, 4); let result = OverloadTy; let overloads = [Overloads]; @@ -769,10 +758,10 @@ def Dot2 : DXILOp<54, dot2> { let attributes = [Attributes]; } -def Dot3 : DXILOp<55, dot3> { +def Dot3 : DXILOp<55, dot3> { let Doc = "dot product of two float vectors Dot(a,b) = a[0]*b[0] + ... + " "a[n]*b[n] where n is 0 to 2 inclusive"; - let intrinsics = [ IntrinSelect ]; + let intrinsics = [IntrinSelect]; let arguments = !listsplat(OverloadTy, 6); let result = OverloadTy; let overloads = [Overloads]; @@ -780,10 +769,10 @@ def Dot3 : DXILOp<55, dot3> { let attributes = [Attributes]; } -def Dot4 : DXILOp<56, dot4> { +def Dot4 : DXILOp<56, dot4> { let Doc = "dot product of two float vectors Dot(a,b) = a[0]*b[0] + ... + " "a[n]*b[n] where n is 0 to 3 inclusive"; - let intrinsics = [ IntrinSelect ]; + let intrinsics = [IntrinSelect]; let arguments = !listsplat(OverloadTy, 8); let result = OverloadTy; let overloads = [Overloads]; @@ -844,9 +833,8 @@ def CheckAccessFullyMapped : DXILOp<71, checkAccessFullyMapped> { def Barrier : DXILOp<80, barrier> { let Doc = "inserts a memory barrier in the shader"; let intrinsics = [ - IntrinSelect< - int_dx_group_memory_barrier_with_group_sync, - [ IntrinArgI32 ]>, + IntrinSelect]>, ]; let arguments = [Int32Ty]; @@ -857,15 +845,15 @@ def Barrier : DXILOp<80, barrier> { def Discard : DXILOp<82, discard> { let Doc = "discard the current pixel"; - let intrinsics = [ IntrinSelect ]; + let intrinsics = [IntrinSelect]; let arguments = [Int1Ty]; let result = VoidTy; let stages = [Stages]; } -def ThreadId : DXILOp<93, threadId> { +def ThreadId : DXILOp<93, threadId> { let Doc = "Reads the thread ID"; - let intrinsics = [ IntrinSelect ]; + let intrinsics = [IntrinSelect]; let arguments = [OverloadTy]; let result = OverloadTy; let overloads = [Overloads]; @@ -873,9 +861,9 @@ def ThreadId : DXILOp<93, threadId> { let attributes = [Attributes]; } -def GroupId : DXILOp<94, groupId> { +def GroupId : DXILOp<94, groupId> { let Doc = "Reads the group ID (SV_GroupID)"; - let intrinsics = [ IntrinSelect ]; + let intrinsics = [IntrinSelect]; let arguments = [OverloadTy]; let result = OverloadTy; let overloads = [Overloads]; @@ -883,9 +871,9 @@ def GroupId : DXILOp<94, groupId> { let attributes = [Attributes]; } -def ThreadIdInGroup : DXILOp<95, threadIdInGroup> { +def ThreadIdInGroup : DXILOp<95, threadIdInGroup> { let Doc = "Reads the thread ID within the group (SV_GroupThreadID)"; - let intrinsics = [ IntrinSelect ]; + let intrinsics = [IntrinSelect]; let arguments = [OverloadTy]; let result = OverloadTy; let overloads = [Overloads]; @@ -893,26 +881,26 @@ def ThreadIdInGroup : DXILOp<95, threadIdInGroup> { let attributes = [Attributes]; } -def FlattenedThreadIdInGroup : DXILOp<96, flattenedThreadIdInGroup> { +def FlattenedThreadIdInGroup : DXILOp<96, flattenedThreadIdInGroup> { let Doc = "Provides a flattened index for a given thread within a given " "group (SV_GroupIndex)"; - let intrinsics = [ IntrinSelect ]; + let intrinsics = [IntrinSelect]; let result = OverloadTy; let overloads = [Overloads]; let stages = [Stages]; let attributes = [Attributes]; } -def MakeDouble : DXILOp<101, makeDouble> { +def MakeDouble : DXILOp<101, makeDouble> { let Doc = "creates a double value"; - let intrinsics = [ IntrinSelect ]; + let intrinsics = [IntrinSelect]; let arguments = [Int32Ty, Int32Ty]; let result = DoubleTy; let stages = [Stages]; let attributes = [Attributes]; } -def SplitDouble : DXILOp<102, splitDouble> { +def SplitDouble : DXILOp<102, splitDouble> { let Doc = "Splits a double into 2 uints"; let arguments = [OverloadTy]; let result = SplitDoubleTy; @@ -921,9 +909,9 @@ def SplitDouble : DXILOp<102, splitDouble> { let attributes = [Attributes]; } -def WaveIsFirstLane : DXILOp<110, waveIsFirstLane> { +def WaveIsFirstLane : DXILOp<110, waveIsFirstLane> { let Doc = "returns 1 for the first lane in the wave"; - let intrinsics = [ IntrinSelect ]; + let intrinsics = [IntrinSelect]; let arguments = []; let result = Int1Ty; let stages = [Stages]; @@ -931,7 +919,7 @@ def WaveIsFirstLane : DXILOp<110, waveIsFirstLane> { def WaveGetLaneIndex : DXILOp<111, waveGetLaneIndex> { let Doc = "returns the index of the current lane in the wave"; - let intrinsics = [ IntrinSelect ]; + let intrinsics = [IntrinSelect]; let arguments = []; let result = Int32Ty; let stages = [Stages]; @@ -939,25 +927,27 @@ def WaveGetLaneIndex : DXILOp<111, waveGetLaneIndex> { } def WaveActiveAnyTrue : DXILOp<113, waveAnyTrue> { - let Doc = "returns true if the expression is true in any of the active lanes in the current wave"; - let intrinsics = [ IntrinSelect ]; + let Doc = "returns true if the expression is true in any of the active lanes " + "in the current wave"; + let intrinsics = [IntrinSelect]; let arguments = [Int1Ty]; let result = Int1Ty; let stages = [Stages]; } -def WaveReadLaneAt: DXILOp<117, waveReadLaneAt> { +def WaveReadLaneAt : DXILOp<117, waveReadLaneAt> { let Doc = "returns the value from the specified lane"; - let intrinsics = [ IntrinSelect ]; + let intrinsics = [IntrinSelect]; let arguments = [OverloadTy, Int32Ty]; let result = OverloadTy; - let overloads = [Overloads]; + let overloads = [Overloads< + DXIL1_0, [HalfTy, FloatTy, DoubleTy, Int1Ty, Int16Ty, Int32Ty, Int64Ty]>]; let stages = [Stages]; } def WaveAllBitCount : DXILOp<135, waveAllOp> { let Doc = "returns the count of bits set to 1 across the wave"; - let intrinsics = [ IntrinSelect ]; + let intrinsics = [IntrinSelect]; let arguments = [Int1Ty]; let result = Int32Ty; let stages = [Stages]; @@ -966,7 +956,7 @@ def WaveAllBitCount : DXILOp<135, waveAllOp> { def Dot4AddI8Packed : DXILOp<163, dot4AddPacked> { let Doc = "signed dot product of 4 x i8 vectors packed into i32, with " "accumulate to i32"; - let intrinsics = [ IntrinSelect ]; + let intrinsics = [IntrinSelect]; let arguments = [Int32Ty, Int32Ty, Int32Ty]; let result = Int32Ty; let stages = [Stages]; @@ -976,7 +966,7 @@ def Dot4AddI8Packed : DXILOp<163, dot4AddPacked> { def Dot4AddU8Packed : DXILOp<164, dot4AddPacked> { let Doc = "unsigned dot product of 4 x i8 vectors packed into i32, with " "accumulate to i32"; - let intrinsics = [ IntrinSelect ]; + let intrinsics = [IntrinSelect]; let arguments = [Int32Ty, Int32Ty, Int32Ty]; let result = Int32Ty; let stages = [Stages];