Skip to content

Commit e6b4e88

Browse files
authored
[SM6.10][specs/783] Update LinAlg DXIL Op Class Names (#8169)
microsoft/hlsl-specs#783 changed the names of the linalg DXIL ops, update the implementation to reflect that. The only interesting changes are in `utils/hct/hctdb.py` and `lib/HLSL/HLOperationLower.cpp` everything else is generated code
1 parent 250409a commit e6b4e88

File tree

6 files changed

+378
-355
lines changed

6 files changed

+378
-355
lines changed

docs/DXIL.rst

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3077,24 +3077,24 @@ ID Name Description
30773077
2147483657 RayQuery_CommittedTriangleObjectPosition returns committed triangle vertices in object space as <9 x float>
30783078
2147483658 HitObject_TriangleObjectPosition returns triangle vertices in object space as <9 x float>
30793079
2147483659 ReservedD0 reserved
3080-
2147483660 FillMatrix fills a matrix with a scalar value
3081-
2147483661 CopyConvertMatrix Converts and copies the element and use type of the source matrix to the destination matrix with optional transpose
3082-
2147483662 MatrixLoadFromDescriptor fills a matrix with data from a [RW]ByteAddressBuffer
3083-
2147483663 MatrixLoadFromMemory fills a matrix with data from a groupshared array
3084-
2147483664 MatrixLength returns the number of elements stored in thread-local storage on the active thread for the provided matrix
3085-
2147483665 MatrixGetCoordinate returns a two element vector containing the column and row of the matrix that the thread-local index corresponds to
3086-
2147483666 MatrixGetElement returns the element of the matrix corresponding to the provided thread-local index
3087-
2147483667 MatrixSetElement sets the element of the matrix corresponding to the provided thread-local index
3088-
2147483668 MatrixStoreToDescriptor stores a matrix to a RWByteAddressBuffer
3089-
2147483669 MatrixStoreToMemory stores a matrix to groupshared memory
3090-
2147483670 MatrixQueryAccumulatorLayout returns comptime 0 when accumulator matrix are A layout, 1 when B layout
3091-
2147483671 MatrixMulOp applies a multiplication op to matrix C using A and B as parameters
3092-
2147483672 MatrixAccumulate accumulate A or B matrix into Accumulator matrix following LHS += RHS
3093-
2147483673 MatrixVecMul Multiplies a MxK dimension matrix and a K sized input vector
3094-
2147483674 MatrixVecMulAdd Multiplies a MxK dimension matrix and a K sized input vector then adds a M sized bias vector
3095-
2147483675 MatrixAccumulateToDescriptor accumulates a matrix to a RWByteAddressBuffer
3096-
2147483676 MatrixAccumulateToMemory accumulates a matrix to groupshared memory
3097-
2147483677 MatrixOuterProduct Outer products an M sized vector and a N sized vector producing an MxN matrix
3080+
2147483660 LinAlgFillMatrix fills a matrix with a scalar value
3081+
2147483661 LinAlgCopyConvertMatrix Converts and copies the element and use type of the source matrix to the destination matrix with optional transpose
3082+
2147483662 LinAlgMatrixLoadFromDescriptor fills a matrix with data from a [RW]ByteAddressBuffer
3083+
2147483663 LinAlgMatrixLoadFromMemory fills a matrix with data from a groupshared array
3084+
2147483664 LinAlgMatrixLength returns the number of elements stored in thread-local storage on the active thread for the provided matrix
3085+
2147483665 LinAlgMatrixGetCoordinate returns a two element vector containing the column and row of the matrix that the thread-local index corresponds to
3086+
2147483666 LinAlgMatrixGetElement returns the element of the matrix corresponding to the provided thread-local index
3087+
2147483667 LinAlgMatrixSetElement sets the element of the matrix corresponding to the provided thread-local index
3088+
2147483668 LinAlgMatrixStoreToDescriptor stores a matrix to a RWByteAddressBuffer
3089+
2147483669 LinAlgMatrixStoreToMemory stores a matrix to groupshared memory
3090+
2147483670 LinAlgMatrixQueryAccumulatorLayout returns comptime 0 when accumulator matrix are A layout, 1 when B layout
3091+
2147483671 LinAlgMatrixMulOp applies a multiplication op to matrix C using A and B as parameters
3092+
2147483672 LinAlgMatrixAccumulate accumulate A or B matrix into Accumulator matrix following LHS += RHS
3093+
2147483673 LinAlgMatVecMul Multiplies a MxK dimension matrix and a K sized input vector
3094+
2147483674 LinAlgMatVecMulAdd Multiplies a MxK dimension matrix and a K sized input vector then adds a M sized bias vector
3095+
2147483675 LinAlgMatrixAccumulateToDescriptor accumulates a matrix to a RWByteAddressBuffer
3096+
2147483676 LinAlgMatrixAccumulateToMemory accumulates a matrix to groupshared memory
3097+
2147483677 LinAlgMatrixOuterProduct Outer products an M sized vector and a N sized vector producing an MxN matrix
30983098
2147483678 ReservedD1 reserved
30993099
2147483679 ReservedD2 reserved
31003100
2147483680 ReservedD3 reserved

include/dxc/DXIL/DxilConstants.h

Lines changed: 110 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -546,40 +546,45 @@ enum class OpCode : unsigned {
546546
9, // returns committed triangle vertices in object space as <9 x float>
547547

548548
// Linear Algebra Operations
549-
CopyConvertMatrix =
549+
LinAlgCopyConvertMatrix =
550550
13, // Converts and copies the element and use type of the source matrix
551551
// to the destination matrix with optional transpose
552-
FillMatrix = 12, // fills a matrix with a scalar value
553-
MatrixAccumulate = 24, // accumulate A or B matrix into Accumulator matrix
554-
// following LHS += RHS
555-
MatrixAccumulateToDescriptor =
552+
LinAlgFillMatrix = 12, // fills a matrix with a scalar value
553+
LinAlgMatVecMul =
554+
25, // Multiplies a MxK dimension matrix and a K sized input vector
555+
LinAlgMatVecMulAdd = 26, // Multiplies a MxK dimension matrix and a K sized
556+
// input vector then adds a M sized bias vector
557+
LinAlgMatrixAccumulate = 24, // accumulate A or B matrix into Accumulator
558+
// matrix following LHS += RHS
559+
LinAlgMatrixAccumulateToDescriptor =
556560
27, // accumulates a matrix to a RWByteAddressBuffer
557-
MatrixAccumulateToMemory = 28, // accumulates a matrix to groupshared memory
558-
MatrixGetCoordinate =
561+
LinAlgMatrixAccumulateToMemory =
562+
28, // accumulates a matrix to groupshared memory
563+
LinAlgMatrixGetCoordinate =
559564
17, // returns a two element vector containing the column and row of the
560565
// matrix that the thread-local index corresponds to
561-
MatrixGetElement = 18, // returns the element of the matrix corresponding to
562-
// the provided thread-local index
563-
MatrixLength = 16, // returns the number of elements stored in thread-local
564-
// storage on the active thread for the provided matrix
565-
MatrixLoadFromDescriptor =
566+
LinAlgMatrixGetElement =
567+
18, // returns the element of the matrix corresponding to the provided
568+
// thread-local index
569+
LinAlgMatrixLength =
570+
16, // returns the number of elements stored in thread-local storage on
571+
// the active thread for the provided matrix
572+
LinAlgMatrixLoadFromDescriptor =
566573
14, // fills a matrix with data from a [RW]ByteAddressBuffer
567-
MatrixLoadFromMemory =
574+
LinAlgMatrixLoadFromMemory =
568575
15, // fills a matrix with data from a groupshared array
569-
MatrixMulOp =
576+
LinAlgMatrixMulOp =
570577
23, // applies a multiplication op to matrix C using A and B as parameters
571-
MatrixOuterProduct = 29, // Outer products an M sized vector and a N sized
572-
// vector producing an MxN matrix
573-
MatrixQueryAccumulatorLayout = 22, // returns comptime 0 when accumulator
574-
// matrix are A layout, 1 when B layout
575-
MatrixSetElement = 19, // sets the element of the matrix corresponding to the
576-
// provided thread-local index
577-
MatrixStoreToDescriptor = 20, // stores a matrix to a RWByteAddressBuffer
578-
MatrixStoreToMemory = 21, // stores a matrix to groupshared memory
579-
MatrixVecMul =
580-
25, // Multiplies a MxK dimension matrix and a K sized input vector
581-
MatrixVecMulAdd = 26, // Multiplies a MxK dimension matrix and a K sized input
582-
// vector then adds a M sized bias vector
578+
LinAlgMatrixOuterProduct = 29, // Outer products an M sized vector and a N
579+
// sized vector producing an MxN matrix
580+
LinAlgMatrixQueryAccumulatorLayout =
581+
22, // returns comptime 0 when accumulator matrix are A layout, 1 when B
582+
// layout
583+
LinAlgMatrixSetElement = 19, // sets the element of the matrix corresponding
584+
// to the provided thread-local index
585+
LinAlgMatrixStoreToDescriptor =
586+
20, // stores a matrix to a RWByteAddressBuffer
587+
LinAlgMatrixStoreToMemory = 21, // stores a matrix to groupshared memory
583588

584589
// No-op
585590
ExperimentalNop = 0, // nop does nothing
@@ -1260,80 +1265,87 @@ enum class OpCode : unsigned {
12601265
// object space as <9 x float>
12611266
// ReservedD0 = 0x8000000B, 2147483659U, -2147483637
12621267
EXP_OPCODE(ExperimentalOps, ReservedD0), // reserved
1263-
// FillMatrix = 0x8000000C, 2147483660U, -2147483636
1264-
EXP_OPCODE(ExperimentalOps, FillMatrix), // fills a matrix with a scalar value
1265-
// CopyConvertMatrix = 0x8000000D, 2147483661U, -2147483635
1268+
// LinAlgFillMatrix = 0x8000000C, 2147483660U, -2147483636
12661269
EXP_OPCODE(ExperimentalOps,
1267-
CopyConvertMatrix), // Converts and copies the element and use type
1268-
// of the source matrix to the destination
1269-
// matrix with optional transpose
1270-
// MatrixLoadFromDescriptor = 0x8000000E, 2147483662U, -2147483634
1271-
EXP_OPCODE(ExperimentalOps,
1272-
MatrixLoadFromDescriptor), // fills a matrix with data from a
1273-
// [RW]ByteAddressBuffer
1274-
// MatrixLoadFromMemory = 0x8000000F, 2147483663U, -2147483633
1275-
EXP_OPCODE(ExperimentalOps, MatrixLoadFromMemory), // fills a matrix with data
1276-
// from a groupshared array
1277-
// MatrixLength = 0x80000010, 2147483664U, -2147483632
1270+
LinAlgFillMatrix), // fills a matrix with a scalar value
1271+
// LinAlgCopyConvertMatrix = 0x8000000D, 2147483661U, -2147483635
12781272
EXP_OPCODE(
12791273
ExperimentalOps,
1280-
MatrixLength), // returns the number of elements stored in thread-local
1281-
// storage on the active thread for the provided matrix
1282-
// MatrixGetCoordinate = 0x80000011, 2147483665U, -2147483631
1274+
LinAlgCopyConvertMatrix), // Converts and copies the element and use type
1275+
// of the source matrix to the destination
1276+
// matrix with optional transpose
1277+
// LinAlgMatrixLoadFromDescriptor = 0x8000000E, 2147483662U, -2147483634
1278+
EXP_OPCODE(ExperimentalOps,
1279+
LinAlgMatrixLoadFromDescriptor), // fills a matrix with data from a
1280+
// [RW]ByteAddressBuffer
1281+
// LinAlgMatrixLoadFromMemory = 0x8000000F, 2147483663U, -2147483633
12831282
EXP_OPCODE(ExperimentalOps,
1284-
MatrixGetCoordinate), // returns a two element vector containing
1285-
// the column and row of the matrix that the
1286-
// thread-local index corresponds to
1287-
// MatrixGetElement = 0x80000012, 2147483666U, -2147483630
1283+
LinAlgMatrixLoadFromMemory), // fills a matrix with data from a
1284+
// groupshared array
1285+
// LinAlgMatrixLength = 0x80000010, 2147483664U, -2147483632
1286+
EXP_OPCODE(ExperimentalOps,
1287+
LinAlgMatrixLength), // returns the number of elements stored in
1288+
// thread-local storage on the active thread
1289+
// for the provided matrix
1290+
// LinAlgMatrixGetCoordinate = 0x80000011, 2147483665U, -2147483631
12881291
EXP_OPCODE(
12891292
ExperimentalOps,
1290-
MatrixGetElement), // returns the element of the matrix corresponding to
1291-
// the provided thread-local index
1292-
// MatrixSetElement = 0x80000013, 2147483667U, -2147483629
1293+
LinAlgMatrixGetCoordinate), // returns a two element vector containing the
1294+
// column and row of the matrix that the
1295+
// thread-local index corresponds to
1296+
// LinAlgMatrixGetElement = 0x80000012, 2147483666U, -2147483630
12931297
EXP_OPCODE(ExperimentalOps,
1294-
MatrixSetElement), // sets the element of the matrix corresponding
1295-
// to the provided thread-local index
1296-
// MatrixStoreToDescriptor = 0x80000014, 2147483668U, -2147483628
1298+
LinAlgMatrixGetElement), // returns the element of the matrix
1299+
// corresponding to the provided
1300+
// thread-local index
1301+
// LinAlgMatrixSetElement = 0x80000013, 2147483667U, -2147483629
12971302
EXP_OPCODE(
12981303
ExperimentalOps,
1299-
MatrixStoreToDescriptor), // stores a matrix to a RWByteAddressBuffer
1300-
// MatrixStoreToMemory = 0x80000015, 2147483669U, -2147483627
1304+
LinAlgMatrixSetElement), // sets the element of the matrix corresponding
1305+
// to the provided thread-local index
1306+
// LinAlgMatrixStoreToDescriptor = 0x80000014, 2147483668U, -2147483628
13011307
EXP_OPCODE(ExperimentalOps,
1302-
MatrixStoreToMemory), // stores a matrix to groupshared memory
1303-
// MatrixQueryAccumulatorLayout = 0x80000016, 2147483670U, -2147483626
1308+
LinAlgMatrixStoreToDescriptor), // stores a matrix to a
1309+
// RWByteAddressBuffer
1310+
// LinAlgMatrixStoreToMemory = 0x80000015, 2147483669U, -2147483627
13041311
EXP_OPCODE(
13051312
ExperimentalOps,
1306-
MatrixQueryAccumulatorLayout), // returns comptime 0 when accumulator
1307-
// matrix are A layout, 1 when B layout
1308-
// MatrixMulOp = 0x80000017, 2147483671U, -2147483625
1313+
LinAlgMatrixStoreToMemory), // stores a matrix to groupshared memory
1314+
// LinAlgMatrixQueryAccumulatorLayout = 0x80000016, 2147483670U, -2147483626
1315+
EXP_OPCODE(ExperimentalOps,
1316+
LinAlgMatrixQueryAccumulatorLayout), // returns comptime 0 when
1317+
// accumulator matrix are A
1318+
// layout, 1 when B layout
1319+
// LinAlgMatrixMulOp = 0x80000017, 2147483671U, -2147483625
13091320
EXP_OPCODE(ExperimentalOps,
1310-
MatrixMulOp), // applies a multiplication op to matrix C using A
1311-
// and B as parameters
1312-
// MatrixAccumulate = 0x80000018, 2147483672U, -2147483624
1321+
LinAlgMatrixMulOp), // applies a multiplication op to matrix C
1322+
// using A and B as parameters
1323+
// LinAlgMatrixAccumulate = 0x80000018, 2147483672U, -2147483624
13131324
EXP_OPCODE(ExperimentalOps,
1314-
MatrixAccumulate), // accumulate A or B matrix into Accumulator
1315-
// matrix following LHS += RHS
1316-
// MatrixVecMul = 0x80000019, 2147483673U, -2147483623
1325+
LinAlgMatrixAccumulate), // accumulate A or B matrix into
1326+
// Accumulator matrix following LHS += RHS
1327+
// LinAlgMatVecMul = 0x80000019, 2147483673U, -2147483623
13171328
EXP_OPCODE(ExperimentalOps,
1318-
MatrixVecMul), // Multiplies a MxK dimension matrix and a K sized
1319-
// input vector
1320-
// MatrixVecMulAdd = 0x8000001A, 2147483674U, -2147483622
1329+
LinAlgMatVecMul), // Multiplies a MxK dimension matrix and a K
1330+
// sized input vector
1331+
// LinAlgMatVecMulAdd = 0x8000001A, 2147483674U, -2147483622
13211332
EXP_OPCODE(
13221333
ExperimentalOps,
1323-
MatrixVecMulAdd), // Multiplies a MxK dimension matrix and a K sized input
1324-
// vector then adds a M sized bias vector
1325-
// MatrixAccumulateToDescriptor = 0x8000001B, 2147483675U, -2147483621
1334+
LinAlgMatVecMulAdd), // Multiplies a MxK dimension matrix and a K sized
1335+
// input vector then adds a M sized bias vector
1336+
// LinAlgMatrixAccumulateToDescriptor = 0x8000001B, 2147483675U, -2147483621
13261337
EXP_OPCODE(ExperimentalOps,
1327-
MatrixAccumulateToDescriptor), // accumulates a matrix to a
1328-
// RWByteAddressBuffer
1329-
// MatrixAccumulateToMemory = 0x8000001C, 2147483676U, -2147483620
1338+
LinAlgMatrixAccumulateToDescriptor), // accumulates a matrix to a
1339+
// RWByteAddressBuffer
1340+
// LinAlgMatrixAccumulateToMemory = 0x8000001C, 2147483676U, -2147483620
1341+
EXP_OPCODE(ExperimentalOps,
1342+
LinAlgMatrixAccumulateToMemory), // accumulates a matrix to
1343+
// groupshared memory
1344+
// LinAlgMatrixOuterProduct = 0x8000001D, 2147483677U, -2147483619
13301345
EXP_OPCODE(
13311346
ExperimentalOps,
1332-
MatrixAccumulateToMemory), // accumulates a matrix to groupshared memory
1333-
// MatrixOuterProduct = 0x8000001D, 2147483677U, -2147483619
1334-
EXP_OPCODE(ExperimentalOps,
1335-
MatrixOuterProduct), // Outer products an M sized vector and a N
1336-
// sized vector producing an MxN matrix
1347+
LinAlgMatrixOuterProduct), // Outer products an M sized vector and a N
1348+
// sized vector producing an MxN matrix
13371349
// ReservedD1 = 0x8000001E, 2147483678U, -2147483618
13381350
EXP_OPCODE(ExperimentalOps, ReservedD1), // reserved
13391351
// ReservedD2 = 0x8000001F, 2147483679U, -2147483617
@@ -1505,26 +1517,26 @@ enum class OpCodeClass : unsigned {
15051517
CreateHandleForLib,
15061518

15071519
// Linear Algebra Operations
1508-
CopyConvertMatrix,
1509-
FillMatrix,
1520+
LinAlgCopyConvertMatrix,
1521+
LinAlgFillMatrix,
1522+
LinAlgMatVecMul,
1523+
LinAlgMatVecMulAdd,
1524+
LinAlgMatrixAccumulate,
1525+
LinAlgMatrixAccumulateToDescriptor,
1526+
LinAlgMatrixAccumulateToMemory,
1527+
LinAlgMatrixGetCoordinate,
1528+
LinAlgMatrixGetElement,
1529+
LinAlgMatrixLength,
1530+
LinAlgMatrixLoadFromDescriptor,
1531+
LinAlgMatrixLoadFromMemory,
1532+
LinAlgMatrixMulOp,
1533+
LinAlgMatrixOuterProduct,
1534+
LinAlgMatrixQueryAccumulatorLayout,
1535+
LinAlgMatrixSetElement,
1536+
LinAlgMatrixStoreToDescriptor,
1537+
LinAlgMatrixStoreToMemory,
15101538
MatVecMul,
15111539
MatVecMulAdd,
1512-
MatrixAccumulate,
1513-
MatrixAccumulateToDescriptor,
1514-
MatrixAccumulateToMemory,
1515-
MatrixGetCoordinate,
1516-
MatrixGetElement,
1517-
MatrixLength,
1518-
MatrixLoadFromDescriptor,
1519-
MatrixLoadFromMemory,
1520-
MatrixMulOp,
1521-
MatrixOuterProduct,
1522-
MatrixQueryAccumulatorLayout,
1523-
MatrixSetElement,
1524-
MatrixStoreToDescriptor,
1525-
MatrixStoreToMemory,
1526-
MatrixVecMul,
1527-
MatrixVecMulAdd,
15281540
OuterProductAccumulate,
15291541
VectorAccumulate,
15301542

0 commit comments

Comments
 (0)