brintos

brintos / llvm-project-archived public Read only

0
0
Text · 42.6 KiB · 8b28662 Raw
1201 lines · plain
1//- DXIL.td - Describe DXIL operation -------------------------*- tablegen -*-//2//3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.4// See https://llvm.org/LICENSE.txt for license information.5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception6//7//===----------------------------------------------------------------------===//8///9/// \file10/// This is a target description file for DXIL operations.11///12//===----------------------------------------------------------------------===//13 14include "llvm/IR/Intrinsics.td"15 16// Abstract class to represent major and minor version values17class Version<int major, int minor> {18  int Major = major;19  int Minor = minor;20}21 22// Valid DXIL Version records23foreach i = 0...8 in {24  def DXIL1_ #i : Version<1, i>;25}26 27class DXILOpParamType {28  int isOverload = 0;29}30 31let isOverload = 1 in {32  def OverloadTy : DXILOpParamType;33}34def VoidTy : DXILOpParamType;35def Int1Ty : DXILOpParamType;36def Int8Ty : DXILOpParamType;37def Int16Ty : DXILOpParamType;38def Int32Ty : DXILOpParamType;39def Int64Ty : DXILOpParamType;40def HalfTy : DXILOpParamType;41def FloatTy : DXILOpParamType;42def DoubleTy : DXILOpParamType;43def ResRetHalfTy : DXILOpParamType;44def ResRetFloatTy : DXILOpParamType;45def ResRetDoubleTy : DXILOpParamType;46def ResRetInt16Ty : DXILOpParamType;47def ResRetInt32Ty : DXILOpParamType;48def ResRetInt64Ty : DXILOpParamType;49def CBufRetHalfTy : DXILOpParamType;50def CBufRetFloatTy : DXILOpParamType;51def CBufRetDoubleTy : DXILOpParamType;52def CBufRetInt16Ty : DXILOpParamType;53def CBufRetInt32Ty : DXILOpParamType;54def CBufRetInt64Ty : DXILOpParamType;55def HandleTy : DXILOpParamType;56def ResBindTy : DXILOpParamType;57def ResPropsTy : DXILOpParamType;58def SplitDoubleTy : DXILOpParamType;59def BinaryWithCarryTy : DXILOpParamType;60def DimensionsTy : DXILOpParamType;61 62class DXILOpClass;63 64defset list<DXILOpClass> OpClasses = {65  def acceptHitAndEndSearch : DXILOpClass;66  def allocateNodeOutputRecords : DXILOpClass;67  def allocateRayQuery : DXILOpClass;68  def annotateHandle : DXILOpClass;69  def annotateNodeHandle : DXILOpClass;70  def annotateNodeRecordHandle : DXILOpClass;71  def atomicBinOp : DXILOpClass;72  def atomicCompareExchange : DXILOpClass;73  def attributeAtVertex : DXILOpClass;74  def barrier : DXILOpClass;75  def barrierByMemoryHandle : DXILOpClass;76  def barrierByMemoryType : DXILOpClass;77  def barrierByNodeRecordHandle : DXILOpClass;78  def binary : DXILOpClass;79  def binaryWithCarryOrBorrow : DXILOpClass;80  def binaryWithTwoOuts : DXILOpClass;81  def bitcastF16toI16 : DXILOpClass;82  def bitcastF32toI32 : DXILOpClass;83  def bitcastF64toI64 : DXILOpClass;84  def bitcastI16toF16 : DXILOpClass;85  def bitcastI32toF32 : DXILOpClass;86  def bitcastI64toF64 : DXILOpClass;87  def bufferLoad : DXILOpClass;88  def bufferStore : DXILOpClass;89  def bufferUpdateCounter : DXILOpClass;90  def calculateLOD : DXILOpClass;91  def callShader : DXILOpClass;92  def cbufferLoad : DXILOpClass;93  def cbufferLoadLegacy : DXILOpClass;94  def checkAccessFullyMapped : DXILOpClass;95  def coverage : DXILOpClass;96  def createHandle : DXILOpClass;97  def createHandleForLib : DXILOpClass;98  def createHandleFromBinding : DXILOpClass;99  def createHandleFromHeap : DXILOpClass;100  def createNodeInputRecordHandle : DXILOpClass;101  def createNodeOutputHandle : DXILOpClass;102  def cutStream : DXILOpClass;103  def cycleCounterLegacy : DXILOpClass;104  def discard : DXILOpClass;105  def dispatchMesh : DXILOpClass;106  def dispatchRaysDimensions : DXILOpClass;107  def dispatchRaysIndex : DXILOpClass;108  def domainLocation : DXILOpClass;109  def dot2 : DXILOpClass;110  def dot2AddHalf : DXILOpClass;111  def dot3 : DXILOpClass;112  def dot4 : DXILOpClass;113  def dot4AddPacked : DXILOpClass;114  def emitIndices : DXILOpClass;115  def emitStream : DXILOpClass;116  def emitThenCutStream : DXILOpClass;117  def evalCentroid : DXILOpClass;118  def evalSampleIndex : DXILOpClass;119  def evalSnapped : DXILOpClass;120  def finishedCrossGroupSharing : DXILOpClass;121  def flattenedThreadIdInGroup : DXILOpClass;122  def geometryIndex : DXILOpClass;123  def getDimensions : DXILOpClass;124  def getInputRecordCount : DXILOpClass;125  def getMeshPayload : DXILOpClass;126  def getNodeRecordPtr : DXILOpClass;127  def getRemainingRecursionLevels : DXILOpClass;128  def groupId : DXILOpClass;129  def gsInstanceID : DXILOpClass;130  def hitKind : DXILOpClass;131  def ignoreHit : DXILOpClass;132  def incrementOutputCount : DXILOpClass;133  def indexNodeHandle : DXILOpClass;134  def innerCoverage : DXILOpClass;135  def instanceID : DXILOpClass;136  def instanceIndex : DXILOpClass;137  def isHelperLane : DXILOpClass;138  def isSpecialFloat : DXILOpClass;139  def legacyDoubleToFloat : DXILOpClass;140  def legacyDoubleToSInt32 : DXILOpClass;141  def legacyDoubleToUInt32 : DXILOpClass;142  def legacyF16ToF32 : DXILOpClass;143  def legacyF32ToF16 : DXILOpClass;144  def loadInput : DXILOpClass;145  def loadOutputControlPoint : DXILOpClass;146  def loadPatchConstant : DXILOpClass;147  def makeDouble : DXILOpClass;148  def minPrecXRegLoad : DXILOpClass;149  def minPrecXRegStore : DXILOpClass;150  def nodeOutputIsValid : DXILOpClass;151  def objectRayDirection : DXILOpClass;152  def objectRayOrigin : DXILOpClass;153  def objectToWorld : DXILOpClass;154  def outputComplete : DXILOpClass;155  def outputControlPointID : DXILOpClass;156  def pack4x8 : DXILOpClass;157  def primitiveID : DXILOpClass;158  def primitiveIndex : DXILOpClass;159  def quadOp : DXILOpClass;160  def quadReadLaneAt : DXILOpClass;161  def quadVote : DXILOpClass;162  def quaternary : DXILOpClass;163  def rawBufferLoad : DXILOpClass;164  def rawBufferStore : DXILOpClass;165  def rayFlags : DXILOpClass;166  def rayQuery_Abort : DXILOpClass;167  def rayQuery_CommitNonOpaqueTriangleHit : DXILOpClass;168  def rayQuery_CommitProceduralPrimitiveHit : DXILOpClass;169  def rayQuery_Proceed : DXILOpClass;170  def rayQuery_StateMatrix : DXILOpClass;171  def rayQuery_StateScalar : DXILOpClass;172  def rayQuery_StateVector : DXILOpClass;173  def rayQuery_TraceRayInline : DXILOpClass;174  def rayTCurrent : DXILOpClass;175  def rayTMin : DXILOpClass;176  def renderTargetGetSampleCount : DXILOpClass;177  def renderTargetGetSamplePosition : DXILOpClass;178  def reportHit : DXILOpClass;179  def sample : DXILOpClass;180  def sampleBias : DXILOpClass;181  def sampleCmp : DXILOpClass;182  def sampleCmpBias : DXILOpClass;183  def sampleCmpGrad : DXILOpClass;184  def sampleCmpLevel : DXILOpClass;185  def sampleCmpLevelZero : DXILOpClass;186  def sampleGrad : DXILOpClass;187  def sampleIndex : DXILOpClass;188  def sampleLevel : DXILOpClass;189  def setMeshOutputCounts : DXILOpClass;190  def splitDouble : DXILOpClass;191  def startInstanceLocation : DXILOpClass;192  def startVertexLocation : DXILOpClass;193  def storeOutput : DXILOpClass;194  def storePatchConstant : DXILOpClass;195  def storePrimitiveOutput : DXILOpClass;196  def storeVertexOutput : DXILOpClass;197  def tempRegLoad : DXILOpClass;198  def tempRegStore : DXILOpClass;199  def tertiary : DXILOpClass;200  def texture2DMSGetSamplePosition : DXILOpClass;201  def textureGather : DXILOpClass;202  def textureGatherCmp : DXILOpClass;203  def textureGatherRaw : DXILOpClass;204  def textureLoad : DXILOpClass;205  def textureStore : DXILOpClass;206  def textureStoreSample : DXILOpClass;207  def threadId : DXILOpClass;208  def threadIdInGroup : DXILOpClass;209  def traceRay : DXILOpClass;210  def unary : DXILOpClass;211  def unaryBits : DXILOpClass;212  def unpack4x8 : DXILOpClass;213  def viewID : DXILOpClass;214  def waveActiveAllEqual : DXILOpClass;215  def waveActiveBallot : DXILOpClass;216  def waveActiveBit : DXILOpClass;217  def waveActiveOp : DXILOpClass;218  def waveAllOp : DXILOpClass;219  def waveAllTrue : DXILOpClass;220  def waveAnyTrue : DXILOpClass;221  def waveGetLaneCount : DXILOpClass;222  def waveGetLaneIndex : DXILOpClass;223  def waveIsFirstLane : DXILOpClass;224  def waveMatch : DXILOpClass;225  def waveMatrix_Accumulate : DXILOpClass;226  def waveMatrix_Annotate : DXILOpClass;227  def waveMatrix_Depth : DXILOpClass;228  def waveMatrix_Fill : DXILOpClass;229  def waveMatrix_LoadGroupShared : DXILOpClass;230  def waveMatrix_LoadRawBuf : DXILOpClass;231  def waveMatrix_Multiply : DXILOpClass;232  def waveMatrix_ScalarOp : DXILOpClass;233  def waveMatrix_StoreGroupShared : DXILOpClass;234  def waveMatrix_StoreRawBuf : DXILOpClass;235  def waveMultiPrefixBitCount : DXILOpClass;236  def waveMultiPrefixOp : DXILOpClass;237  def wavePrefixOp : DXILOpClass;238  def waveReadLaneAt : DXILOpClass;239  def waveReadLaneFirst : DXILOpClass;240  def worldRayDirection : DXILOpClass;241  def worldRayOrigin : DXILOpClass;242  def worldToObject : DXILOpClass;243  def writeSamplerFeedback : DXILOpClass;244  def writeSamplerFeedbackBias : DXILOpClass;245  def writeSamplerFeedbackGrad : DXILOpClass;246  def writeSamplerFeedbackLevel : DXILOpClass;247 248  // This is a sentinel definition. Hence placed at the end here and249  // not as part of the above alphabetically sorted valid definitions.250  // It is never used to construct the name of DXIL Op call name.251  // Additionally it is capitalized unlike all the others.252  def UnknownOpClass : DXILOpClass;253}254 255class DXILShaderStage;256 257def compute : DXILShaderStage;258def domain : DXILShaderStage;259def hull : DXILShaderStage;260def pixel : DXILShaderStage;261def vertex : DXILShaderStage;262def geometry : DXILShaderStage;263def library : DXILShaderStage;264def amplification : DXILShaderStage;265def mesh : DXILShaderStage;266def node : DXILShaderStage;267def raygeneration : DXILShaderStage;268def intersection : DXILShaderStage;269def anyhit : DXILShaderStage;270def closesthit : DXILShaderStage;271def callable : DXILShaderStage;272def miss : DXILShaderStage;273 274// Pseudo-stages275// Denote DXIL Op to be supported in all stages276def all_stages : DXILShaderStage;277// Denote support for DXIL Op to have been removed278def removed : DXILShaderStage;279 280// DXIL Op attributes281 282// A function attribute denotes that there is a corresponding LLVM function283// attribute that will be set when building the DXIL op. The mapping is defined284// by setDXILAttributes in DXILOpBuilder.cpp285class DXILAttribute;286 287def ReadNone : DXILAttribute;288def ReadOnly : DXILAttribute;289def NoDuplicate : DXILAttribute;290def NoReturn : DXILAttribute;291 292class Overloads<Version ver, list<DXILOpParamType> ols> {293  Version dxil_version = ver;294  list<DXILOpParamType> overload_types = ols;295}296 297class Stages<Version ver, list<DXILShaderStage> st> {298  Version dxil_version = ver;299  list<DXILShaderStage> shader_stages = st;300}301 302class Attributes<Version ver = DXIL1_0, list<DXILAttribute> attrs> {303  Version dxil_version = ver;304  list<DXILAttribute> fn_attrs = attrs;305}306 307defvar BarrierMode_DeviceMemoryBarrier = 2;308defvar BarrierMode_DeviceMemoryBarrierWithGroupSync = 3;309defvar BarrierMode_GroupMemoryBarrier = 8;310defvar BarrierMode_GroupMemoryBarrierWithGroupSync = 9;311defvar BarrierMode_AllMemoryBarrier = 10;312defvar BarrierMode_AllMemoryBarrierWithGroupSync = 11;313 314defvar WaveOpKind_Sum = 0;315defvar WaveOpKind_Product = 1;316defvar WaveOpKind_Min = 2;317defvar WaveOpKind_Max = 3;318 319defvar SignedOpKind_Signed = 0;320defvar SignedOpKind_Unsigned = 1;321 322// Intrinsic arg selection323class IntrinArgSelectType;324def IntrinArgSelect_Index : IntrinArgSelectType;325def IntrinArgSelect_I8 : IntrinArgSelectType;326def IntrinArgSelect_I32 : IntrinArgSelectType;327 328class IntrinArgSelect<IntrinArgSelectType type_, int value_> {329  IntrinArgSelectType type = type_;330  int value = value_;331}332 333class IntrinArgIndex<int index> : IntrinArgSelect<IntrinArgSelect_Index, index>;334class IntrinArgI8<int value> : IntrinArgSelect<IntrinArgSelect_I8, value>;335class IntrinArgI32<int value> : IntrinArgSelect<IntrinArgSelect_I32, value>;336 337// Select which intrinsic to lower from for a DXILOp.338// If the intrinsic is the only argument given to IntrinSelect, then the339// arguments of the intrinsic will be copied in the same order. Example:340//   let intrinsics = [341//     IntrinSelect<int_dx_my_intrinsic>,342//     IntrinSelect<int_dx_my_intrinsic2>,343//   ]344//=========================================================================================345// Using IntrinArgIndex<>, arguments of the intrinsic can be copied to the DXIL346// OP in specific order:347//   let intrinsics = [348//     IntrinSelect<int_dx_my_intrinsic,349//       [IntrinArgIndex<2>, IntrinArgIndex<1>, IntrinArgIndex<0>> ]350//     >,351//   ]352//=========================================================================================353// Using IntrinArgI8<> and IntrinArgI32<>, integer constants can be added354// directly to the dxil op. This can be used in conjunction with355// IntrinArgIndex:356//   let intrinsics = [357//     IntrinSelect<int_dx_wave_active_usum,358//       [ IntrinArgIndex<0>, IntrinArgI8<0>, IntrinArgI8<1> ]359//     >,360//     IntrinSelect<int_dx_wave_reduce_sum,361//       [ IntrinArgIndex<0>, IntrinArgI8<0>, IntrinArgI8<0> ]362//     >,363//   ]364//365class IntrinSelect<Intrinsic intrinsic_,366                   list<IntrinArgSelect> arg_selects_ = []> {367  Intrinsic intrinsic = intrinsic_;368  list<IntrinArgSelect> arg_selects = arg_selects_;369}370 371// Abstraction DXIL Operation372class DXILOp<int opcode, DXILOpClass opclass> {373  // A short description of the operation374  string Doc = "";375 376  // Opcode of DXIL Operation377  int OpCode = opcode;378 379  // Class of DXIL Operation.380  DXILOpClass OpClass = opclass;381 382  // LLVM Intrinsics DXIL Operation maps from383  list<IntrinSelect> intrinsics = [];384 385  // Result type of the op386  DXILOpParamType result;387 388  // List of argument types of the op. Default to 0 arguments.389  list<DXILOpParamType> arguments = [];390 391  // List of valid overload types predicated by DXIL version392  list<Overloads> overloads = [];393 394  // List of valid shader stages predicated by DXIL version395  list<Stages> stages;396 397  // Versioned attributes of operation398  list<Attributes> attributes = [];399}400 401// Concrete definitions of DXIL Operations402//403// This are sorted by ascending value of the DXIL Opcodes404 405def Abs : DXILOp<6, unary> {406  let Doc = "Returns the absolute value of the input.";407  let intrinsics = [IntrinSelect<int_fabs>];408  let arguments = [OverloadTy];409  let result = OverloadTy;410  let overloads = [Overloads<DXIL1_0, [HalfTy, FloatTy, DoubleTy]>];411  let stages = [Stages<DXIL1_0, [all_stages]>];412  let attributes = [Attributes<DXIL1_0, [ReadNone]>];413}414 415def Saturate : DXILOp<7, unary> {416  let Doc = "Clamps a single or double precision floating point value to "417            "[0.0f...1.0f].";418  let intrinsics = [IntrinSelect<int_dx_saturate>];419  let arguments = [OverloadTy];420  let result = OverloadTy;421  let overloads = [Overloads<DXIL1_0, [HalfTy, FloatTy, DoubleTy]>];422  let stages = [Stages<DXIL1_0, [all_stages]>];423  let attributes = [Attributes<DXIL1_0, [ReadNone]>];424}425 426def IsNaN : DXILOp<8, isSpecialFloat> {427  let Doc = "Determines if the specified value is NaN.";428  let intrinsics = [IntrinSelect<int_dx_isnan>];429  let arguments = [OverloadTy];430  let result = Int1Ty;431  let overloads = [Overloads<DXIL1_0, [HalfTy, FloatTy]>];432  let stages = [Stages<DXIL1_0, [all_stages]>];433  let attributes = [Attributes<DXIL1_0, [ReadNone]>];434}435 436def IsInf : DXILOp<9, isSpecialFloat> {437  let Doc = "Determines if the specified value is infinite.";438  let intrinsics = [IntrinSelect<int_dx_isinf>];439  let arguments = [OverloadTy];440  let result = Int1Ty;441  let overloads = [Overloads<DXIL1_0, [HalfTy, FloatTy]>];442  let stages = [Stages<DXIL1_0, [all_stages]>];443  let attributes = [Attributes<DXIL1_0, [ReadNone]>];444}445 446def IsFinite : DXILOp<10, isSpecialFloat> {447  let Doc = "Determines if the specified value is finite.";448  let arguments = [OverloadTy];449  let result = Int1Ty;450  let overloads = [Overloads<DXIL1_0, [HalfTy, FloatTy]>];451  let stages = [Stages<DXIL1_0, [all_stages]>];452  let attributes = [Attributes<DXIL1_0, [ReadNone]>];453}454 455def IsNormal : DXILOp<11, isSpecialFloat> {456  let Doc = "Determines if the specified value is normal.";457  let arguments = [OverloadTy];458  let result = Int1Ty;459  let overloads = [Overloads<DXIL1_0, [HalfTy, FloatTy]>];460  let stages = [Stages<DXIL1_0, [all_stages]>];461  let attributes = [Attributes<DXIL1_0, [ReadNone]>];462}463 464def Cos : DXILOp<12, unary> {465  let Doc = "Returns cosine(theta) for theta in radians.";466  let intrinsics = [IntrinSelect<int_cos>];467  let arguments = [OverloadTy];468  let result = OverloadTy;469  let overloads = [Overloads<DXIL1_0, [HalfTy, FloatTy]>];470  let stages = [Stages<DXIL1_0, [all_stages]>];471  let attributes = [Attributes<DXIL1_0, [ReadNone]>];472}473 474def Sin : DXILOp<13, unary> {475  let Doc = "Returns sine(theta) for theta in radians.";476  let intrinsics = [IntrinSelect<int_sin>];477  let arguments = [OverloadTy];478  let result = OverloadTy;479  let overloads = [Overloads<DXIL1_0, [HalfTy, FloatTy]>];480  let stages = [Stages<DXIL1_0, [all_stages]>];481  let attributes = [Attributes<DXIL1_0, [ReadNone]>];482}483 484def Tan : DXILOp<14, unary> {485  let Doc = "Returns tangent(theta) for theta in radians.";486  let intrinsics = [IntrinSelect<int_tan>];487  let arguments = [OverloadTy];488  let result = OverloadTy;489  let overloads = [Overloads<DXIL1_0, [HalfTy, FloatTy]>];490  let stages = [Stages<DXIL1_0, [all_stages]>];491  let attributes = [Attributes<DXIL1_0, [ReadNone]>];492}493 494def ACos : DXILOp<15, unary> {495  let Doc = "Returns the arccosine of the specified value.";496  let intrinsics = [IntrinSelect<int_acos>];497  let arguments = [OverloadTy];498  let result = OverloadTy;499  let overloads = [Overloads<DXIL1_0, [HalfTy, FloatTy]>];500  let stages = [Stages<DXIL1_0, [all_stages]>];501  let attributes = [Attributes<DXIL1_0, [ReadNone]>];502}503 504def ASin : DXILOp<16, unary> {505  let Doc = "Returns the arcsine of the specified value.";506  let intrinsics = [IntrinSelect<int_asin>];507  let arguments = [OverloadTy];508  let result = OverloadTy;509  let overloads = [Overloads<DXIL1_0, [HalfTy, FloatTy]>];510  let stages = [Stages<DXIL1_0, [all_stages]>];511  let attributes = [Attributes<DXIL1_0, [ReadNone]>];512}513 514def ATan : DXILOp<17, unary> {515  let Doc = "Returns the arctangent of the specified value.";516  let intrinsics = [IntrinSelect<int_atan>];517  let arguments = [OverloadTy];518  let result = OverloadTy;519  let overloads = [Overloads<DXIL1_0, [HalfTy, FloatTy]>];520  let stages = [Stages<DXIL1_0, [all_stages]>];521  let attributes = [Attributes<DXIL1_0, [ReadNone]>];522}523 524def HCos : DXILOp<18, unary> {525  let Doc = "Returns the hyperbolic cosine of the specified value.";526  let intrinsics = [IntrinSelect<int_cosh>];527  let arguments = [OverloadTy];528  let result = OverloadTy;529  let overloads = [Overloads<DXIL1_0, [HalfTy, FloatTy]>];530  let stages = [Stages<DXIL1_0, [all_stages]>];531  let attributes = [Attributes<DXIL1_0, [ReadNone]>];532}533 534def HSin : DXILOp<19, unary> {535  let Doc = "Returns the hyperbolic sine of the specified value.";536  let intrinsics = [IntrinSelect<int_sinh>];537  let arguments = [OverloadTy];538  let result = OverloadTy;539  let overloads = [Overloads<DXIL1_0, [HalfTy, FloatTy]>];540  let stages = [Stages<DXIL1_0, [all_stages]>];541  let attributes = [Attributes<DXIL1_0, [ReadNone]>];542}543 544def HTan : DXILOp<20, unary> {545  let Doc = "Returns the hyperbolic tan of the specified value.";546  let intrinsics = [IntrinSelect<int_tanh>];547  let arguments = [OverloadTy];548  let result = OverloadTy;549  let overloads = [Overloads<DXIL1_0, [HalfTy, FloatTy]>];550  let stages = [Stages<DXIL1_0, [all_stages]>];551  let attributes = [Attributes<DXIL1_0, [ReadNone]>];552}553 554def Exp2 : DXILOp<21, unary> {555  let Doc = "Returns the base 2 exponential, or 2**x, of the specified value. "556            "exp2(x) = 2**x.";557  let intrinsics = [IntrinSelect<int_exp2>];558  let arguments = [OverloadTy];559  let result = OverloadTy;560  let overloads = [Overloads<DXIL1_0, [HalfTy, FloatTy]>];561  let stages = [Stages<DXIL1_0, [all_stages]>];562  let attributes = [Attributes<DXIL1_0, [ReadNone]>];563}564 565def Frac : DXILOp<22, unary> {566  let Doc = "Returns a fraction from 0 to 1 that represents the decimal part "567            "of the input.";568  let intrinsics = [IntrinSelect<int_dx_frac>];569  let arguments = [OverloadTy];570  let result = OverloadTy;571  let overloads = [Overloads<DXIL1_0, [HalfTy, FloatTy]>];572  let stages = [Stages<DXIL1_0, [all_stages]>];573  let attributes = [Attributes<DXIL1_0, [ReadNone]>];574}575 576def Log2 : DXILOp<23, unary> {577  let Doc = "Returns the base-2 logarithm of the specified value.";578  let intrinsics = [IntrinSelect<int_log2>];579  let arguments = [OverloadTy];580  let result = OverloadTy;581  let overloads = [Overloads<DXIL1_0, [HalfTy, FloatTy]>];582  let stages = [Stages<DXIL1_0, [all_stages]>];583  let attributes = [Attributes<DXIL1_0, [ReadNone]>];584}585 586def Sqrt : DXILOp<24, unary> {587  let Doc = "Returns the square root of the specified floating-point value, "588            "per component.";589  let intrinsics = [IntrinSelect<int_sqrt>];590  let arguments = [OverloadTy];591  let result = OverloadTy;592  let overloads = [Overloads<DXIL1_0, [HalfTy, FloatTy]>];593  let stages = [Stages<DXIL1_0, [all_stages]>];594  let attributes = [Attributes<DXIL1_0, [ReadNone]>];595}596 597def RSqrt : DXILOp<25, unary> {598  let Doc = "Returns the reciprocal of the square root of the specified value. "599            "rsqrt(x) = 1 / sqrt(x).";600  let intrinsics = [IntrinSelect<int_dx_rsqrt>];601  let arguments = [OverloadTy];602  let result = OverloadTy;603  let overloads = [Overloads<DXIL1_0, [HalfTy, FloatTy]>];604  let stages = [Stages<DXIL1_0, [all_stages]>];605  let attributes = [Attributes<DXIL1_0, [ReadNone]>];606}607 608def Round : DXILOp<26, unary> {609  let Doc = "Returns the input rounded to the nearest integer within a "610            "floating-point type.";611  let intrinsics = [IntrinSelect<int_roundeven>];612  let arguments = [OverloadTy];613  let result = OverloadTy;614  let overloads = [Overloads<DXIL1_0, [HalfTy, FloatTy]>];615  let stages = [Stages<DXIL1_0, [all_stages]>];616  let attributes = [Attributes<DXIL1_0, [ReadNone]>];617}618 619def Floor : DXILOp<27, unary> {620  let Doc =621      "Returns the largest integer that is less than or equal to the input.";622  let intrinsics = [IntrinSelect<int_floor>];623  let arguments = [OverloadTy];624  let result = OverloadTy;625  let overloads = [Overloads<DXIL1_0, [HalfTy, FloatTy]>];626  let stages = [Stages<DXIL1_0, [all_stages]>];627  let attributes = [Attributes<DXIL1_0, [ReadNone]>];628}629 630def Ceil : DXILOp<28, unary> {631  let Doc = "Returns the smallest integer that is greater than or equal to the "632            "input.";633  let intrinsics = [IntrinSelect<int_ceil>];634  let arguments = [OverloadTy];635  let result = OverloadTy;636  let overloads = [Overloads<DXIL1_0, [HalfTy, FloatTy]>];637  let stages = [Stages<DXIL1_0, [all_stages]>];638  let attributes = [Attributes<DXIL1_0, [ReadNone]>];639}640 641def Trunc : DXILOp<29, unary> {642  let Doc = "Returns the specified value truncated to the integer component.";643  let intrinsics = [IntrinSelect<int_trunc>];644  let arguments = [OverloadTy];645  let result = OverloadTy;646  let overloads = [Overloads<DXIL1_0, [HalfTy, FloatTy]>];647  let stages = [Stages<DXIL1_0, [all_stages]>];648  let attributes = [Attributes<DXIL1_0, [ReadNone]>];649}650 651def Rbits : DXILOp<30, unary> {652  let Doc = "Returns the specified value with its bits reversed.";653  let intrinsics = [IntrinSelect<int_bitreverse>];654  let arguments = [OverloadTy];655  let result = OverloadTy;656  let overloads = [Overloads<DXIL1_0, [Int16Ty, Int32Ty, Int64Ty]>];657  let stages = [Stages<DXIL1_0, [all_stages]>];658  let attributes = [Attributes<DXIL1_0, [ReadNone]>];659}660 661def CountBits : DXILOp<31, unaryBits> {662  let Doc = "Returns the number of 1 bits in the specified value.";663  let arguments = [OverloadTy];664  let result = Int32Ty;665  let overloads = [Overloads<DXIL1_0, [Int16Ty, Int32Ty, Int64Ty]>];666  let stages = [Stages<DXIL1_0, [all_stages]>];667  let attributes = [Attributes<DXIL1_0, [ReadNone]>];668}669 670def FirstbitLo : DXILOp<32, unaryBits> {671  let Doc = "Returns the location of the first set bit starting from "672            "the lowest order bit and working upward.";673  let intrinsics = [IntrinSelect<int_dx_firstbitlow>];674  let arguments = [OverloadTy];675  let result = Int32Ty;676  let overloads = [Overloads<DXIL1_0, [Int16Ty, Int32Ty, Int64Ty]>];677  let stages = [Stages<DXIL1_0, [all_stages]>];678  let attributes = [Attributes<DXIL1_0, [ReadNone]>];679}680 681def FirstbitHi : DXILOp<33, unaryBits> {682  let Doc = "Returns the location of the first set bit starting from "683            "the highest order bit and working downward.";684  let intrinsics = [IntrinSelect<int_dx_firstbituhigh>];685  let arguments = [OverloadTy];686  let result = Int32Ty;687  let overloads = [Overloads<DXIL1_0, [Int16Ty, Int32Ty, Int64Ty]>];688  let stages = [Stages<DXIL1_0, [all_stages]>];689  let attributes = [Attributes<DXIL1_0, [ReadNone]>];690}691 692def FirstbitSHi : DXILOp<34, unaryBits> {693  let Doc = "Returns the location of the first set bit from "694            "the highest order bit based on the sign.";695  let intrinsics = [IntrinSelect<int_dx_firstbitshigh>];696  let arguments = [OverloadTy];697  let result = Int32Ty;698  let overloads = [Overloads<DXIL1_0, [Int16Ty, Int32Ty, Int64Ty]>];699  let stages = [Stages<DXIL1_0, [all_stages]>];700  let attributes = [Attributes<DXIL1_0, [ReadNone]>];701}702 703def FMax : DXILOp<35, binary> {704  let Doc = "Float maximum. FMax(a,b) = a > b ? a : b";705  let intrinsics = [IntrinSelect<int_maxnum>];706  let arguments = [OverloadTy, OverloadTy];707  let result = OverloadTy;708  let overloads = [Overloads<DXIL1_0, [HalfTy, FloatTy, DoubleTy]>];709  let stages = [Stages<DXIL1_0, [all_stages]>];710  let attributes = [Attributes<DXIL1_0, [ReadNone]>];711}712 713def FMin : DXILOp<36, binary> {714  let Doc = "Float minimum. FMin(a,b) = a < b ? a : b";715  let intrinsics = [IntrinSelect<int_minnum>];716  let arguments = [OverloadTy, OverloadTy];717  let result = OverloadTy;718  let overloads = [Overloads<DXIL1_0, [HalfTy, FloatTy, DoubleTy]>];719  let stages = [Stages<DXIL1_0, [all_stages]>];720  let attributes = [Attributes<DXIL1_0, [ReadNone]>];721}722 723def SMax : DXILOp<37, binary> {724  let Doc = "Signed integer maximum. SMax(a,b) = a > b ? a : b";725  let intrinsics = [IntrinSelect<int_smax>];726  let arguments = [OverloadTy, OverloadTy];727  let result = OverloadTy;728  let overloads = [Overloads<DXIL1_0, [Int16Ty, Int32Ty, Int64Ty]>];729  let stages = [Stages<DXIL1_0, [all_stages]>];730  let attributes = [Attributes<DXIL1_0, [ReadNone]>];731}732 733def SMin : DXILOp<38, binary> {734  let Doc = "Signed integer minimum. SMin(a,b) = a < b ? a : b";735  let intrinsics = [IntrinSelect<int_smin>];736  let arguments = [OverloadTy, OverloadTy];737  let result = OverloadTy;738  let overloads = [Overloads<DXIL1_0, [Int16Ty, Int32Ty, Int64Ty]>];739  let stages = [Stages<DXIL1_0, [all_stages]>];740  let attributes = [Attributes<DXIL1_0, [ReadNone]>];741}742 743def UMax : DXILOp<39, binary> {744  let Doc = "Unsigned integer maximum. UMax(a,b) = a > b ? a : b";745  let intrinsics = [IntrinSelect<int_umax>];746  let arguments = [OverloadTy, OverloadTy];747  let result = OverloadTy;748  let overloads = [Overloads<DXIL1_0, [Int16Ty, Int32Ty, Int64Ty]>];749  let stages = [Stages<DXIL1_0, [all_stages]>];750  let attributes = [Attributes<DXIL1_0, [ReadNone]>];751}752 753def UMin : DXILOp<40, binary> {754  let Doc = "Unsigned integer minimum. UMin(a,b) = a < b ? a : b";755  let intrinsics = [IntrinSelect<int_umin>];756  let arguments = [OverloadTy, OverloadTy];757  let result = OverloadTy;758  let overloads = [Overloads<DXIL1_0, [Int16Ty, Int32Ty, Int64Ty]>];759  let stages = [Stages<DXIL1_0, [all_stages]>];760  let attributes = [Attributes<DXIL1_0, [ReadNone]>];761}762 763def UAddc : DXILOp<44, binaryWithCarryOrBorrow > {764  let Doc = "unsigned add of 32-bit operand with the carry";765  let intrinsics = [IntrinSelect<int_uadd_with_overflow>];766  let arguments = [OverloadTy, OverloadTy];767  let result = BinaryWithCarryTy;768  let overloads = [Overloads<DXIL1_0, [Int32Ty]>];769  let stages = [Stages<DXIL1_0, [all_stages]>];770  let attributes = [Attributes<DXIL1_0, [ReadNone]>];771}772 773def FMad : DXILOp<46, tertiary> {774  let Doc = "Floating point arithmetic multiply/add operation. fmad(m,a,b) = m "775            "* a + b.";776  let intrinsics = [IntrinSelect<int_fmuladd>];777  let arguments = [OverloadTy, OverloadTy, OverloadTy];778  let result = OverloadTy;779  let overloads = [Overloads<DXIL1_0, [HalfTy, FloatTy, DoubleTy]>];780  let stages = [Stages<DXIL1_0, [all_stages]>];781  let attributes = [Attributes<DXIL1_0, [ReadNone]>];782}783 784def IMad : DXILOp<48, tertiary> {785  let Doc = "Signed integer arithmetic multiply/add operation. imad(m,a,b) = m "786            "* a + b.";787  let intrinsics = [IntrinSelect<int_dx_imad>];788  let arguments = [OverloadTy, OverloadTy, OverloadTy];789  let result = OverloadTy;790  let overloads = [Overloads<DXIL1_0, [Int16Ty, Int32Ty, Int64Ty]>];791  let stages = [Stages<DXIL1_0, [all_stages]>];792  let attributes = [Attributes<DXIL1_0, [ReadNone]>];793}794 795def UMad : DXILOp<49, tertiary> {796  let Doc = "Unsigned integer arithmetic multiply/add operation. umad(m,a, = m "797            "* a + b.";798  let intrinsics = [IntrinSelect<int_dx_umad>];799  let arguments = [OverloadTy, OverloadTy, OverloadTy];800  let result = OverloadTy;801  let overloads = [Overloads<DXIL1_0, [Int16Ty, Int32Ty, Int64Ty]>];802  let stages = [Stages<DXIL1_0, [all_stages]>];803  let attributes = [Attributes<DXIL1_0, [ReadNone]>];804}805 806def Dot2 : DXILOp<54, dot2> {807  let Doc = "dot product of two float vectors Dot(a,b) = a[0]*b[0] + ... + "808            "a[n]*b[n] where n is 0 to 1 inclusive";809  let intrinsics = [IntrinSelect<int_dx_dot2>];810  let arguments = !listsplat(OverloadTy, 4);811  let result = OverloadTy;812  let overloads = [Overloads<DXIL1_0, [HalfTy, FloatTy]>];813  let stages = [Stages<DXIL1_0, [all_stages]>];814  let attributes = [Attributes<DXIL1_0, [ReadNone]>];815}816 817def Dot3 : DXILOp<55, dot3> {818  let Doc = "dot product of two float vectors Dot(a,b) = a[0]*b[0] + ... + "819            "a[n]*b[n] where n is 0 to 2 inclusive";820  let intrinsics = [IntrinSelect<int_dx_dot3>];821  let arguments = !listsplat(OverloadTy, 6);822  let result = OverloadTy;823  let overloads = [Overloads<DXIL1_0, [HalfTy, FloatTy]>];824  let stages = [Stages<DXIL1_0, [all_stages]>];825  let attributes = [Attributes<DXIL1_0, [ReadNone]>];826}827 828def Dot4 : DXILOp<56, dot4> {829  let Doc = "dot product of two float vectors Dot(a,b) = a[0]*b[0] + ... + "830            "a[n]*b[n] where n is 0 to 3 inclusive";831  let intrinsics = [IntrinSelect<int_dx_dot4>];832  let arguments = !listsplat(OverloadTy, 8);833  let result = OverloadTy;834  let overloads = [Overloads<DXIL1_0, [HalfTy, FloatTy]>];835  let stages = [Stages<DXIL1_0, [all_stages]>];836  let attributes = [Attributes<DXIL1_0, [ReadNone]>];837}838 839def CreateHandle : DXILOp<57, createHandle> {840  let Doc = "creates the handle to a resource";841  // ResourceClass, RangeID, Index, NonUniform842  let arguments = [Int8Ty, Int32Ty, Int32Ty, Int1Ty];843  let result = HandleTy;844  let stages = [Stages<DXIL1_0, [all_stages]>, Stages<DXIL1_6, [removed]>];845  // NOTE: The ReadOnly attribute was set for consistency with DXC. However, it846  // seems like ReadNone may more appropiately describe it. So noted to847  // consider a change in the future848  let attributes = [Attributes<DXIL1_0, [ReadOnly]>];849}850 851def CBufferLoadLegacy : DXILOp<59, cbufferLoadLegacy> {852  let Doc = "loads a value from a constant buffer resource";853  // Handle, Index854  let arguments = [HandleTy, Int32Ty];855  let result = OverloadTy;856  let overloads = [Overloads<DXIL1_0, [857    CBufRetHalfTy, CBufRetFloatTy, CBufRetDoubleTy, CBufRetInt16Ty,858    CBufRetInt32Ty, CBufRetInt64Ty859  ]>];860  let stages = [Stages<DXIL1_0, [all_stages]>];861  let attributes = [Attributes<DXIL1_0, [ReadOnly]>];862}863 864def BufferLoad : DXILOp<68, bufferLoad> {865  let Doc = "reads from a TypedBuffer";866  // Handle, Coord0, Coord1867  let arguments = [HandleTy, Int32Ty, Int32Ty];868  let result = OverloadTy;869  let overloads =870      [Overloads<DXIL1_0,871                 [ResRetHalfTy, ResRetFloatTy, ResRetInt16Ty, ResRetInt32Ty]>];872  let stages = [Stages<DXIL1_0, [all_stages]>];873  let attributes = [Attributes<DXIL1_0, [ReadOnly]>];874}875 876def BufferStore : DXILOp<69, bufferStore> {877  let Doc = "writes to an RWTypedBuffer";878  // Handle, Coord0, Coord1, Val0, Val1, Val2, Val3, Mask879  let arguments = [880    HandleTy, Int32Ty, Int32Ty, OverloadTy, OverloadTy, OverloadTy, OverloadTy,881    Int8Ty882  ];883  let result = VoidTy;884  let overloads = [Overloads<DXIL1_0, [HalfTy, FloatTy, Int16Ty, Int32Ty]>];885  let stages = [Stages<DXIL1_0, [all_stages]>];886}887 888def UpdateCounter : DXILOp<70, bufferUpdateCounter> {889  let Doc = "increments/decrements a buffer counter";890  let arguments = [HandleTy, Int8Ty];891  let result = Int32Ty;892  let stages = [Stages<DXIL1_0, [all_stages]>];893}894 895def CheckAccessFullyMapped : DXILOp<71, checkAccessFullyMapped> {896  let Doc = "checks whether a Sample, Gather, or Load operation "897            "accessed mapped tiles in a tiled resource";898  let arguments = [OverloadTy];899  let result = Int1Ty;900  let overloads = [Overloads<DXIL1_0, [Int32Ty]>];901  let stages = [Stages<DXIL1_0, [all_stages]>];902  let attributes = [Attributes<DXIL1_0, [ReadOnly]>];903}904 905def GetDimensions : DXILOp<72, getDimensions> {906  let Doc = "gets the dimensions of a buffer or texture";907  let arguments = [HandleTy, Int32Ty];908  let result = DimensionsTy;909  let stages = [Stages<DXIL1_0, [all_stages]>];910}911 912def Barrier : DXILOp<80, barrier> {913  let Doc = "inserts a memory barrier in the shader";914  let intrinsics = [915    IntrinSelect<int_dx_group_memory_barrier_with_group_sync,916                 [IntrinArgI32<BarrierMode_GroupMemoryBarrierWithGroupSync>]>,917  ];918 919  let arguments = [Int32Ty];920  let result = VoidTy;921  let stages = [Stages<DXIL1_0, [compute, library]>];922  let attributes = [Attributes<DXIL1_0, []>];923}924 925def Discard : DXILOp<82, discard> {926  let Doc = "discard the current pixel";927  let intrinsics = [IntrinSelect<int_dx_discard>];928  let arguments = [Int1Ty];929  let result = VoidTy;930  let stages = [Stages<DXIL1_0, [pixel]>];931}932 933def DerivCoarseX : DXILOp<83, unary> {934  let Doc = "computes the rate of change per stamp in x direction";935  let intrinsics = [IntrinSelect<int_dx_ddx_coarse>];936  let arguments = [OverloadTy];937  let result = OverloadTy;938  let overloads = [Overloads<DXIL1_0, [HalfTy, FloatTy]>];939  let stages = [Stages<DXIL1_0, [library, pixel]>];940}941 942def DerivCoarseY : DXILOp<84, unary> {943  let Doc = "computes the rate of change per stamp in y direction";944  let intrinsics = [IntrinSelect<int_dx_ddy_coarse>];945  let arguments = [OverloadTy];946  let result = OverloadTy;947  let overloads = [Overloads<DXIL1_0, [HalfTy, FloatTy]>];948  let stages = [Stages<DXIL1_0, [library, pixel]>];949}950 951def ThreadId : DXILOp<93, threadId> {952  let Doc = "Reads the thread ID";953  let intrinsics = [IntrinSelect<int_dx_thread_id>];954  let arguments = [OverloadTy];955  let result = OverloadTy;956  let overloads = [Overloads<DXIL1_0, [Int32Ty]>];957  let stages = [Stages<DXIL1_0, [compute, mesh, amplification, node]>];958  let attributes = [Attributes<DXIL1_0, [ReadNone]>];959}960 961def GroupId : DXILOp<94, groupId> {962  let Doc = "Reads the group ID (SV_GroupID)";963  let intrinsics = [IntrinSelect<int_dx_group_id>];964  let arguments = [OverloadTy];965  let result = OverloadTy;966  let overloads = [Overloads<DXIL1_0, [Int32Ty]>];967  let stages = [Stages<DXIL1_0, [compute, mesh, amplification, node]>];968  let attributes = [Attributes<DXIL1_0, [ReadNone]>];969}970 971def ThreadIdInGroup : DXILOp<95, threadIdInGroup> {972  let Doc = "Reads the thread ID within the group  (SV_GroupThreadID)";973  let intrinsics = [IntrinSelect<int_dx_thread_id_in_group>];974  let arguments = [OverloadTy];975  let result = OverloadTy;976  let overloads = [Overloads<DXIL1_0, [Int32Ty]>];977  let stages = [Stages<DXIL1_0, [compute, mesh, amplification, node]>];978  let attributes = [Attributes<DXIL1_0, [ReadNone]>];979}980 981def FlattenedThreadIdInGroup : DXILOp<96, flattenedThreadIdInGroup> {982  let Doc = "Provides a flattened index for a given thread within a given "983            "group (SV_GroupIndex)";984  let intrinsics = [IntrinSelect<int_dx_flattened_thread_id_in_group>];985  let result = OverloadTy;986  let overloads = [Overloads<DXIL1_0, [Int32Ty]>];987  let stages = [Stages<DXIL1_0, [compute, mesh, amplification, node]>];988  let attributes = [Attributes<DXIL1_0, [ReadNone]>];989}990 991def MakeDouble : DXILOp<101, makeDouble> {992  let Doc = "creates a double value";993  let intrinsics = [IntrinSelect<int_dx_asdouble>];994  let arguments = [Int32Ty, Int32Ty];995  let result = OverloadTy;996  let overloads = [Overloads<DXIL1_0, [DoubleTy]>];997  let stages = [Stages<DXIL1_0, [all_stages]>];998  let attributes = [Attributes<DXIL1_0, [ReadNone]>];999}1000 1001def SplitDouble : DXILOp<102, splitDouble> {1002  let Doc = "Splits a double into 2 uints";1003  let intrinsics = [IntrinSelect<int_dx_splitdouble>];1004  let arguments = [OverloadTy];1005  let result = SplitDoubleTy;1006  let overloads = [Overloads<DXIL1_0, [DoubleTy]>];1007  let stages = [Stages<DXIL1_0, [all_stages]>];1008  let attributes = [Attributes<DXIL1_0, [ReadNone]>];1009}1010 1011def WaveIsFirstLane : DXILOp<110, waveIsFirstLane> {1012  let Doc = "returns 1 for the first lane in the wave";1013  let intrinsics = [IntrinSelect<int_dx_wave_is_first_lane>];1014  let arguments = [];1015  let result = Int1Ty;1016  let stages = [Stages<DXIL1_0, [all_stages]>];1017}1018 1019def WaveGetLaneIndex : DXILOp<111, waveGetLaneIndex> {1020  let Doc = "returns the index of the current lane in the wave";1021  let intrinsics = [IntrinSelect<int_dx_wave_getlaneindex>];1022  let arguments = [];1023  let result = Int32Ty;1024  let stages = [Stages<DXIL1_0, [all_stages]>];1025  let attributes = [Attributes<DXIL1_0, [ReadOnly]>];1026}1027 1028def WaveActiveAnyTrue : DXILOp<113, waveAnyTrue> {1029  let Doc = "returns true if the expression is true in any of the active lanes "1030            "in the current wave";1031  let intrinsics = [IntrinSelect<int_dx_wave_any>];1032  let arguments = [Int1Ty];1033  let result = Int1Ty;1034  let stages = [Stages<DXIL1_0, [all_stages]>];1035}1036 1037def WaveActiveAllTrue : DXILOp<114, waveAllTrue> {1038  let Doc = "returns true if the expression is true in all of the active lanes "1039            "in the current wave";1040  let intrinsics = [IntrinSelect<int_dx_wave_all>];1041  let arguments = [Int1Ty];1042  let result = Int1Ty;1043  let stages = [Stages<DXIL1_0, [all_stages]>];1044}1045 1046def WaveReadLaneAt : DXILOp<117, waveReadLaneAt> {1047  let Doc = "returns the value from the specified lane";1048  let intrinsics = [IntrinSelect<int_dx_wave_readlane>];1049  let arguments = [OverloadTy, Int32Ty];1050  let result = OverloadTy;1051  let overloads = [Overloads<1052      DXIL1_0, [HalfTy, FloatTy, DoubleTy, Int1Ty, Int16Ty, Int32Ty, Int64Ty]>];1053  let stages = [Stages<DXIL1_0, [all_stages]>];1054}1055 1056def WaveActiveOp : DXILOp<119, waveActiveOp> {1057  let Doc = "returns the result of the operation across waves";1058  let intrinsics = [1059    IntrinSelect<int_dx_wave_reduce_sum,1060                 [1061                   IntrinArgIndex<0>, IntrinArgI8<WaveOpKind_Sum>,1062                   IntrinArgI8<SignedOpKind_Signed>1063                 ]>,1064    IntrinSelect<int_dx_wave_reduce_usum,1065                 [1066                   IntrinArgIndex<0>, IntrinArgI8<WaveOpKind_Sum>,1067                   IntrinArgI8<SignedOpKind_Unsigned>1068                 ]>,1069    IntrinSelect<int_dx_wave_reduce_max,1070                 [1071                   IntrinArgIndex<0>, IntrinArgI8<WaveOpKind_Max>,1072                   IntrinArgI8<SignedOpKind_Signed>1073                 ]>,1074    IntrinSelect<int_dx_wave_reduce_umax,1075                 [1076                   IntrinArgIndex<0>, IntrinArgI8<WaveOpKind_Max>,1077                   IntrinArgI8<SignedOpKind_Unsigned>1078                 ]>,1079    IntrinSelect<int_dx_wave_reduce_min,1080                 [1081                   IntrinArgIndex<0>, IntrinArgI8<WaveOpKind_Min>,1082                   IntrinArgI8<SignedOpKind_Signed>1083                 ]>,1084    IntrinSelect<int_dx_wave_reduce_umin,1085                 [1086                   IntrinArgIndex<0>, IntrinArgI8<WaveOpKind_Min>,1087                   IntrinArgI8<SignedOpKind_Unsigned>1088                 ]>,1089  ];1090 1091  let arguments = [OverloadTy, Int8Ty, Int8Ty];1092  let result = OverloadTy;1093  let overloads = [1094    Overloads<DXIL1_0, [HalfTy, FloatTy, DoubleTy, Int16Ty, Int32Ty, Int64Ty]>1095  ];1096  let stages = [Stages<DXIL1_0, [all_stages]>];1097  let attributes = [Attributes<DXIL1_0, []>];1098}1099 1100def LegacyF16ToF32 : DXILOp<131, legacyF16ToF32> {1101  let Doc = "returns the float16 stored in the low-half of the uint converted "1102            "to a float";1103  let intrinsics = [IntrinSelect<int_dx_legacyf16tof32>];1104  let arguments = [Int32Ty];1105  let result = FloatTy;1106  let stages = [Stages<DXIL1_0, [all_stages]>];1107}1108 1109def WaveAllBitCount : DXILOp<135, waveAllOp> {1110  let Doc = "returns the count of bits set to 1 across the wave";1111  let intrinsics = [IntrinSelect<int_dx_wave_active_countbits>];1112  let arguments = [Int1Ty];1113  let result = Int32Ty;1114  let stages = [Stages<DXIL1_0, [all_stages]>];1115}1116 1117def RawBufferLoad : DXILOp<139, rawBufferLoad> {1118  let Doc = "reads from a raw buffer and structured buffer";1119  // Handle, Coord0, Coord1, Mask, Alignment1120  let arguments = [HandleTy, Int32Ty, Int32Ty, Int8Ty, Int32Ty];1121  let result = OverloadTy;1122  let overloads = [1123    Overloads<DXIL1_2,1124              [ResRetHalfTy, ResRetFloatTy, ResRetInt16Ty, ResRetInt32Ty]>,1125    Overloads<DXIL1_3,1126              [1127                ResRetHalfTy, ResRetFloatTy, ResRetDoubleTy, ResRetInt16Ty,1128                ResRetInt32Ty, ResRetInt64Ty1129              ]>1130  ];1131  let stages = [Stages<DXIL1_2, [all_stages]>];1132}1133 1134def RawBufferStore : DXILOp<140, rawBufferStore> {1135  let Doc = "writes to a RWByteAddressBuffer or RWStructuredBuffer";1136  // Handle, Coord0, Coord1, Val0, Val1, Val2, Val3, Mask, Alignment1137  let arguments = [1138    HandleTy, Int32Ty, Int32Ty, OverloadTy, OverloadTy, OverloadTy, OverloadTy,1139    Int8Ty, Int32Ty1140  ];1141  let result = VoidTy;1142  let overloads = [1143    Overloads<DXIL1_2,1144              [ResRetHalfTy, ResRetFloatTy, ResRetInt16Ty, ResRetInt32Ty]>,1145    Overloads<DXIL1_3,1146              [1147                ResRetHalfTy, ResRetFloatTy, ResRetDoubleTy, ResRetInt16Ty,1148                ResRetInt32Ty, ResRetInt64Ty1149              ]>1150  ];1151  let stages = [Stages<DXIL1_2, [all_stages]>];1152}1153 1154def Dot2AddHalf : DXILOp<162, dot2AddHalf> {1155  let Doc = "2D half dot product with accumulate to float";1156  let intrinsics = [IntrinSelect<int_dx_dot2add>];1157  let arguments = [OverloadTy, HalfTy, HalfTy, HalfTy, HalfTy];1158  let result = OverloadTy;1159  let overloads = [Overloads<DXIL1_4, [FloatTy]>];1160  let stages = [Stages<DXIL1_4, [all_stages]>];1161  let attributes = [Attributes<DXIL1_4, [ReadNone]>];1162}1163 1164def Dot4AddI8Packed : DXILOp<163, dot4AddPacked> {1165  let Doc = "signed dot product of 4 x i8 vectors packed into i32, with "1166            "accumulate to i32";1167  let intrinsics = [IntrinSelect<int_dx_dot4add_i8packed>];1168  let arguments = [Int32Ty, Int32Ty, Int32Ty];1169  let result = OverloadTy;1170  let overloads = [Overloads<DXIL1_4, [Int32Ty]>];1171  let stages = [Stages<DXIL1_4, [all_stages]>];1172  let attributes = [Attributes<DXIL1_4, [ReadNone]>];1173}1174 1175def Dot4AddU8Packed : DXILOp<164, dot4AddPacked> {1176  let Doc = "unsigned dot product of 4 x i8 vectors packed into i32, with "1177            "accumulate to i32";1178  let intrinsics = [IntrinSelect<int_dx_dot4add_u8packed>];1179  let arguments = [Int32Ty, Int32Ty, Int32Ty];1180  let result = OverloadTy;1181  let overloads = [Overloads<DXIL1_4, [Int32Ty]>];1182  let stages = [Stages<DXIL1_4, [all_stages]>];1183  let attributes = [Attributes<DXIL1_4, [ReadNone]>];1184}1185 1186def AnnotateHandle : DXILOp<216, annotateHandle> {1187  let Doc = "annotate handle with resource properties";1188  let arguments = [HandleTy, ResPropsTy];1189  let result = HandleTy;1190  let stages = [Stages<DXIL1_6, [all_stages]>];1191  let attributes = [Attributes<DXIL1_0, [ReadNone]>];1192}1193 1194def CreateHandleFromBinding : DXILOp<217, createHandleFromBinding> {1195  let Doc = "create resource handle from binding";1196  let arguments = [ResBindTy, Int32Ty, Int1Ty];1197  let result = HandleTy;1198  let stages = [Stages<DXIL1_6, [all_stages]>];1199  let attributes = [Attributes<DXIL1_0, [ReadNone]>];1200}1201