From 5aa3a92f825d9c65d6555c2afd1fa120c017aa63 Mon Sep 17 00:00:00 2001 From: Ashley Coleman Date: Tue, 22 Sep 2026 14:16:09 -0600 Subject: [PATCH 1/3] [SM6.10] Add missing sign required for runtime data tracking --- include/dxc/DXIL/DxilInstructions.h | 28 +++++++++------ lib/DXIL/DxilOperations.cpp | 14 +++++++- lib/DxilContainer/DxilContainerAssembler.cpp | 4 ++- lib/DxilValidation/DxilValidation.cpp | 21 +++++++++++ lib/HLSL/HLOperationLower.cpp | 13 ++++--- tools/clang/lib/Headers/hlsl/dx/linalg.h | 6 ++-- .../hlsl/linalg/api/matrix-class.hlsl | 12 +++---- .../hlsl/linalg/api/matrix-multiply.hlsl | 19 ++++++---- .../CodeGenDXIL/hlsl/linalg/api/vectors.hlsl | 12 +++++-- .../builtins/copyconvertmatrix/nominal.hlsl | 2 +- .../linalg/builtins/fillmatrix/nominal.hlsl | 32 ++++++++--------- .../builtins/matrixaccumulate/nominal.hlsl | 4 +-- .../matrixaccumulatetodescriptor/nominal.hlsl | 2 +- .../matrixaccumulatetomemory/nominal.hlsl | 2 +- .../vector-array.hlsl | 2 +- .../builtins/matrixgetcoordinate/nominal.hlsl | 2 +- .../builtins/matrixgetelement/nominal.hlsl | 2 +- .../linalg/builtins/matrixlength/nominal.hlsl | 2 +- .../matrixmatrixmultiply/nominal.hlsl | 4 +-- .../nominal.hlsl | 12 +++---- .../builtins/matrixouterproduct/nominal.hlsl | 24 ++++++------- .../builtins/matrixsetelement/nominal.hlsl | 2 +- .../matrixstoretodescriptor/nominal.hlsl | 2 +- .../builtins/matrixstoretomemory/nominal.hlsl | 2 +- .../matrixstoretomemory/vector-array.hlsl | 2 +- .../linalg/matrix-target-type-in-struct.hlsl | 4 +-- .../trim-target-types-metadata-compute.hlsl | 6 ++-- .../trim-target-types-metadata-lib.hlsl | 6 ++-- .../test/DXC/dumpPSV_LinAlgAccumulate.hlsl | 19 +++++++--- .../LinAlgMatrix/linalgmatrix-copyconvert.ll | 4 +-- ...atrix-groupshared-vector-memory-invalid.ll | 4 +-- .../linalgmatrix-groupshared-vector-memory.ll | 4 +-- .../linalgmatrix-matrixaccumulate.ll | 24 ++++++------- .../LinAlgMatrix/linalgmatrix-no-bitcast1.ll | 4 +-- .../LinAlgMatrix/linalgmatrix-no-bitcast2.ll | 4 +-- .../LinAlgMatrix/linalgmatrix-no-bitcast3.ll | 2 +- .../linalgmatrix-non-thread-ops.ll | 13 +++++-- .../LinAlgMatrix/linalgmatrix-outerproduct.ll | 36 ++++++++++--------- .../LinAlgMatrix/linalgmatrix-stage-anyhit.ll | 8 ++--- .../LinAlgMatrix/linalgmatrix-stage-as.ll | 8 ++--- .../linalgmatrix-stage-callable.ll | 8 ++--- .../linalgmatrix-stage-closesthit.ll | 8 ++--- .../LinAlgMatrix/linalgmatrix-stage-cs.ll | 8 ++--- .../LinAlgMatrix/linalgmatrix-stage-ds.ll | 8 ++--- .../LinAlgMatrix/linalgmatrix-stage-gs.ll | 8 ++--- .../LinAlgMatrix/linalgmatrix-stage-hs.ll | 8 ++--- .../linalgmatrix-stage-intersection.ll | 8 ++--- .../LinAlgMatrix/linalgmatrix-stage-miss.ll | 8 ++--- .../LinAlgMatrix/linalgmatrix-stage-ms.ll | 8 ++--- .../LinAlgMatrix/linalgmatrix-stage-node.ll | 8 ++--- .../LinAlgMatrix/linalgmatrix-stage-ps.ll | 8 ++--- .../linalgmatrix-stage-raygeneration.ll | 8 ++--- .../LinAlgMatrix/linalgmatrix-stage-vs.ll | 8 ++--- .../linalg/builtins/matrix-builtins-ast.hlsl | 10 +++--- .../hlsl/linalg/builtins/stage-errors.hlsl | 4 +-- .../builtins/unavailable_pre_sm610.hlsl | 4 +-- .../clang/unittests/HLSLExec/LinAlgTests.cpp | 34 ++++++++++-------- utils/hct/gen_intrin_main.txt | 4 +-- utils/hct/hctdb.py | 12 +++++-- 59 files changed, 319 insertions(+), 226 deletions(-) diff --git a/include/dxc/DXIL/DxilInstructions.h b/include/dxc/DXIL/DxilInstructions.h index c7a9abdd37..9d31ab82bc 100644 --- a/include/dxc/DXIL/DxilInstructions.h +++ b/include/dxc/DXIL/DxilInstructions.h @@ -10317,7 +10317,7 @@ struct DxilInst_LinAlgFillMatrix { // Validation support bool isAllowed() const { return true; } bool isArgumentListValid() const { - if (2 != llvm::dyn_cast(Instr)->getNumArgOperands()) + if (3 != llvm::dyn_cast(Instr)->getNumArgOperands()) return false; return true; } @@ -10325,11 +10325,14 @@ struct DxilInst_LinAlgFillMatrix { bool requiresUniformInputs() const { return false; } // Operand indexes enum OperandIdx { - arg_value = 1, + arg_isInputSigned = 1, + arg_value = 2, }; // Accessors - llvm::Value *get_value() const { return Instr->getOperand(1); } - void set_value(llvm::Value *val) { Instr->setOperand(1, val); } + llvm::Value *get_isInputSigned() const { return Instr->getOperand(1); } + void set_isInputSigned(llvm::Value *val) { Instr->setOperand(1, val); } + llvm::Value *get_value() const { return Instr->getOperand(2); } + void set_value(llvm::Value *val) { Instr->setOperand(2, val); } }; /// This instruction Converts and copies the element and use type of the source @@ -10905,7 +10908,7 @@ struct DxilInst_LinAlgMatrixOuterProduct { // Validation support bool isAllowed() const { return true; } bool isArgumentListValid() const { - if (3 != llvm::dyn_cast(Instr)->getNumArgOperands()) + if (4 != llvm::dyn_cast(Instr)->getNumArgOperands()) return false; return true; } @@ -10913,14 +10916,17 @@ struct DxilInst_LinAlgMatrixOuterProduct { bool requiresUniformInputs() const { return false; } // Operand indexes enum OperandIdx { - arg_vectorA = 1, - arg_vectorB = 2, + arg_isInputSigned = 1, + arg_vectorA = 2, + arg_vectorB = 3, }; // Accessors - llvm::Value *get_vectorA() const { return Instr->getOperand(1); } - void set_vectorA(llvm::Value *val) { Instr->setOperand(1, val); } - llvm::Value *get_vectorB() const { return Instr->getOperand(2); } - void set_vectorB(llvm::Value *val) { Instr->setOperand(2, val); } + llvm::Value *get_isInputSigned() const { return Instr->getOperand(1); } + void set_isInputSigned(llvm::Value *val) { Instr->setOperand(1, val); } + llvm::Value *get_vectorA() const { return Instr->getOperand(2); } + void set_vectorA(llvm::Value *val) { Instr->setOperand(2, val); } + llvm::Value *get_vectorB() const { return Instr->getOperand(3); } + void set_vectorB(llvm::Value *val) { Instr->setOperand(3, val); } }; /// This instruction Convert vector components from one interpretation to diff --git a/lib/DXIL/DxilOperations.cpp b/lib/DXIL/DxilOperations.cpp index 294b39b566..776edd966b 100644 --- a/lib/DXIL/DxilOperations.cpp +++ b/lib/DXIL/DxilOperations.cpp @@ -6570,6 +6570,7 @@ Function *OP::GetOpFunc(OpCode opCode, Type *pOverloadType) { case OpCode::LinAlgFillMatrix: A(EXT(0)); A(pI32); + A(pI1); A(EXT(1)); break; case OpCode::LinAlgCopyConvertMatrix: @@ -6693,6 +6694,7 @@ Function *OP::GetOpFunc(OpCode opCode, Type *pOverloadType) { case OpCode::LinAlgMatrixOuterProduct: A(EXT(0)); A(pI32); + A(pI1); A(EXT(1)); A(EXT(2)); break; @@ -7074,6 +7076,11 @@ llvm::Type *OP::GetOverloadType(OpCode opCode, llvm::Function *F) { FT->getParamType(2), FT->getParamType(3)}); case OpCode::LinAlgFillMatrix: + if (FT->getNumParams() < 3) + return nullptr; + return llvm::StructType::get(Ctx, + {FT->getReturnType(), FT->getParamType(2)}); + case OpCode::LinAlgCopyConvertMatrix: case OpCode::LinAlgMatrixGetElement: case OpCode::LinAlgConvert: @@ -7106,7 +7113,6 @@ llvm::Type *OP::GetOverloadType(OpCode opCode, llvm::Function *F) { case OpCode::LinAlgMatrixMultiply: case OpCode::LinAlgMatrixAccumulate: - case OpCode::LinAlgMatrixOuterProduct: if (FT->getNumParams() < 3) return nullptr; return llvm::StructType::get( @@ -7119,6 +7125,12 @@ llvm::Type *OP::GetOverloadType(OpCode opCode, llvm::Function *F) { {FT->getReturnType(), FT->getParamType(1), FT->getParamType(3), FT->getParamType(5)}); + case OpCode::LinAlgMatrixOuterProduct: + if (FT->getNumParams() < 4) + return nullptr; + return llvm::StructType::get( + Ctx, {FT->getReturnType(), FT->getParamType(2), FT->getParamType(3)}); + // OPCODE-OLOAD-TYPES:END default: return Ty; diff --git a/lib/DxilContainer/DxilContainerAssembler.cpp b/lib/DxilContainer/DxilContainerAssembler.cpp index 8d4910232f..6bf8247887 100644 --- a/lib/DxilContainer/DxilContainerAssembler.cpp +++ b/lib/DxilContainer/DxilContainerAssembler.cpp @@ -964,10 +964,12 @@ class DxilPSVWriter : public DxilPartWriter { LinAlgMatrixInfo Result; if (!GetLinAlgMatrixInfo(CI->getType(), Result)) break; + bool IsInputSigned = + cast(Op.get_isInputSigned())->getZExtValue() != 0; PSVLinAlgOuterProduct0 Record = { static_cast(Result.Type), static_cast(GetVectorOrScalarComponentType( - Op.get_vectorA()->getType())), + Op.get_vectorA()->getType(), IsInputSigned)), {0, 0}}; if (std::find_if( m_LinAlgOuterProducts.begin(), m_LinAlgOuterProducts.end(), diff --git a/lib/DxilValidation/DxilValidation.cpp b/lib/DxilValidation/DxilValidation.cpp index fe638e1f2c..20e61d57aa 100644 --- a/lib/DxilValidation/DxilValidation.cpp +++ b/lib/DxilValidation/DxilValidation.cpp @@ -1327,6 +1327,19 @@ static void ValidateLinAlgMatrixStoreToMemory(CallInst *CI, } } +static void ValidateLinAlgIsInputSigned(CallInst *CI, Value *IsInputSignedValue, + Type *InputTy, + ValidationContext &ValCtx, + const char *OpName) { + std::optional IsInputSigned = ValidateConstantIntGetValue( + CI, IsInputSignedValue, ValCtx, "IsInputSigned", OpName); + Type *ScalarTy = InputTy->getScalarType(); + if (IsInputSigned && ScalarTy->isFloatingPointTy() && *IsInputSigned != 1) + ValCtx.EmitInstrFormatError( + CI, ValidationRule::InstrLinAlgMatrixUnsignedFloatTypeNotAllowed, + {TypeToString(ScalarTy)}); +} + static void ValidateLinAlgMatVecMul(CallInst *CI, ValidationContext &ValCtx, const char *OpName = "LinAlgMatVecMul") { ValidateLinAlgOpParameters(CI, ValCtx); @@ -1695,6 +1708,10 @@ ValidateLinAlgVectorAccumulateToDescriptor(CallInst *CI, static void ValidateLinAlgFillMatrix(CallInst *CI, ValidationContext &ValCtx) { ValidateLinAlgOpReturnMatrix(CI, ValCtx); ValidateLinAlgOpParameters(CI, ValCtx); + DxilInst_LinAlgFillMatrix Op(CI); + ValidateLinAlgIsInputSigned(CI, Op.get_isInputSigned(), + Op.get_value()->getType(), ValCtx, + "LinAlgFillMatrix"); std::optional RetMat = GetCheckedLATT(CI->getType(), ValCtx); if (!RetMat) @@ -2015,6 +2032,10 @@ static void ValidateLinAlgMatrixOuterProduct(CallInst *CI, DxilInst_LinAlgMatrixOuterProduct Op(CI); VectorType *AVecTy = cast(Op.get_vectorA()->getType()); VectorType *BVecTy = cast(Op.get_vectorB()->getType()); + Type *SignednessTy = + AVecTy->getElementType()->isFloatingPointTy() ? AVecTy : BVecTy; + ValidateLinAlgIsInputSigned(CI, Op.get_isInputSigned(), SignednessTy, ValCtx, + "LinAlgMatrixOuterProduct"); std::optional RetMat = GetCheckedLATT(CI->getType(), ValCtx); if (!RetMat) diff --git a/lib/HLSL/HLOperationLower.cpp b/lib/HLSL/HLOperationLower.cpp index bbfe342a88..ee816b1014 100644 --- a/lib/HLSL/HLOperationLower.cpp +++ b/lib/HLSL/HLOperationLower.cpp @@ -6783,13 +6783,14 @@ Value *TranslateLinAlgFillMatrix(CallInst *CI, IntrinsicOp IOP, Value *MatrixPtr = CI->getArgOperand(1); DXASSERT_NOMSG(isa(MatrixPtr->getType())); Type *MatrixType = MatrixPtr->getType()->getPointerElementType(); - Value *Scalar = CI->getArgOperand(2); + Value *IsInputSigned = CI->getArgOperand(2); + Value *Scalar = CI->getArgOperand(3); Constant *OpArg = HlslOp->GetU32Const((unsigned)OpCode); Function *DxilFunc = HlslOp->GetOpFunc(OpCode, {MatrixType, Scalar->getType()}); - Value *Matrix = Builder.CreateCall(DxilFunc, {OpArg, Scalar}); + Value *Matrix = Builder.CreateCall(DxilFunc, {OpArg, IsInputSigned, Scalar}); Builder.CreateStore(Matrix, MatrixPtr); return nullptr; @@ -6913,14 +6914,16 @@ Value *TranslateLinAlgMatrixOuterProduct( Value *MatrixPtr = CI->getArgOperand(1); DXASSERT_NOMSG(isa(MatrixPtr->getType())); Type *MatrixType = MatrixPtr->getType()->getPointerElementType(); - Value *VecA = CI->getArgOperand(2); - Value *VecB = CI->getArgOperand(3); + Value *IsInputSigned = CI->getArgOperand(2); + Value *VecA = CI->getArgOperand(3); + Value *VecB = CI->getArgOperand(4); Constant *OpArg = HlslOp->GetU32Const((unsigned)OpCode); Function *DxilFunc = HlslOp->GetOpFunc(OpCode, {MatrixType, VecA->getType(), VecB->getType()}); - Value *Matrix = Builder.CreateCall(DxilFunc, {OpArg, VecA, VecB}); + Value *Matrix = + Builder.CreateCall(DxilFunc, {OpArg, IsInputSigned, VecA, VecB}); Builder.CreateStore(Matrix, MatrixPtr); return nullptr; diff --git a/tools/clang/lib/Headers/hlsl/dx/linalg.h b/tools/clang/lib/Headers/hlsl/dx/linalg.h index 0b7c77910c..6022225e5a 100644 --- a/tools/clang/lib/Headers/hlsl/dx/linalg.h +++ b/tools/clang/lib/Headers/hlsl/dx/linalg.h @@ -277,7 +277,8 @@ class Matrix { typename hlsl::enable_if::value, Matrix>::type Splat(T Val) { Matrix Result; - __builtin_LinAlg_FillMatrix(Result.__handle, Val); + __builtin_LinAlg_FillMatrix(Result.__handle, hlsl::is_signed::value, + Val); return Result; } @@ -674,7 +675,8 @@ template Matrix >::type OuterProduct(vector VecA, vector VecB) { Matrix Result; - __builtin_LinAlg_MatrixOuterProduct(Result.__handle, VecA, VecB); + __builtin_LinAlg_MatrixOuterProduct( + Result.__handle, hlsl::is_signed::value, VecA, VecB); return Result; } diff --git a/tools/clang/test/CodeGenDXIL/hlsl/linalg/api/matrix-class.hlsl b/tools/clang/test/CodeGenDXIL/hlsl/linalg/api/matrix-class.hlsl index e7914c2851..6d5d7acb45 100644 --- a/tools/clang/test/CodeGenDXIL/hlsl/linalg/api/matrix-class.hlsl +++ b/tools/clang/test/CodeGenDXIL/hlsl/linalg/api/matrix-class.hlsl @@ -30,18 +30,18 @@ void main(uint ID : SV_GroupID) // Matrix::Splat // // CHECK: %[[MATA1:.*]] = call %dx.types.LinAlgMatrixC9M4N4U0S1 @dx.op.linAlgFillMatrix.mC9M4N4U0S1.f32( -// CHECK-SAME: i32 -2147483636, float 1.000000e+00) +// CHECK-SAME: i32 -2147483636, i1 true, float 1.000000e+00) MatrixATy MatA1 = MatrixATy::Splat(1.0f); // CHECK: %[[MATB1:.*]] = call %dx.types.LinAlgMatrixC9M4N4U1S1 @dx.op.linAlgFillMatrix.mC9M4N4U1S1.f32( -// CHECK-SAME: i32 -2147483636, float 2.000000e+00) +// CHECK-SAME: i32 -2147483636, i1 true, float 2.000000e+00) MatrixBTy MatB1; MatB1 = MatrixBTy::Splat(2.0f); // Matrix::Cast // // CHECK: %[[MAT48F:.*]] = call %dx.types.LinAlgMatrixC9M4N8U0S1 @dx.op.linAlgFillMatrix.mC9M4N8U0S1.f32( -// CHECK-SAME: i32 -2147483636, float 3.000000e+00) ; LinAlgFillMatrix(value) +// CHECK-SAME: i32 -2147483636, i1 true, float 3.000000e+00) ; LinAlgFillMatrix(isInputSigned,value) // CHECK: call %dx.types.LinAlgMatrixC4M4N8U0S1 @dx.op.linAlgCopyConvertMatrix.mC4M4N8U0S1.mC9M4N8U0S1( // CHECK-SAME: i32 -2147483635, %dx.types.LinAlgMatrixC9M4N8U0S1 %[[MAT48F]], i1 false) @@ -142,7 +142,7 @@ void main(uint ID : SV_GroupID) MatB4.Store(PackedArr, 0, 16, MatrixLayoutEnum::ColMajor); // CHECK: %[[ACCUM0:.*]] = call %dx.types.LinAlgMatrixC9M4N4U2S1 @dx.op.linAlgFillMatrix.mC9M4N4U2S1.f32( -// CHECK-SAME: i32 -2147483636, float 1.400000e+01) ; LinAlgFillMatrix(value) +// CHECK-SAME: i32 -2147483636, i1 true, float 1.400000e+01) ; LinAlgFillMatrix(isInputSigned,value) MatrixAccumTy AccMat1 = MatrixAccumTy::Splat(14.0f); // Matrix::InterlockedAccumulate to resource descriptor @@ -173,7 +173,7 @@ void main(uint ID : SV_GroupID) // Matrix::InterlockedAccumulate supports thread-group scope // // CHECK: %[[TGACCUM:.*]] = call %dx.types.LinAlgMatrixC9M4N4U2S2 @dx.op.linAlgFillMatrix.mC9M4N4U2S2.f32( -// CHECK-SAME: i32 -2147483636, float 1.500000e+01) +// CHECK-SAME: i32 -2147483636, i1 true, float 1.500000e+01) TGMatrixAccumTy TGAccMat = TGMatrixAccumTy::Splat(15.0f); // CHECK: call void @dx.op.linAlgMatrixAccumulateToMemory.mC9M4N4U2S2.f32(i32 -2147483620, // CHECK-SAME: %dx.types.LinAlgMatrixC9M4N4U2S2 %[[TGACCUM]], @@ -185,7 +185,7 @@ void main(uint ID : SV_GroupID) // Matrix::Accumulate // // CHECK: %[[ACCUM1:.*]] = call %dx.types.LinAlgMatrixC9M4N4U2S1 @dx.op.linAlgFillMatrix.mC9M4N4U2S1.f32( -// CHECK-SAME: i32 -2147483636, float 0.000000e+00) ; LinAlgFillMatrix(value) +// CHECK-SAME: i32 -2147483636, i1 true, float 0.000000e+00) ; LinAlgFillMatrix(isInputSigned,value) MatrixAccumTy AccMat2 = MatrixAccumTy::Splat(0.0f); // CHECK: %[[ACCUM2:.*]] = call %dx.types.LinAlgMatrixC9M4N4U2S1 diff --git a/tools/clang/test/CodeGenDXIL/hlsl/linalg/api/matrix-multiply.hlsl b/tools/clang/test/CodeGenDXIL/hlsl/linalg/api/matrix-multiply.hlsl index ab2da55138..a5a78a3539 100644 --- a/tools/clang/test/CodeGenDXIL/hlsl/linalg/api/matrix-multiply.hlsl +++ b/tools/clang/test/CodeGenDXIL/hlsl/linalg/api/matrix-multiply.hlsl @@ -11,20 +11,25 @@ void main() // using MatrixAF16WTy = Matrix; using MatrixAI32WTy = Matrix; + using MatrixAU32WTy = Matrix; using MatrixBI32WTy = Matrix; using MatrixAccF32WTy = Matrix; using MatrixAccI32WTy = Matrix; // CHECK: %[[MATA1:.*]] = call %dx.types.LinAlgMatrixC8M3N4U0S1 @dx.op.linAlgFillMatrix.mC8M3N4U0S1.f32( -// CHECK-SAME: i32 -2147483636, float 1.500000e+00) ; LinAlgFillMatrix(value) +// CHECK-SAME: i32 -2147483636, i1 true, float 1.500000e+00) ; LinAlgFillMatrix(isInputSigned,value) MatrixAF16WTy MatA1 = MatrixAF16WTy::Splat(1.5f); // CHECK: %[[MATA2:.*]] = call %dx.types.LinAlgMatrixC4M3N4U0S1 @dx.op.linAlgFillMatrix.mC4M3N4U0S1.i32( -// CHECK-SAME: i32 -2147483636, i32 45) ; LinAlgFillMatrix(value) +// CHECK-SAME: i32 -2147483636, i1 true, i32 45) ; LinAlgFillMatrix(isInputSigned,value) MatrixAI32WTy MatA2 = MatrixAI32WTy::Splat(45); +// CHECK: call %dx.types.LinAlgMatrixC5M3N4U0S1 @dx.op.linAlgFillMatrix.mC5M3N4U0S1.i32( +// CHECK-SAME: i32 -2147483636, i1 false, i32 45) ; LinAlgFillMatrix(isInputSigned,value) + MatrixAU32WTy MatAU32 = MatrixAU32WTy::Splat(45u); + // CHECK: %[[MATB1:.*]] = call %dx.types.LinAlgMatrixC4M4N5U1S1 @dx.op.linAlgFillMatrix.mC4M4N5U1S1.i32( -// CHECK-SAME: i32 -2147483636, i32 13) ; LinAlgFillMatrix(value) +// CHECK-SAME: i32 -2147483636, i1 true, i32 13) ; LinAlgFillMatrix(isInputSigned,value) MatrixBI32WTy MatB1 = MatrixBI32WTy::Splat(13); // CHECK: %[[MATC1:.*]] = call %dx.types.LinAlgMatrixC9M3N5U2S1 @@ -35,7 +40,7 @@ void main() // CHECK: %[[MATC2:.*]] = call %dx.types.LinAlgMatrixC4M3N5U2S1 // CHECK-SAME: @dx.op.linAlgMatrixMultiply.mC4M3N5U2S1.mC4M3N4U0S1.mC4M4N5U1S1(i32 -2147483625, -// CHECK-SAME: %dx.types.LinAlgMatrixC4M3N4U0S1 %2, %dx.types.LinAlgMatrixC4M4N5U1S1 %3) +// CHECK-SAME: %dx.types.LinAlgMatrixC4M3N4U0S1 %[[MATA2]], %dx.types.LinAlgMatrixC4M4N5U1S1 %[[MATB1]]) // CHECK-SAME: ; LinAlgMatrixMultiply(matrixA,matrixB) MatrixAccI32WTy MatCInt1 = Multiply(MatA2, MatB1); @@ -48,15 +53,15 @@ void main() using MatrixAccI32TGTy = Matrix; // CHECK: %[[MATA3:.*]] = call %dx.types.LinAlgMatrixC8M3N4U0S2 @dx.op.linAlgFillMatrix.mC8M3N4U0S2.f32( -// CHECK-SAME: i32 -2147483636, float 2.500000e+00) ; LinAlgFillMatrix(value) +// CHECK-SAME: i32 -2147483636, i1 true, float 2.500000e+00) ; LinAlgFillMatrix(isInputSigned,value) MatrixAF16TGTy MatA3 = MatrixAF16TGTy::Splat(2.5f); // CHECK: %[[MATA4:.*]] = call %dx.types.LinAlgMatrixC4M3N4U0S2 @dx.op.linAlgFillMatrix.mC4M3N4U0S2.i32( -// CHECK-SAME: i32 -2147483636, i32 23) ; LinAlgFillMatrix(value) +// CHECK-SAME: i32 -2147483636, i1 true, i32 23) ; LinAlgFillMatrix(isInputSigned,value) MatrixAI32TGTy MatA4 = MatrixAI32TGTy::Splat(23); // CHECK: %[[MATB3:.*]] = call %dx.types.LinAlgMatrixC4M4N5U1S2 @dx.op.linAlgFillMatrix.mC4M4N5U1S2.i32( -// CHECK-SAME: i32 -2147483636, i32 7) ; LinAlgFillMatrix(value) +// CHECK-SAME: i32 -2147483636, i1 true, i32 7) ; LinAlgFillMatrix(isInputSigned,value) MatrixBI32TGTy MatB3 = MatrixBI32TGTy::Splat(7); // CHECK: %[[MATC3:.*]] = call %dx.types.LinAlgMatrixC9M3N5U2S2 diff --git a/tools/clang/test/CodeGenDXIL/hlsl/linalg/api/vectors.hlsl b/tools/clang/test/CodeGenDXIL/hlsl/linalg/api/vectors.hlsl index 97e108b848..327bb0ec46 100644 --- a/tools/clang/test/CodeGenDXIL/hlsl/linalg/api/vectors.hlsl +++ b/tools/clang/test/CodeGenDXIL/hlsl/linalg/api/vectors.hlsl @@ -7,6 +7,7 @@ using namespace dx::linalg; using MatrixATy = Matrix; using MatrixAccum_8_8_Ty = Matrix; using MatrixAccum_8_4_Ty = Matrix; +using MatrixAccum_U32_4_4_Ty = Matrix; using Matrix_7_15_ATy = Matrix; using MatrixPacked_7_15_ATy = Matrix; using MatrixA_BFloat = Matrix; @@ -78,13 +79,20 @@ void main(uint ID : SV_GroupID) { // CHECK: %[[ACCUM1:.*]] = call %dx.types.LinAlgMatrixC8M8N8U2S0 // CHECK-SAME: @dx.op.linAlgMatrixOuterProduct.mC8M8N8U2S0.v8f16.v8f16(i32 -2147483619, - // CHECK-SAME: <8 x half> %[[VEC5]], <8 x half> %[[VEC6]]) ; LinAlgMatrixOuterProduct(vectorA,vectorB) + // CHECK-SAME: i1 true, <8 x half> %[[VEC5]], <8 x half> %[[VEC6]]) ; LinAlgMatrixOuterProduct(isInputSigned,vectorA,vectorB) MatrixAccum_8_8_Ty AccumMatrix1 = OuterProduct(vec5, vec6); // CHECK: %[[ACCUM2:.*]] = call %dx.types.LinAlgMatrixC8M8N4U2S0 @dx.op.linAlgMatrixOuterProduct.mC8M8N4U2S0.v8f16.v4f16( - // CHECK-SAME: i32 -2147483619, <8 x half> %[[VEC5]], <4 x half> %[[VEC20]]) ; LinAlgMatrixOuterProduct(vectorA,vectorB) + // CHECK-SAME: i32 -2147483619, i1 true, <8 x half> %[[VEC5]], <4 x half> %[[VEC20]]) ; LinAlgMatrixOuterProduct(isInputSigned,vectorA,vectorB) MatrixAccum_8_4_Ty AccumMatrix2 = OuterProduct(vec5, vec20); + uint4 unsignedVec = {1, 2, 3, 4}; + // CHECK: call %dx.types.LinAlgMatrixC5M4N4U2S0 @dx.op.linAlgMatrixOuterProduct.mC5M4N4U2S0.v4i32.v4i32( + // CHECK-SAME: i32 -2147483619, i1 false, <4 x i32> , <4 x i32> ) + // CHECK-SAME: ; LinAlgMatrixOuterProduct(isInputSigned,vectorA,vectorB) + MatrixAccum_U32_4_4_Ty UnsignedAccum = + OuterProduct(unsignedVec, unsignedVec); + // CHECK: %[[CONV_VEC:.*]] = call <8 x float> @dx.op.linAlgConvert.v8f32.v8f16(i32 -2147483618, // CHECK-SAME: <8 x half> %[[VEC6]], i32 8, i32 9) ; LinAlgConvert(inputVector,inputInterpretation,outputInterpretation) InterpretedVector convertedVec; diff --git a/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/copyconvertmatrix/nominal.hlsl b/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/copyconvertmatrix/nominal.hlsl index 6780c0cc83..4d9b6abb6c 100644 --- a/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/copyconvertmatrix/nominal.hlsl +++ b/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/copyconvertmatrix/nominal.hlsl @@ -15,7 +15,7 @@ void main() { __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(2, 5, 4, 1, 2)]] mat1; __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(4, 5, 4, 1, 2)]] mat2; - __builtin_LinAlg_FillMatrix(mat1, 1); + __builtin_LinAlg_FillMatrix(mat1, true, 1); __builtin_LinAlg_CopyConvertMatrix(mat2, mat1, false); } diff --git a/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/fillmatrix/nominal.hlsl b/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/fillmatrix/nominal.hlsl index ae409a60ce..df248e2923 100644 --- a/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/fillmatrix/nominal.hlsl +++ b/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/fillmatrix/nominal.hlsl @@ -7,42 +7,42 @@ void main() { // CHECK-LABEL: define void @main() // CHECK: %{{.*}} = call %dx.types.LinAlgMatrixC4M5N4U1S2 @dx.op.linAlgFillMatrix.mC4M5N4U1S2.i32 - // CHECK-SAME: (i32 -2147483636, i32 {{.*}}) ; LinAlgFillMatrix(value) + // CHECK-SAME: (i32 -2147483636, i1 true, i32 {{.*}}) ; LinAlgFillMatrix(isInputSigned,value) - // CHECK2: call void @"dx.hl.op..void (i32, %dx.types.LinAlgMatrixC4M5N4U1S2*, i32)" - // CHECK2-SAME: (i32 402, %dx.types.LinAlgMatrixC4M5N4U1S2* {{.*}}, i32 5), + // CHECK2: call void @"dx.hl.op..void (i32, %dx.types.LinAlgMatrixC4M5N4U1S2*, i1, i32)" + // CHECK2-SAME: (i32 402, %dx.types.LinAlgMatrixC4M5N4U1S2* {{.*}}, i1 true, i32 5), // Matrix __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(4, 5, 4, 1, 2)]] mat1; - __builtin_LinAlg_FillMatrix(mat1, 5); + __builtin_LinAlg_FillMatrix(mat1, true, 5); // CHECK: %{{.*}} = call %dx.types.LinAlgMatrixC5M8N4U0S1 @dx.op.linAlgFillMatrix.mC5M8N4U0S1.f32 - // CHECK-SAME: (i32 -2147483636, float {{.*}}) ; LinAlgFillMatrix(value) + // CHECK-SAME: (i32 -2147483636, i1 true, float {{.*}}) ; LinAlgFillMatrix(isInputSigned,value) - // CHECK2: call void @"dx.hl.op..void (i32, %dx.types.LinAlgMatrixC5M8N4U0S1*, float)" - // CHECK2-SAME: (i32 402, %dx.types.LinAlgMatrixC5M8N4U0S1* {{.*}}, float 0x40091EB860000000) + // CHECK2: call void @"dx.hl.op..void (i32, %dx.types.LinAlgMatrixC5M8N4U0S1*, i1, float)" + // CHECK2-SAME: (i32 402, %dx.types.LinAlgMatrixC5M8N4U0S1* {{.*}}, i1 true, float 0x40091EB860000000) // Matrix __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(5, 8, 4, 0, 1)]] mat2; - __builtin_LinAlg_FillMatrix(mat2, 3.14); + __builtin_LinAlg_FillMatrix(mat2, true, 3.14); // CHECK: %{{.*}} = call %dx.types.LinAlgMatrixC5M8N4U0S2 @dx.op.linAlgFillMatrix.mC5M8N4U0S2.f64 - // CHECK-SAME: (i32 -2147483636, double {{.*}}) ; LinAlgFillMatrix(value) + // CHECK-SAME: (i32 -2147483636, i1 true, double {{.*}}) ; LinAlgFillMatrix(isInputSigned,value) - // CHECK2: call void @"dx.hl.op..void (i32, %dx.types.LinAlgMatrixC5M8N4U0S2*, double)" - // CHECK2-SAME: (i32 402, %dx.types.LinAlgMatrixC5M8N4U0S2* {{.*}}, double %{{.+}}) + // CHECK2: call void @"dx.hl.op..void (i32, %dx.types.LinAlgMatrixC5M8N4U0S2*, i1, double)" + // CHECK2-SAME: (i32 402, %dx.types.LinAlgMatrixC5M8N4U0S2* {{.*}}, i1 true, double %{{.+}}) // Matrix double dVal = 9.87; __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(5, 8, 4, 0, 2)]] mat3; - __builtin_LinAlg_FillMatrix(mat3, dVal); + __builtin_LinAlg_FillMatrix(mat3, true, dVal); // CHECK: %{{.*}} = call %dx.types.LinAlgMatrixC5M4N4U1S1 @dx.op.linAlgFillMatrix.mC5M4N4U1S1.i64 - // CHECK-SAME: (i32 -2147483636, i64 {{.*}}) ; LinAlgFillMatrix(value) + // CHECK-SAME: (i32 -2147483636, i1 true, i64 {{.*}}) ; LinAlgFillMatrix(isInputSigned,value) - // CHECK2: call void @"dx.hl.op..void (i32, %dx.types.LinAlgMatrixC5M4N4U1S1*, i64)" - // CHECK2-SAME: (i32 402, %dx.types.LinAlgMatrixC5M4N4U1S1* {{.*}}, i64 %{{.+}}) + // CHECK2: call void @"dx.hl.op..void (i32, %dx.types.LinAlgMatrixC5M4N4U1S1*, i1, i64)" + // CHECK2-SAME: (i32 402, %dx.types.LinAlgMatrixC5M4N4U1S1* {{.*}}, i1 true, i64 %{{.+}}) // Matrix int64_t i64Val = 12345; __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(5, 4, 4, 1, 1)]] mat4; - __builtin_LinAlg_FillMatrix(mat4, i64Val); + __builtin_LinAlg_FillMatrix(mat4, true, i64Val); } diff --git a/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixaccumulate/nominal.hlsl b/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixaccumulate/nominal.hlsl index 8d20733f8f..e19cd38a19 100644 --- a/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixaccumulate/nominal.hlsl +++ b/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixaccumulate/nominal.hlsl @@ -10,8 +10,8 @@ void main() { __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(5, 4, 4, 2, 1)]] mat2; __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(5, 4, 4, 2, 1)]] mat3; - __builtin_LinAlg_FillMatrix(mat1, 1); - __builtin_LinAlg_FillMatrix(mat2, 2); + __builtin_LinAlg_FillMatrix(mat1, true, 1); + __builtin_LinAlg_FillMatrix(mat2, true, 2); // CHECK: call %dx.types.LinAlgMatrixC5M4N4U2S1 @dx.op.linAlgMatrixAccumulate.mC5M4N4U2S1.mC5M4N4U2S1.mC5M4N4U0S1 // CHECK-SAME: (i32 -2147483624, %dx.types.LinAlgMatrixC5M4N4U2S1 %{{.*}}, %dx.types.LinAlgMatrixC5M4N4U0S1 %{{.*}}) ; LinAlgMatrixAccumulate(matrixLHS,matrixRHS) diff --git a/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixaccumulatetodescriptor/nominal.hlsl b/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixaccumulatetodescriptor/nominal.hlsl index 2c5d481be0..0eca9ecc84 100644 --- a/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixaccumulatetodescriptor/nominal.hlsl +++ b/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixaccumulatetodescriptor/nominal.hlsl @@ -17,6 +17,6 @@ void main() { // Matrix __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(9, 4, 4, 2, 1)]] mat; - __builtin_LinAlg_FillMatrix(mat, 1); + __builtin_LinAlg_FillMatrix(mat, true, 1); __builtin_LinAlg_MatrixAccumulateToDescriptor(mat, outbuf, 0, 0, 0, 128); } diff --git a/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixaccumulatetomemory/nominal.hlsl b/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixaccumulatetomemory/nominal.hlsl index f41e0e9084..7e69049494 100644 --- a/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixaccumulatetomemory/nominal.hlsl +++ b/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixaccumulatetomemory/nominal.hlsl @@ -19,6 +19,6 @@ void main() { // CHECK2-SAME: %dx.types.LinAlgMatrixC9M5N4U2S2 %{{.*}}, [64 x float] addrspace(3)* @"\01?SharedArr@@3PAMA", // CHECK2-SAME: i32 128, i32 16, i32 3) __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(9, 5, 4, 2, 2)]] mat; - __builtin_LinAlg_FillMatrix(mat, 1); + __builtin_LinAlg_FillMatrix(mat, true, 1); __builtin_LinAlg_MatrixAccumulateToMemory(mat, SharedArr, 128, 16, 3); } diff --git a/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixaccumulatetomemory/vector-array.hlsl b/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixaccumulatetomemory/vector-array.hlsl index c8918efce6..c001325163 100644 --- a/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixaccumulatetomemory/vector-array.hlsl +++ b/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixaccumulatetomemory/vector-array.hlsl @@ -24,6 +24,6 @@ void main() { // CHECK2-SAME: %dx.types.LinAlgMatrixC9M5N4U2S2 %{{.*}}, [64 x <2 x float>] addrspace(3)* // CHECK2-SAME: @"\01?SharedArr@@3PAV?$vector@M$01@@A", i32 128, i32 16, i32 3) __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(9, 5, 4, 2, 2)]] mat; - __builtin_LinAlg_FillMatrix(mat, 1); + __builtin_LinAlg_FillMatrix(mat, true, 1); __builtin_LinAlg_MatrixAccumulateToMemory(mat, SharedArr, 128, 16, 3); } diff --git a/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixgetcoordinate/nominal.hlsl b/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixgetcoordinate/nominal.hlsl index 9732790d20..a624aaf77a 100644 --- a/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixgetcoordinate/nominal.hlsl +++ b/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixgetcoordinate/nominal.hlsl @@ -13,6 +13,6 @@ void main() { // CHECK2: call <2 x i32> @"dx.hl.op..<2 x i32> (i32, %dx.types.LinAlgMatrixC4M5N4U1S2, i32)" // CHECK2-SAME: (i32 403, %dx.types.LinAlgMatrixC4M5N4U1S2 %{{.*}}, i32 1) __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(4, 5, 4, 1, 2)]] mat; - __builtin_LinAlg_FillMatrix(mat, 1); + __builtin_LinAlg_FillMatrix(mat, true, 1); uint2 coord = __builtin_LinAlg_MatrixGetCoordinate(mat, 1); } diff --git a/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixgetelement/nominal.hlsl b/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixgetelement/nominal.hlsl index 0f16ff9d90..35a326d6df 100644 --- a/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixgetelement/nominal.hlsl +++ b/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixgetelement/nominal.hlsl @@ -15,7 +15,7 @@ void main() { // CHECK2: call void @"dx.hl.op..void (i32, i32*, %dx.types.LinAlgMatrixC4M5N4U1S2, i32)" // CHECK2-SAME: (i32 404, i32* %elem1, %dx.types.LinAlgMatrixC4M5N4U1S2 %{{.*}}, i32 0) uint elem1; - __builtin_LinAlg_FillMatrix(mat, 1); + __builtin_LinAlg_FillMatrix(mat, true, 1); __builtin_LinAlg_MatrixGetElement(elem1, mat, 0); // CHECK: call float @dx.op.linAlgMatrixGetElement.f32.mC4M5N4U1S2(i32 -2147483630, diff --git a/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixlength/nominal.hlsl b/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixlength/nominal.hlsl index a21539d412..30a9677e36 100644 --- a/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixlength/nominal.hlsl +++ b/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixlength/nominal.hlsl @@ -12,6 +12,6 @@ void main() { // CHECK2: call i32 @"dx.hl.op..i32 (i32, %dx.types.LinAlgMatrixC4M5N4U1S2)" // CHECK2-SAME: (i32 405, %dx.types.LinAlgMatrixC4M5N4U1S2 %{{.*}}) __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(4, 5, 4, 1, 2)]] mat; - __builtin_LinAlg_FillMatrix(mat, 1); + __builtin_LinAlg_FillMatrix(mat, true, 1); uint len = __builtin_LinAlg_MatrixLength(mat); } diff --git a/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixmatrixmultiply/nominal.hlsl b/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixmatrixmultiply/nominal.hlsl index 6c425d8938..39ddf725a9 100644 --- a/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixmatrixmultiply/nominal.hlsl +++ b/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixmatrixmultiply/nominal.hlsl @@ -13,8 +13,8 @@ void main() { // Matrix __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(4, 8, 8, 2, 2)]] matC; - __builtin_LinAlg_FillMatrix(matA, 1); - __builtin_LinAlg_FillMatrix(matB, 2); + __builtin_LinAlg_FillMatrix(matA, true, 1); + __builtin_LinAlg_FillMatrix(matB, true, 2); // CHECK: call %dx.types.LinAlgMatrixC4M8N8U2S2 @dx.op.linAlgMatrixMultiply.mC4M8N8U2S2.mC4M8N4U0S2.mC4M4N8U1S2(i32 -2147483625, // CHECK-SAME: %dx.types.LinAlgMatrixC4M8N4U0S2 %{{.*}}, %dx.types.LinAlgMatrixC4M4N8U1S2 %{{.*}}) ; LinAlgMatrixMultiply(matrixA,matrixB) diff --git a/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixmatrixmultiplyaccumulate/nominal.hlsl b/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixmatrixmultiplyaccumulate/nominal.hlsl index 1cb0602401..e2bc4dbe14 100644 --- a/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixmatrixmultiplyaccumulate/nominal.hlsl +++ b/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixmatrixmultiplyaccumulate/nominal.hlsl @@ -8,9 +8,9 @@ void main() { // The FillMatrix calls are similar enough that they start matching // the CHECK-SAME lines so we consume them first. - // CHECK: ; LinAlgFillMatrix(value) - // CHECK: ; LinAlgFillMatrix(value) - // CHECK: ; LinAlgFillMatrix(value) + // CHECK: ; LinAlgFillMatrix(isInputSigned,value) + // CHECK: ; LinAlgFillMatrix(isInputSigned,value) + // CHECK: ; LinAlgFillMatrix(isInputSigned,value) // Matrix __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(4, 8, 4, 0, 2)]] matA; @@ -21,9 +21,9 @@ void main() { // Matrix __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(4, 8, 8, 2, 2)]] matR; - __builtin_LinAlg_FillMatrix(matA, 1); - __builtin_LinAlg_FillMatrix(matB, 2); - __builtin_LinAlg_FillMatrix(matC, 3); + __builtin_LinAlg_FillMatrix(matA, true, 1); + __builtin_LinAlg_FillMatrix(matB, true, 2); + __builtin_LinAlg_FillMatrix(matC, true, 3); // CHECK: call %dx.types.LinAlgMatrixC4M8N8U2S2 // CHECK-SAME: @dx.op.linAlgMatrixMultiplyAccumulate.mC4M8N8U2S2.mC4M8N4U0S2.mC4M4N8U1S2.mC4M8N8U2S2 diff --git a/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixouterproduct/nominal.hlsl b/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixouterproduct/nominal.hlsl index fa4a8530f7..6f6006a69e 100644 --- a/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixouterproduct/nominal.hlsl +++ b/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixouterproduct/nominal.hlsl @@ -10,35 +10,35 @@ void main() { float4 rhs1 = {4,3,2,1}; // CHECK: call %dx.types.LinAlgMatrixC9M4N4U2S0 @dx.op.linAlgMatrixOuterProduct.mC9M4N4U2S0.v4f32.v4f32 - // CHECK-SAME: (i32 -2147483619, <4 x float> {{.*}}, <4 x float> {{.*}}) ; LinAlgMatrixOuterProduct(vectorA,vectorB) + // CHECK-SAME: (i32 -2147483619, i1 true, <4 x float> {{.*}}, <4 x float> {{.*}}) ; LinAlgMatrixOuterProduct(isInputSigned,vectorA,vectorB) - // CHECK2: call void @"dx.hl.op..void (i32, %dx.types.LinAlgMatrixC9M4N4U2S0*, <4 x float>, <4 x float>)" - // CHECK2: (i32 417, %dx.types.LinAlgMatrixC9M4N4U2S0* {{.*}}, <4 x float> {{.*}}, <4 x float> {{.*}}) + // CHECK2: call void @"dx.hl.op..void (i32, %dx.types.LinAlgMatrixC9M4N4U2S0*, i1, <4 x float>, <4 x float>)" + // CHECK2: (i32 417, %dx.types.LinAlgMatrixC9M4N4U2S0* {{.*}}, i1 true, <4 x float> {{.*}}, <4 x float> {{.*}}) // Matrix __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(9, 4, 4, 2, 0)]] mat1; - __builtin_LinAlg_MatrixOuterProduct(mat1, lhs1, rhs1); + __builtin_LinAlg_MatrixOuterProduct(mat1, true, lhs1, rhs1); double4 lhs2 = {1,2,3,4}; double4 rhs2 = {4,3,2,1}; // CHECK: call %dx.types.LinAlgMatrixC10M4N4U2S0 @dx.op.linAlgMatrixOuterProduct.mC10M4N4U2S0.v4f64.v4f64 - // CHECK-SAME: (i32 -2147483619, <4 x double> {{.*}}, <4 x double> {{.*}}) ; LinAlgMatrixOuterProduct(vectorA,vectorB) + // CHECK-SAME: (i32 -2147483619, i1 true, <4 x double> {{.*}}, <4 x double> {{.*}}) ; LinAlgMatrixOuterProduct(isInputSigned,vectorA,vectorB) - // CHECK2: call void @"dx.hl.op..void (i32, %dx.types.LinAlgMatrixC10M4N4U2S0*, <4 x double>, <4 x double>)" - // CHECK2: (i32 417, %dx.types.LinAlgMatrixC10M4N4U2S0* {{.*}}, <4 x double> {{.*}}, <4 x double> {{.*}}) + // CHECK2: call void @"dx.hl.op..void (i32, %dx.types.LinAlgMatrixC10M4N4U2S0*, i1, <4 x double>, <4 x double>)" + // CHECK2: (i32 417, %dx.types.LinAlgMatrixC10M4N4U2S0* {{.*}}, i1 true, <4 x double> {{.*}}, <4 x double> {{.*}}) // Matrix __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(10, 4, 4, 2, 0)]] mat2; - __builtin_LinAlg_MatrixOuterProduct(mat2, lhs2, rhs2); + __builtin_LinAlg_MatrixOuterProduct(mat2, true, lhs2, rhs2); vector lhs3 = {1,2,3,4}; vector rhs3 = {4,3,2,1}; // CHECK: call %dx.types.LinAlgMatrixC6M4N4U2S0 @dx.op.linAlgMatrixOuterProduct.mC6M4N4U2S0.v4i64.v4i64 - // CHECK-SAME: (i32 -2147483619, <4 x i64> {{.*}}, <4 x i64> {{.*}}) ; LinAlgMatrixOuterProduct(vectorA,vectorB) + // CHECK-SAME: (i32 -2147483619, i1 true, <4 x i64> {{.*}}, <4 x i64> {{.*}}) ; LinAlgMatrixOuterProduct(isInputSigned,vectorA,vectorB) - // CHECK2: call void @"dx.hl.op..void (i32, %dx.types.LinAlgMatrixC6M4N4U2S0*, <4 x i64>, <4 x i64>)" - // CHECK2: (i32 417, %dx.types.LinAlgMatrixC6M4N4U2S0* {{.*}}, <4 x i64> {{.*}}, <4 x i64> {{.*}}) + // CHECK2: call void @"dx.hl.op..void (i32, %dx.types.LinAlgMatrixC6M4N4U2S0*, i1, <4 x i64>, <4 x i64>)" + // CHECK2: (i32 417, %dx.types.LinAlgMatrixC6M4N4U2S0* {{.*}}, i1 true, <4 x i64> {{.*}}, <4 x i64> {{.*}}) // Matrix __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(6, 4, 4, 2, 0)]] mat3; - __builtin_LinAlg_MatrixOuterProduct(mat3, lhs3, rhs3); + __builtin_LinAlg_MatrixOuterProduct(mat3, true, lhs3, rhs3); } diff --git a/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixsetelement/nominal.hlsl b/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixsetelement/nominal.hlsl index 952096af29..dbdf07ff9a 100644 --- a/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixsetelement/nominal.hlsl +++ b/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixsetelement/nominal.hlsl @@ -17,7 +17,7 @@ void main() { // CHECK2-SAME: "(i32 408, %dx.types.LinAlgMatrixC4M5N4U1S2* %{{.*}}, %dx.types.LinAlgMatrixC4M5N4U1S2 %{{.*}}, i32 1, i32 5) __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(4, 5, 4, 1, 2)]] mat1; - __builtin_LinAlg_FillMatrix(mat1, 1); + __builtin_LinAlg_FillMatrix(mat1, true, 1); __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(4, 5, 4, 1, 2)]] mat2; __builtin_LinAlg_MatrixSetElement(mat2, mat1, 1, 5); diff --git a/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixstoretodescriptor/nominal.hlsl b/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixstoretodescriptor/nominal.hlsl index b47de72a0b..b06969d3bc 100644 --- a/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixstoretodescriptor/nominal.hlsl +++ b/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixstoretodescriptor/nominal.hlsl @@ -15,6 +15,6 @@ void main() { // CHECK2: call void @"dx.hl.op..void (i32, %dx.types.LinAlgMatrixC4M5N4U1S2, %dx.types.Handle, i32, i32, i32, i32) // CHECK2-SAME: "(i32 409, %dx.types.LinAlgMatrixC4M5N4U1S2 %{{.*}}, %dx.types.Handle {{.*}}, i32 1, i32 1, i32 0, i32 256) __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(4, 5, 4, 1, 2)]] mat; - __builtin_LinAlg_FillMatrix(mat, 1); + __builtin_LinAlg_FillMatrix(mat, true, 1); __builtin_LinAlg_MatrixStoreToDescriptor(mat, outbuf, 1, 1, 0, 256); } diff --git a/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixstoretomemory/nominal.hlsl b/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixstoretomemory/nominal.hlsl index aecf41edde..fde181121c 100644 --- a/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixstoretomemory/nominal.hlsl +++ b/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixstoretomemory/nominal.hlsl @@ -18,6 +18,6 @@ void main() { // CHECK2-SAME: (i32 410, %dx.types.LinAlgMatrixC9M5N4U1S2 %{{.*}}, [64 x float] addrspace(3)* @"\01?SharedArr@@3PAMA", // CHECK2-SAME: i32 896, i32 48, i32 3) __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(9, 5, 4, 1, 2)]] mat; - __builtin_LinAlg_FillMatrix(mat, 1); + __builtin_LinAlg_FillMatrix(mat, true, 1); __builtin_LinAlg_MatrixStoreToMemory(mat, SharedArr, 128 * 7, 16 * 3, 3); } diff --git a/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixstoretomemory/vector-array.hlsl b/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixstoretomemory/vector-array.hlsl index 71017a21c0..38dbe3c9a1 100644 --- a/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixstoretomemory/vector-array.hlsl +++ b/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixstoretomemory/vector-array.hlsl @@ -23,6 +23,6 @@ void main() { // CHECK2-SAME: i32, i32, i32)"(i32 410, %dx.types.LinAlgMatrixC9M5N4U1S2 %{{.*}}, [64 x <4 x float>] addrspace(3)* // CHECK2-SAME: @"\01?SharedArr@@3PAV?$vector@M$03@@A", i32 128, i32 16, i32 3) __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(9, 5, 4, 1, 2)]] mat; - __builtin_LinAlg_FillMatrix(mat, 1); + __builtin_LinAlg_FillMatrix(mat, true, 1); __builtin_LinAlg_MatrixStoreToMemory(mat, SharedArr, 128, 16, 3); } diff --git a/tools/clang/test/CodeGenDXIL/hlsl/linalg/matrix-target-type-in-struct.hlsl b/tools/clang/test/CodeGenDXIL/hlsl/linalg/matrix-target-type-in-struct.hlsl index a48c56f013..f0c520fb44 100644 --- a/tools/clang/test/CodeGenDXIL/hlsl/linalg/matrix-target-type-in-struct.hlsl +++ b/tools/clang/test/CodeGenDXIL/hlsl/linalg/matrix-target-type-in-struct.hlsl @@ -8,7 +8,7 @@ class MyMatrix { static MyMatrix Splat(float Val) { MyMatrix Result; - __builtin_LinAlg_FillMatrix(Result.handle, Val); + __builtin_LinAlg_FillMatrix(Result.handle, true, Val); return Result; } }; @@ -18,5 +18,5 @@ void main() { MyMatrix MatA = MyMatrix::Splat(1.0f); } -// CHECK: call %dx.types.LinAlgMatrixC9M4N4U0S1 @dx.op.linAlgFillMatrix.mC9M4N4U0S1.f32(i32 -2147483636, float 1.000000e+00) ; LinAlgFillMatrix(value) +// CHECK: call %dx.types.LinAlgMatrixC9M4N4U0S1 @dx.op.linAlgFillMatrix.mC9M4N4U0S1.f32(i32 -2147483636, i1 true, float 1.000000e+00) ; LinAlgFillMatrix(isInputSigned,value) // CHECK-NOT: @llvm.trap() diff --git a/tools/clang/test/CodeGenDXIL/hlsl/linalg/trim-target-types-metadata-compute.hlsl b/tools/clang/test/CodeGenDXIL/hlsl/linalg/trim-target-types-metadata-compute.hlsl index fa883c458e..2d4ad24cc1 100644 --- a/tools/clang/test/CodeGenDXIL/hlsl/linalg/trim-target-types-metadata-compute.hlsl +++ b/tools/clang/test/CodeGenDXIL/hlsl/linalg/trim-target-types-metadata-compute.hlsl @@ -11,12 +11,12 @@ uint useMatrix1() { // Matrix m; __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(4, 4, 5, 0, 2)]] mat1; // mat1 = Matrix::Splat(5); - __builtin_LinAlg_FillMatrix(mat1, 5); + __builtin_LinAlg_FillMatrix(mat1, true, 5); // Matrix m; __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(5, 8, 8, 0, 2)]] mat2; // mat2 = Matrix::Splat(1); - __builtin_LinAlg_FillMatrix(mat2, 1); + __builtin_LinAlg_FillMatrix(mat2, true, 1); // return mat2.Length(); return __builtin_LinAlg_MatrixLength(mat2); } @@ -25,7 +25,7 @@ uint useMatrix2() { // Matrix m; __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(10, 2, 2, 1, 1)]] mat3; // mat3 = Matrix::Splat(5); - __builtin_LinAlg_FillMatrix(mat3, 5); + __builtin_LinAlg_FillMatrix(mat3, true, 5); // return mat3.Length(); return __builtin_LinAlg_MatrixLength(mat3); } diff --git a/tools/clang/test/CodeGenDXIL/hlsl/linalg/trim-target-types-metadata-lib.hlsl b/tools/clang/test/CodeGenDXIL/hlsl/linalg/trim-target-types-metadata-lib.hlsl index 67a4361927..002ab8b874 100644 --- a/tools/clang/test/CodeGenDXIL/hlsl/linalg/trim-target-types-metadata-lib.hlsl +++ b/tools/clang/test/CodeGenDXIL/hlsl/linalg/trim-target-types-metadata-lib.hlsl @@ -24,7 +24,7 @@ uint useMatrix1() { // Matrix m; __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(4, 4, 5, 0, 2)]] mat1; // mat1 = Matrix::Splat(5); - __builtin_LinAlg_FillMatrix(mat1, 5); + __builtin_LinAlg_FillMatrix(mat1, true, 5); // return mat1.Length(); return __builtin_LinAlg_MatrixLength(mat1); } @@ -33,7 +33,7 @@ uint useMatrix2() { // Matrix m; __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(10, 4, 4, 1, 1)]] mat2; // Matrix::Splat(1) - __builtin_LinAlg_FillMatrix(mat2, 1); + __builtin_LinAlg_FillMatrix(mat2, true, 1); // return mat2.Length(); return __builtin_LinAlg_MatrixLength(mat2); } @@ -47,7 +47,7 @@ void useMatrix3() { //Matrix m; __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(5, 6, 6, 2, 2)]] mat3; // mat3 = Matrix::Splat(5); - __builtin_LinAlg_FillMatrix(mat3, 5); + __builtin_LinAlg_FillMatrix(mat3, true, 5); } RWBuffer Out; diff --git a/tools/clang/test/DXC/dumpPSV_LinAlgAccumulate.hlsl b/tools/clang/test/DXC/dumpPSV_LinAlgAccumulate.hlsl index 35b6980b84..f5a37a9a35 100644 --- a/tools/clang/test/DXC/dumpPSV_LinAlgAccumulate.hlsl +++ b/tools/clang/test/DXC/dumpPSV_LinAlgAccumulate.hlsl @@ -18,6 +18,9 @@ using ThreadFloatAccumulator = Matrix; +using ThreadUIntAccumulator = Matrix; using WaveHalfAccumulator = Matrix; using WaveFloatAccumulator = Matrix((int4)5, (int4)6); IntOuter.InterlockedAccumulate(Output, 128); + ThreadUIntAccumulator UIntOuter = + OuterProduct((uint4)7, (uint4)8); + UIntOuter.InterlockedAccumulate(Output, 192); + WaveHalfAccumulator WaveHalf = WaveHalfAccumulator::Splat(7.0h); - WaveHalf.InterlockedAccumulate(Output, 192, 4, MatrixLayout::RowMajor); + WaveHalf.InterlockedAccumulate(Output, 256, 4, MatrixLayout::RowMajor); WaveHalf.InterlockedAccumulate(SharedHalf, 0, 8, MatrixLayout::RowMajor); WaveFloatAccumulator WaveFloat = WaveFloatAccumulator::Splat(8.0f); WaveFloat.InterlockedAccumulate(SharedFloat, 0, 4, MatrixLayout::RowMajor); - InterlockedAccumulate(Output, 256, (vector)Index); + InterlockedAccumulate(Output, 320, (vector)Index); } // CHECK: LinAlgRuntimeInfoPresent: true @@ -56,14 +63,16 @@ void main(uint Index : SV_GroupIndex) { // CHECK-NEXT: ThreadMatrixVectorMultiplyCount: 0 // CHECK-NEXT: WaveMatrixMultiplyCount: 0 // CHECK-NEXT: ThreadGroupMatrixMultiplyCount: 0 -// CHECK-NEXT: OuterProductCount: 3 -// CHECK-NEXT: AccumulateStoreCount: 4 +// CHECK-NEXT: OuterProductCount: 4 +// CHECK-NEXT: AccumulateStoreCount: 5 // CHECK-NEXT: MatrixConstruction[0]: MatrixType=8, Shapes=[(2,2,0)] // CHECK-NEXT: MatrixConstruction[1]: MatrixType=9, Shapes=[(2,2,0)] // CHECK-NEXT: OuterProduct[0]: ResultType=8, VectorInputType=8 // CHECK-NEXT: OuterProduct[1]: ResultType=9, VectorInputType=8 // CHECK-NEXT: OuterProduct[2]: ResultType=4, VectorInputType=4 +// CHECK-NEXT: OuterProduct[3]: ResultType=5, VectorInputType=5 // CHECK-NEXT: AccumulateStore[0]: AccumulatorType=8, Flags=3 // CHECK-NEXT: AccumulateStore[1]: AccumulatorType=9, Flags=3 // CHECK-NEXT: AccumulateStore[2]: AccumulatorType=4, Flags=1 -// CHECK-NEXT: AccumulateStore[3]: AccumulatorType=6, Flags=1 +// CHECK-NEXT: AccumulateStore[3]: AccumulatorType=5, Flags=1 +// CHECK-NEXT: AccumulateStore[4]: AccumulatorType=6, Flags=1 diff --git a/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-copyconvert.ll b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-copyconvert.ll index 6c97599c32..fc13944694 100644 --- a/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-copyconvert.ll +++ b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-copyconvert.ll @@ -18,7 +18,7 @@ define void @main() { %h1 = call %dx.types.Handle @dx.op.createHandleFromBinding(i32 217, %dx.types.ResBind zeroinitializer, i32 0, i1 false) ; CreateHandleFromBinding(bind,index,nonUniformIndex) %bab = call %dx.types.Handle @dx.op.annotateHandle(i32 216, %dx.types.Handle %h1, %dx.types.ResourceProperties { i32 11, i32 0 }) ; AnnotateHandle(res,props) resource: ByteAddressBuffer - %1 = call %dx.types.LinAlgMatrixC2M5N4U1S2 @dx.op.linAlgFillMatrix.mC2M5N4U1S2.i32(i32 -2147483636, i32 1) ; LinAlgFillMatrix(value) + %1 = call %dx.types.LinAlgMatrixC2M5N4U1S2 @dx.op.linAlgFillMatrix.mC2M5N4U1S2.i32(i32 -2147483636, i1 true, i32 1) ; LinAlgFillMatrix(isInputSigned,value) ; CHECK: Function: main: error: Destination matrix dimension '8x4' must match source matrix dimension '5x4'. ; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgCopyConvertMatrix.mC4M8N4U1S2.mC2M5N4U1S2 @@ -49,7 +49,7 @@ define void @main() { } ; Function Attrs: nounwind -declare %dx.types.LinAlgMatrixC2M5N4U1S2 @dx.op.linAlgFillMatrix.mC2M5N4U1S2.i32(i32, i32) #0 +declare %dx.types.LinAlgMatrixC2M5N4U1S2 @dx.op.linAlgFillMatrix.mC2M5N4U1S2.i32(i32, i1, i32) #0 ; Function Attrs: nounwind declare %dx.types.LinAlgMatrixC4M8N4U1S2 @dx.op.linAlgCopyConvertMatrix.mC4M8N4U1S2.mC2M5N4U1S2(i32, %dx.types.LinAlgMatrixC2M5N4U1S2, i1) #0 diff --git a/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-groupshared-vector-memory-invalid.ll b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-groupshared-vector-memory-invalid.ll index bfcb1dd8fc..462d8d24db 100644 --- a/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-groupshared-vector-memory-invalid.ll +++ b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-groupshared-vector-memory-invalid.ll @@ -23,7 +23,7 @@ target triple = "dxil-ms-dx" define void @main() { %1 = call %dx.types.LinAlgMatrixC9M4N4U1S1 @dx.op.linAlgMatrixLoadFromMemory.mC9M4N4U1S1.v4i8(i32 -2147483633, <4 x i8> addrspace(3)* getelementptr inbounds ([64 x <4 x i8>], [64 x <4 x i8>] addrspace(3)* @"\01?SharedVecArr@@3PAV?$vector@M$03@@A", i32 0, i32 0), i32 0, i32 16, i32 1) ; LinAlgMatrixLoadFromMemory(memory,offset,stride,layout) call void @dx.op.linAlgMatrixStoreToMemory.mC9M4N4U1S1.v4i8(i32 -2147483627, %dx.types.LinAlgMatrixC9M4N4U1S1 %1, <4 x i8> addrspace(3)* getelementptr inbounds ([64 x <4 x i8>], [64 x <4 x i8>] addrspace(3)* @"\01?SharedVecArr@@3PAV?$vector@M$03@@A", i32 0, i32 0), i32 0, i32 16, i32 1) ; LinAlgMatrixStoreToMemory(matrix,memory,offset,stride,layout) - %2 = call %dx.types.LinAlgMatrixC9M4N4U2S1 @dx.op.linAlgFillMatrix.mC9M4N4U2S1.i32(i32 -2147483636, i32 0) ; LinAlgFillMatrix(value) + %2 = call %dx.types.LinAlgMatrixC9M4N4U2S1 @dx.op.linAlgFillMatrix.mC9M4N4U2S1.i32(i32 -2147483636, i1 true, i32 0) ; LinAlgFillMatrix(isInputSigned,value) call void @dx.op.linAlgMatrixAccumulateToMemory.mC9M4N4U2S1.v4i8(i32 -2147483620, %dx.types.LinAlgMatrixC9M4N4U2S1 %2, <4 x i8> addrspace(3)* getelementptr inbounds ([64 x <4 x i8>], [64 x <4 x i8>] addrspace(3)* @"\01?SharedVecArr@@3PAV?$vector@M$03@@A", i32 0, i32 0), i32 0, i32 16, i32 1) ; LinAlgMatrixAccumulateToMemory(matrix,memory,offset,stride,layout) ret void } @@ -35,7 +35,7 @@ declare %dx.types.LinAlgMatrixC9M4N4U1S1 @dx.op.linAlgMatrixLoadFromMemory.mC9M4 declare void @dx.op.linAlgMatrixStoreToMemory.mC9M4N4U1S1.v4i8(i32, %dx.types.LinAlgMatrixC9M4N4U1S1, <4 x i8> addrspace(3)*, i32, i32, i32) #0 ; Function Attrs: nounwind -declare %dx.types.LinAlgMatrixC9M4N4U2S1 @dx.op.linAlgFillMatrix.mC9M4N4U2S1.i32(i32, i32) #0 +declare %dx.types.LinAlgMatrixC9M4N4U2S1 @dx.op.linAlgFillMatrix.mC9M4N4U2S1.i32(i32, i1, i32) #0 ; Function Attrs: nounwind declare void @dx.op.linAlgMatrixAccumulateToMemory.mC9M4N4U2S1.v4i8(i32, %dx.types.LinAlgMatrixC9M4N4U2S1, <4 x i8> addrspace(3)*, i32, i32, i32) #0 diff --git a/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-groupshared-vector-memory.ll b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-groupshared-vector-memory.ll index 67896e4fce..2c7a7997a4 100644 --- a/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-groupshared-vector-memory.ll +++ b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-groupshared-vector-memory.ll @@ -17,7 +17,7 @@ target triple = "dxil-ms-dx" define void @main() { %1 = call %dx.types.LinAlgMatrixC9M4N4U1S1 @dx.op.linAlgMatrixLoadFromMemory.mC9M4N4U1S1.v4f32(i32 -2147483633, <4 x float> addrspace(3)* getelementptr inbounds ([64 x <4 x float>], [64 x <4 x float>] addrspace(3)* @"\01?SharedVecArr@@3PAV?$vector@M$03@@A", i32 0, i32 0), i32 0, i32 16, i32 1) ; LinAlgMatrixLoadFromMemory(memory,offset,stride,layout) call void @dx.op.linAlgMatrixStoreToMemory.mC9M4N4U1S1.v4f32(i32 -2147483627, %dx.types.LinAlgMatrixC9M4N4U1S1 %1, <4 x float> addrspace(3)* getelementptr inbounds ([64 x <4 x float>], [64 x <4 x float>] addrspace(3)* @"\01?SharedVecArr@@3PAV?$vector@M$03@@A", i32 0, i32 0), i32 0, i32 16, i32 1) ; LinAlgMatrixStoreToMemory(matrix,memory,offset,stride,layout) - %2 = call %dx.types.LinAlgMatrixC9M4N4U2S1 @dx.op.linAlgFillMatrix.mC9M4N4U2S1.i32(i32 -2147483636, i32 0) ; LinAlgFillMatrix(value) + %2 = call %dx.types.LinAlgMatrixC9M4N4U2S1 @dx.op.linAlgFillMatrix.mC9M4N4U2S1.i32(i32 -2147483636, i1 true, i32 0) ; LinAlgFillMatrix(isInputSigned,value) call void @dx.op.linAlgMatrixAccumulateToMemory.mC9M4N4U2S1.v4f32(i32 -2147483620, %dx.types.LinAlgMatrixC9M4N4U2S1 %2, <4 x float> addrspace(3)* getelementptr inbounds ([64 x <4 x float>], [64 x <4 x float>] addrspace(3)* @"\01?SharedVecArr@@3PAV?$vector@M$03@@A", i32 0, i32 0), i32 0, i32 16, i32 1) ; LinAlgMatrixAccumulateToMemory(matrix,memory,offset,stride,layout) ret void } @@ -29,7 +29,7 @@ declare %dx.types.LinAlgMatrixC9M4N4U1S1 @dx.op.linAlgMatrixLoadFromMemory.mC9M4 declare void @dx.op.linAlgMatrixStoreToMemory.mC9M4N4U1S1.v4f32(i32, %dx.types.LinAlgMatrixC9M4N4U1S1, <4 x float> addrspace(3)*, i32, i32, i32) #0 ; Function Attrs: nounwind -declare %dx.types.LinAlgMatrixC9M4N4U2S1 @dx.op.linAlgFillMatrix.mC9M4N4U2S1.i32(i32, i32) #0 +declare %dx.types.LinAlgMatrixC9M4N4U2S1 @dx.op.linAlgFillMatrix.mC9M4N4U2S1.i32(i32, i1, i32) #0 ; Function Attrs: nounwind declare void @dx.op.linAlgMatrixAccumulateToMemory.mC9M4N4U2S1.v4f32(i32, %dx.types.LinAlgMatrixC9M4N4U2S1, <4 x float> addrspace(3)*, i32, i32, i32) #0 diff --git a/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-matrixaccumulate.ll b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-matrixaccumulate.ll index 14a13b9c97..4025cd50db 100644 --- a/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-matrixaccumulate.ll +++ b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-matrixaccumulate.ll @@ -11,12 +11,12 @@ target triple = "dxil-ms-dx" %dx.types.LinAlgMatrixC8M8N8U0S2 = type { i8* } define void @main() { - %1 = call %dx.types.LinAlgMatrixC8M4N4U2S2 @dx.op.linAlgFillMatrix.mC8M4N4U2S2.i32(i32 -2147483636, i32 1) ; LinAlgFillMatrix(value) - %2 = call %dx.types.LinAlgMatrixC8M4N4U0S2 @dx.op.linAlgFillMatrix.mC8M4N4U0S2.i32(i32 -2147483636, i32 2) ; LinAlgFillMatrix(value) - %3 = call %dx.types.LinAlgMatrixC8M4N4U2S0 @dx.op.linAlgFillMatrix.mC8M4N4U2S0.i32(i32 -2147483636, i32 4) ; LinAlgFillMatrix(value) - %4 = call %dx.types.LinAlgMatrixC8M4N4U1S0 @dx.op.linAlgFillMatrix.mC8M4N4U1S0.i32(i32 -2147483636, i32 5) ; LinAlgFillMatrix(value) - %5 = call %dx.types.LinAlgMatrixC8M4N4U1S1 @dx.op.linAlgFillMatrix.mC8M4N4U1S1.i32(i32 -2147483636, i32 6) ; LinAlgFillMatrix(value) - %6 = call %dx.types.LinAlgMatrixC8M8N8U0S2 @dx.op.linAlgFillMatrix.mC8M8N8U0S2.i32(i32 -2147483636, i32 7) ; LinAlgFillMatrix(value) + %1 = call %dx.types.LinAlgMatrixC8M4N4U2S2 @dx.op.linAlgFillMatrix.mC8M4N4U2S2.i32(i32 -2147483636, i1 true, i32 1) ; LinAlgFillMatrix(isInputSigned,value) + %2 = call %dx.types.LinAlgMatrixC8M4N4U0S2 @dx.op.linAlgFillMatrix.mC8M4N4U0S2.i32(i32 -2147483636, i1 true, i32 2) ; LinAlgFillMatrix(isInputSigned,value) + %3 = call %dx.types.LinAlgMatrixC8M4N4U2S0 @dx.op.linAlgFillMatrix.mC8M4N4U2S0.i32(i32 -2147483636, i1 true, i32 4) ; LinAlgFillMatrix(isInputSigned,value) + %4 = call %dx.types.LinAlgMatrixC8M4N4U1S0 @dx.op.linAlgFillMatrix.mC8M4N4U1S0.i32(i32 -2147483636, i1 true, i32 5) ; LinAlgFillMatrix(isInputSigned,value) + %5 = call %dx.types.LinAlgMatrixC8M4N4U1S1 @dx.op.linAlgFillMatrix.mC8M4N4U1S1.i32(i32 -2147483636, i1 true, i32 6) ; LinAlgFillMatrix(isInputSigned,value) + %6 = call %dx.types.LinAlgMatrixC8M8N8U0S2 @dx.op.linAlgFillMatrix.mC8M8N8U0S2.i32(i32 -2147483636, i1 true, i32 7) ; LinAlgFillMatrix(isInputSigned,value) ; CHECK: Function: main: error: Return matrix 'dx.types.LinAlgMatrixC8M4N4U2S2' must exactly match arg 1 matrix 'dx.types.LinAlgMatrixC8M4N4U0S2'. ; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixAccumulate.mC8M4N4U2S2.mC8M4N4U0S2.mC8M4N4U0S2 @@ -50,22 +50,22 @@ define void @main() { } ; Function Attrs: nounwind -declare %dx.types.LinAlgMatrixC8M4N4U2S2 @dx.op.linAlgFillMatrix.mC8M4N4U2S2.i32(i32, i32) #0 +declare %dx.types.LinAlgMatrixC8M4N4U2S2 @dx.op.linAlgFillMatrix.mC8M4N4U2S2.i32(i32, i1, i32) #0 ; Function Attrs: nounwind -declare %dx.types.LinAlgMatrixC8M4N4U0S2 @dx.op.linAlgFillMatrix.mC8M4N4U0S2.i32(i32, i32) #0 +declare %dx.types.LinAlgMatrixC8M4N4U0S2 @dx.op.linAlgFillMatrix.mC8M4N4U0S2.i32(i32, i1, i32) #0 ; Function Attrs: nounwind -declare %dx.types.LinAlgMatrixC8M4N4U2S0 @dx.op.linAlgFillMatrix.mC8M4N4U2S0.i32(i32, i32) #0 +declare %dx.types.LinAlgMatrixC8M4N4U2S0 @dx.op.linAlgFillMatrix.mC8M4N4U2S0.i32(i32, i1, i32) #0 ; Function Attrs: nounwind -declare %dx.types.LinAlgMatrixC8M4N4U1S0 @dx.op.linAlgFillMatrix.mC8M4N4U1S0.i32(i32, i32) #0 +declare %dx.types.LinAlgMatrixC8M4N4U1S0 @dx.op.linAlgFillMatrix.mC8M4N4U1S0.i32(i32, i1, i32) #0 ; Function Attrs: nounwind -declare %dx.types.LinAlgMatrixC8M4N4U1S1 @dx.op.linAlgFillMatrix.mC8M4N4U1S1.i32(i32, i32) #0 +declare %dx.types.LinAlgMatrixC8M4N4U1S1 @dx.op.linAlgFillMatrix.mC8M4N4U1S1.i32(i32, i1, i32) #0 ; Function Attrs: nounwind -declare %dx.types.LinAlgMatrixC8M8N8U0S2 @dx.op.linAlgFillMatrix.mC8M8N8U0S2.i32(i32, i32) #0 +declare %dx.types.LinAlgMatrixC8M8N8U0S2 @dx.op.linAlgFillMatrix.mC8M8N8U0S2.i32(i32, i1, i32) #0 ; Function Attrs: nounwind declare %dx.types.LinAlgMatrixC8M4N4U2S2 @dx.op.linAlgMatrixAccumulate.mC8M4N4U2S2.mC8M4N4U0S2.mC8M4N4U0S2(i32, %dx.types.LinAlgMatrixC8M4N4U0S2, %dx.types.LinAlgMatrixC8M4N4U0S2) #0 diff --git a/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-no-bitcast1.ll b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-no-bitcast1.ll index 865899c663..166462bc77 100644 --- a/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-no-bitcast1.ll +++ b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-no-bitcast1.ll @@ -8,14 +8,14 @@ target triple = "dxil-ms-dx" %dx.types.LinAlgMatrixC4M4N5U1S2 = type { i8* } define void @main() { - %1 = call %dx.types.LinAlgMatrixC4M5N4U1S2 @dx.op.linAlgFillMatrix.mC4M5N4U1S2.i32(i32 -2147483636, i32 5) ; LinAlgFillMatrix(value) + %1 = call %dx.types.LinAlgMatrixC4M5N4U1S2 @dx.op.linAlgFillMatrix.mC4M5N4U1S2.i32(i32 -2147483636, i1 true, i32 5) ; LinAlgFillMatrix(isInputSigned,value) %2 = bitcast %dx.types.LinAlgMatrixC4M5N4U1S2 %1 to %dx.types.LinAlgMatrixC4M4N5U1S2 ; CHECK: shader: invalid cast opcode for cast from '%dx.types.LinAlgMatrixC4M5N4U1S2 = type { i8* }' to '%dx.types.LinAlgMatrixC4M4N5U1S2 = type { i8* }' } ; Function Attrs: nounwind -declare %dx.types.LinAlgMatrixC4M5N4U1S2 @dx.op.linAlgFillMatrix.mC4M5N4U1S2.i32(i32, i32) #0 +declare %dx.types.LinAlgMatrixC4M5N4U1S2 @dx.op.linAlgFillMatrix.mC4M5N4U1S2.i32(i32, i1, i32) #0 attributes #0 = { nounwind } diff --git a/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-no-bitcast2.ll b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-no-bitcast2.ll index ffbd3227b7..f52561092d 100644 --- a/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-no-bitcast2.ll +++ b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-no-bitcast2.ll @@ -8,14 +8,14 @@ target triple = "dxil-ms-dx" %dx.types.LinAlgMatrixC4M4N5U1S2 = type { i8* } define void @main() { - %1 = call %dx.types.LinAlgMatrixC4M5N4U1S2 @dx.op.linAlgFillMatrix.mC4M5N4U1S2.i32(i32 -2147483636, i32 5) ; LinAlgFillMatrix(value) + %1 = call %dx.types.LinAlgMatrixC4M5N4U1S2 @dx.op.linAlgFillMatrix.mC4M5N4U1S2.i32(i32 -2147483636, i1 true, i32 5) ; LinAlgFillMatrix(isInputSigned,value) %2 = bitcast %dx.types.LinAlgMatrixC4M5N4U1S2 %1 to i32 ret void ; CHECK: shader: invalid cast opcode for cast from '%dx.types.LinAlgMatrixC4M5N4U1S2 = type { i8* }' to 'i32' } ; Function Attrs: nounwind -declare %dx.types.LinAlgMatrixC4M5N4U1S2 @dx.op.linAlgFillMatrix.mC4M5N4U1S2.i32(i32, i32) #0 +declare %dx.types.LinAlgMatrixC4M5N4U1S2 @dx.op.linAlgFillMatrix.mC4M5N4U1S2.i32(i32, i1, i32) #0 attributes #0 = { nounwind } diff --git a/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-no-bitcast3.ll b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-no-bitcast3.ll index 9db0c8ebc9..3c8c77e33a 100644 --- a/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-no-bitcast3.ll +++ b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-no-bitcast3.ll @@ -14,7 +14,7 @@ define void @main() { } ; Function Attrs: nounwind -declare %dx.types.LinAlgMatrixC4M5N4U1S2 @dx.op.linAlgFillMatrix.mC4M5N4U1S2.i32(i32, i32) #0 +declare %dx.types.LinAlgMatrixC4M5N4U1S2 @dx.op.linAlgFillMatrix.mC4M5N4U1S2.i32(i32, i1, i32) #0 attributes #0 = { nounwind } diff --git a/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-non-thread-ops.ll b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-non-thread-ops.ll index 952080c89d..5271f06f1a 100644 --- a/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-non-thread-ops.ll +++ b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-non-thread-ops.ll @@ -9,7 +9,13 @@ target triple = "dxil-ms-dx" define void @main() { ; CHECK: Function: main: error: Return matrix scope 'Thread' does not match expected scope Wave or ThreadGroup. ; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgFillMatrix.mC8M4N4U2S0.i32 - %1 = call %dx.types.LinAlgMatrixC8M4N4U2S0 @dx.op.linAlgFillMatrix.mC8M4N4U2S0.i32(i32 -2147483636, i32 1) ; LinAlgFillMatrix(value) + %1 = call %dx.types.LinAlgMatrixC8M4N4U2S0 @dx.op.linAlgFillMatrix.mC8M4N4U2S0.i32(i32 -2147483636, i1 true, i32 1) ; LinAlgFillMatrix(isInputSigned,value) + + ; CHECK-NEXT: Function: main: error: Float-like type 'float' must be signed + ; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgFillMatrix.mC8M4N4U2S0.f32 + ; CHECK-NEXT: Function: main: error: Return matrix scope 'Thread' does not match expected scope Wave or ThreadGroup. + ; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgFillMatrix.mC8M4N4U2S0.f32 + %badSigned = call %dx.types.LinAlgMatrixC8M4N4U2S0 @dx.op.linAlgFillMatrix.mC8M4N4U2S0.f32(i32 -2147483636, i1 false, float 1.0) ; LinAlgFillMatrix(isInputSigned,value) ; CHECK-NEXT: Function: main: error: Input matrix scope 'Thread' does not match expected scope Wave or ThreadGroup. ; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixGetElement.f32.mC8M4N4U2S0 @@ -34,7 +40,10 @@ define void @main() { } ; Function Attrs: nounwind -declare %dx.types.LinAlgMatrixC8M4N4U2S0 @dx.op.linAlgFillMatrix.mC8M4N4U2S0.i32(i32, i32) #0 +declare %dx.types.LinAlgMatrixC8M4N4U2S0 @dx.op.linAlgFillMatrix.mC8M4N4U2S0.i32(i32, i1, i32) #0 + +; Function Attrs: nounwind +declare %dx.types.LinAlgMatrixC8M4N4U2S0 @dx.op.linAlgFillMatrix.mC8M4N4U2S0.f32(i32, i1, float) #0 ; Function Attrs: nounwind declare float @dx.op.linAlgMatrixGetElement.f32.mC8M4N4U2S0(i32, %dx.types.LinAlgMatrixC8M4N4U2S0, i32) #0 diff --git a/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-outerproduct.ll b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-outerproduct.ll index 61fcfe36cc..6f730619bd 100644 --- a/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-outerproduct.ll +++ b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-outerproduct.ll @@ -12,61 +12,65 @@ target triple = "dxil-ms-dx" define void @main() { ; okay - %1 = call %dx.types.LinAlgMatrixC8M8N8U2S0 @dx.op.linAlgMatrixOuterProduct.mC8M8N8U2S0.v8f16.v8f16(i32 -2147483619, <8 x half> , <8 x half> ) ; LinAlgMatrixOuterProduct(vectorA,vectorB) + %1 = call %dx.types.LinAlgMatrixC8M8N8U2S0 @dx.op.linAlgMatrixOuterProduct.mC8M8N8U2S0.v8f16.v8f16(i32 -2147483619, i1 true, <8 x half> , <8 x half> ) ; LinAlgMatrixOuterProduct(isInputSigned,vectorA,vectorB) ; okay - %2 = call %dx.types.LinAlgMatrixC21M8N8U2S0 @dx.op.linAlgMatrixOuterProduct.mC21M8N8U2S0.v8f16.v8f16(i32 -2147483619, <8 x half> , <8 x half> ) ; LinAlgMatrixOuterProduct(vectorA,vectorB) + %2 = call %dx.types.LinAlgMatrixC21M8N8U2S0 @dx.op.linAlgMatrixOuterProduct.mC21M8N8U2S0.v8f16.v8f16(i32 -2147483619, i1 true, <8 x half> , <8 x half> ) ; LinAlgMatrixOuterProduct(isInputSigned,vectorA,vectorB) ; okay - %3 = call %dx.types.LinAlgMatrixC8M8N16U2S0 @dx.op.linAlgMatrixOuterProduct.mC8M8N16U2S0.v8f16.v16f16(i32 -2147483619, <8 x half> , <16 x half> ) ; LinAlgMatrixOuterProduct(vectorA,vectorB) + %3 = call %dx.types.LinAlgMatrixC8M8N16U2S0 @dx.op.linAlgMatrixOuterProduct.mC8M8N16U2S0.v8f16.v16f16(i32 -2147483619, i1 true, <8 x half> , <16 x half> ) ; LinAlgMatrixOuterProduct(isInputSigned,vectorA,vectorB) + + ; CHECK: Function: main: error: Float-like type 'half' must be signed + ; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixOuterProduct.mC8M8N8U2S0.v8f16.v8f16 + %badSigned = call %dx.types.LinAlgMatrixC8M8N8U2S0 @dx.op.linAlgMatrixOuterProduct.mC8M8N8U2S0.v8f16.v8f16(i32 -2147483619, i1 false, <8 x half> zeroinitializer, <8 x half> zeroinitializer) ; LinAlgMatrixOuterProduct(isInputSigned,vectorA,vectorB) ; CHECK: Function: main: error: Return matrix scope 'Wave' does not match expected scope Thread. ; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixOuterProduct.mC8M8N8U2S1.v8f16.v8f16 - %4 = call %dx.types.LinAlgMatrixC8M8N8U2S1 @dx.op.linAlgMatrixOuterProduct.mC8M8N8U2S1.v8f16.v8f16(i32 -2147483619, <8 x half> , <8 x half> ) ; LinAlgMatrixOuterProduct(vectorA,vectorB) + %4 = call %dx.types.LinAlgMatrixC8M8N8U2S1 @dx.op.linAlgMatrixOuterProduct.mC8M8N8U2S1.v8f16.v8f16(i32 -2147483619, i1 true, <8 x half> , <8 x half> ) ; LinAlgMatrixOuterProduct(isInputSigned,vectorA,vectorB) ; CHECK-NEXT: Function: main: error: Return matrix use 'B' does not match expected use Accumulator. ; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixOuterProduct.mC8M8N8U1S0.v8f16.v8f16 - %5 = call %dx.types.LinAlgMatrixC8M8N8U1S0 @dx.op.linAlgMatrixOuterProduct.mC8M8N8U1S0.v8f16.v8f16(i32 -2147483619, <8 x half> , <8 x half> ) ; LinAlgMatrixOuterProduct(vectorA,vectorB) + %5 = call %dx.types.LinAlgMatrixC8M8N8U1S0 @dx.op.linAlgMatrixOuterProduct.mC8M8N8U1S0.v8f16.v8f16(i32 -2147483619, i1 true, <8 x half> , <8 x half> ) ; LinAlgMatrixOuterProduct(isInputSigned,vectorA,vectorB) ; CHECK-NEXT: Function: main: error: Return matrix dimension '16x16' must match derived matrix dimension '8x8'. ; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixOuterProduct.mC8M16N16U2S0.v8f16.v8f16 - %6 = call %dx.types.LinAlgMatrixC8M16N16U2S0 @dx.op.linAlgMatrixOuterProduct.mC8M16N16U2S0.v8f16.v8f16(i32 -2147483619, <8 x half> , <8 x half> ) ; LinAlgMatrixOuterProduct(vectorA,vectorB) + %6 = call %dx.types.LinAlgMatrixC8M16N16U2S0 @dx.op.linAlgMatrixOuterProduct.mC8M16N16U2S0.v8f16.v8f16(i32 -2147483619, i1 true, <8 x half> , <8 x half> ) ; LinAlgMatrixOuterProduct(isInputSigned,vectorA,vectorB) ; CHECK-NEXT: Function: main: error: Return matrix dimension '8x16' must match derived matrix dimension '8x8'. ; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixOuterProduct.mC8M8N16U2S0.v8f16.v8f16 - %7 = call %dx.types.LinAlgMatrixC8M8N16U2S0 @dx.op.linAlgMatrixOuterProduct.mC8M8N16U2S0.v8f16.v8f16(i32 -2147483619, <8 x half> , <8 x half> ) ; LinAlgMatrixOuterProduct(vectorA,vectorB) + %7 = call %dx.types.LinAlgMatrixC8M8N16U2S0 @dx.op.linAlgMatrixOuterProduct.mC8M8N16U2S0.v8f16.v8f16(i32 -2147483619, i1 true, <8 x half> , <8 x half> ) ; LinAlgMatrixOuterProduct(isInputSigned,vectorA,vectorB) ; CHECK-NEXT: Function: main: error: A vector element type 'half' must match B vector element type 'i32' ; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixOuterProduct.mC8M8N8U2S0.v8f16.v8i32 - %8 = call %dx.types.LinAlgMatrixC8M8N8U2S0 @dx.op.linAlgMatrixOuterProduct.mC8M8N8U2S0.v8f16.v8i32(i32 -2147483619, <8 x half> , <8 x i32> ) ; LinAlgMatrixOuterProduct(vectorA,vectorB) + %8 = call %dx.types.LinAlgMatrixC8M8N8U2S0 @dx.op.linAlgMatrixOuterProduct.mC8M8N8U2S0.v8f16.v8i32(i32 -2147483619, i1 true, <8 x half> , <8 x i32> ) ; LinAlgMatrixOuterProduct(isInputSigned,vectorA,vectorB) ; CHECK-NEXT: Validation failed. ret void } ; Function Attrs: nounwind -declare %dx.types.LinAlgMatrixC8M8N8U2S0 @dx.op.linAlgMatrixOuterProduct.mC8M8N8U2S0.v8f16.v8f16(i32, <8 x half>, <8 x half>) #0 +declare %dx.types.LinAlgMatrixC8M8N8U2S0 @dx.op.linAlgMatrixOuterProduct.mC8M8N8U2S0.v8f16.v8f16(i32, i1, <8 x half>, <8 x half>) #0 ; Function Attrs: nounwind -declare %dx.types.LinAlgMatrixC21M8N8U2S0 @dx.op.linAlgMatrixOuterProduct.mC21M8N8U2S0.v8f16.v8f16(i32, <8 x half>, <8 x half>) #0 +declare %dx.types.LinAlgMatrixC21M8N8U2S0 @dx.op.linAlgMatrixOuterProduct.mC21M8N8U2S0.v8f16.v8f16(i32, i1, <8 x half>, <8 x half>) #0 ; Function Attrs: nounwind -declare %dx.types.LinAlgMatrixC8M8N16U2S0 @dx.op.linAlgMatrixOuterProduct.mC8M8N16U2S0.v8f16.v16f16(i32, <8 x half>, <16 x half>) #0 +declare %dx.types.LinAlgMatrixC8M8N16U2S0 @dx.op.linAlgMatrixOuterProduct.mC8M8N16U2S0.v8f16.v16f16(i32, i1, <8 x half>, <16 x half>) #0 ; Function Attrs: nounwind -declare %dx.types.LinAlgMatrixC8M8N8U2S1 @dx.op.linAlgMatrixOuterProduct.mC8M8N8U2S1.v8f16.v8f16(i32, <8 x half>, <8 x half>) #0 +declare %dx.types.LinAlgMatrixC8M8N8U2S1 @dx.op.linAlgMatrixOuterProduct.mC8M8N8U2S1.v8f16.v8f16(i32, i1, <8 x half>, <8 x half>) #0 ; Function Attrs: nounwind -declare %dx.types.LinAlgMatrixC8M8N8U1S0 @dx.op.linAlgMatrixOuterProduct.mC8M8N8U1S0.v8f16.v8f16(i32, <8 x half>, <8 x half>) #0 +declare %dx.types.LinAlgMatrixC8M8N8U1S0 @dx.op.linAlgMatrixOuterProduct.mC8M8N8U1S0.v8f16.v8f16(i32, i1, <8 x half>, <8 x half>) #0 ; Function Attrs: nounwind -declare %dx.types.LinAlgMatrixC8M16N16U2S0 @dx.op.linAlgMatrixOuterProduct.mC8M16N16U2S0.v8f16.v8f16(i32, <8 x half>, <8 x half>) #0 +declare %dx.types.LinAlgMatrixC8M16N16U2S0 @dx.op.linAlgMatrixOuterProduct.mC8M16N16U2S0.v8f16.v8f16(i32, i1, <8 x half>, <8 x half>) #0 ; Function Attrs: nounwind -declare %dx.types.LinAlgMatrixC8M8N16U2S0 @dx.op.linAlgMatrixOuterProduct.mC8M8N16U2S0.v8f16.v8f16(i32, <8 x half>, <8 x half>) #0 +declare %dx.types.LinAlgMatrixC8M8N16U2S0 @dx.op.linAlgMatrixOuterProduct.mC8M8N16U2S0.v8f16.v8f16(i32, i1, <8 x half>, <8 x half>) #0 ; Function Attrs: nounwind -declare %dx.types.LinAlgMatrixC8M8N8U2S0 @dx.op.linAlgMatrixOuterProduct.mC8M8N8U2S0.v8f16.v8i32(i32, <8 x half>, <8 x i32>) #0 +declare %dx.types.LinAlgMatrixC8M8N8U2S0 @dx.op.linAlgMatrixOuterProduct.mC8M8N8U2S0.v8f16.v8i32(i32, i1, <8 x half>, <8 x i32>) #0 attributes #0 = { nounwind } diff --git a/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-stage-anyhit.ll b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-stage-anyhit.ll index e7a1e3160c..f4cc04e2fd 100644 --- a/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-stage-anyhit.ll +++ b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-stage-anyhit.ll @@ -65,7 +65,7 @@ define void @"\01?mainAH@@YAXURayPayload@@UAttribs@@@Z"(%struct.RayPayload* noal %6 = call <16 x half> @dx.op.linAlgMatVecMul.v16f16.mC8M16N16U0S0.v16f16(i32 -2147483623, %dx.types.LinAlgMatrixC8M16N16U0S0 %5, i1 true, <16 x half> zeroinitializer, i32 8) ; LinAlgMatVecMul(matrix,isOutputSigned,inputVector,interpretation) %7 = call <16 x half> @dx.op.linAlgMatVecMulAdd.v16f16.mC8M16N16U0S0.v16f16.v16f16(i32 -2147483622, %dx.types.LinAlgMatrixC8M16N16U0S0 %5, i1 true, <16 x half> %6, i32 8, <16 x half> %6) ; LinAlgMatVecMulAdd(matrix,isOutputSigned,inputVector,inputInterpretation,biasVector) %8 = call <4 x i32> @dx.op.linAlgConvert.v4i32.v16i32(i32 -2147483618, <16 x i32> zeroinitializer, i32 5, i32 21) ; LinAlgConvert(inputVector,inputInterpretation,outputInterpretation) - %9 = call %dx.types.LinAlgMatrixC8M16N16U2S0 @dx.op.linAlgMatrixOuterProduct.mC8M16N16U2S0.v16f16.v16f16(i32 -2147483619, <16 x half> %7, <16 x half> %7) ; LinAlgMatrixOuterProduct(vectorA,vectorB) + %9 = call %dx.types.LinAlgMatrixC8M16N16U2S0 @dx.op.linAlgMatrixOuterProduct.mC8M16N16U2S0.v16f16.v16f16(i32 -2147483619, i1 true, <16 x half> %7, <16 x half> %7) ; LinAlgMatrixOuterProduct(isInputSigned,vectorA,vectorB) %10 = call %dx.types.Handle @dx.op.createHandleForLib.dx.types.Handle(i32 160, %dx.types.Handle %2) ; CreateHandleForLib(Resource) %11 = call %dx.types.Handle @dx.op.annotateHandle(i32 216, %dx.types.Handle %10, %dx.types.ResourceProperties { i32 4107, i32 0 }) ; AnnotateHandle(res,props) resource: RWByteAddressBuffer call void @dx.op.linAlgMatrixAccumulateToDescriptor.mC8M16N16U2S0(i32 -2147483621, %dx.types.LinAlgMatrixC8M16N16U2S0 %9, %dx.types.Handle %11, i32 0, i32 0, i32 4, i32 128) ; LinAlgMatrixAccumulateToDescriptor(matrix,handle,offset,stride,layout,align) @@ -81,7 +81,7 @@ define void @"\01?mainAH@@YAXURayPayload@@UAttribs@@@Z"(%struct.RayPayload* noal %20 = call %dx.types.LinAlgMatrixC8M16N16U2S1 @dx.op.linAlgMatrixAccumulate.mC8M16N16U2S1.mC8M16N16U2S1.mC8M16N16U0S1(i32 -2147483624, %dx.types.LinAlgMatrixC8M16N16U2S1 %19, %dx.types.LinAlgMatrixC8M16N16U0S1 %16) ; LinAlgMatrixAccumulate(matrixLHS,matrixRHS) %21 = call i32 @dx.op.linAlgMatrixLength.mC8M16N16U2S1(i32 -2147483632, %dx.types.LinAlgMatrixC8M16N16U2S1 %20) ; LinAlgMatrixLength(matrix) %22 = call i32 @dx.op.linAlgMatrixQueryAccumulatorLayout(i32 -2147483626) ; LinAlgMatrixQueryAccumulatorLayout() - %23 = call %dx.types.LinAlgMatrixC8M16N16U0S1 @dx.op.linAlgFillMatrix.mC8M16N16U0S1.f32(i32 -2147483636, float 0x40091EB860000000) ; LinAlgFillMatrix(value) + %23 = call %dx.types.LinAlgMatrixC8M16N16U0S1 @dx.op.linAlgFillMatrix.mC8M16N16U0S1.f32(i32 -2147483636, i1 true, float 0x40091EB860000000) ; LinAlgFillMatrix(isInputSigned,value) %24 = call i32 @dx.op.linAlgMatrixLength.mC8M16N16U0S1(i32 -2147483632, %dx.types.LinAlgMatrixC8M16N16U0S1 %23) ; LinAlgMatrixLength(matrix) %25 = call <2 x i32> @dx.op.linAlgMatrixGetCoordinate.mC8M16N16U0S1(i32 -2147483631, %dx.types.LinAlgMatrixC8M16N16U0S1 %23, i32 %24) ; LinAlgMatrixGetCoordinate(matrix,threadLocalIndex) %26 = call half @dx.op.linAlgMatrixGetElement.f16.mC8M16N16U0S1(i32 -2147483630, %dx.types.LinAlgMatrixC8M16N16U0S1 %23, i32 %24) ; LinAlgMatrixGetElement(matrix,threadLocalIndex) @@ -115,7 +115,7 @@ declare <16 x half> @dx.op.linAlgMatVecMulAdd.v16f16.mC8M16N16U0S0.v16f16.v16f16 declare <4 x i32> @dx.op.linAlgConvert.v4i32.v16i32(i32, <16 x i32>, i32, i32) #0 ; Function Attrs: nounwind -declare %dx.types.LinAlgMatrixC8M16N16U2S0 @dx.op.linAlgMatrixOuterProduct.mC8M16N16U2S0.v16f16.v16f16(i32, <16 x half>, <16 x half>) #0 +declare %dx.types.LinAlgMatrixC8M16N16U2S0 @dx.op.linAlgMatrixOuterProduct.mC8M16N16U2S0.v16f16.v16f16(i32, i1, <16 x half>, <16 x half>) #0 ; Function Attrs: nounwind declare void @dx.op.linAlgMatrixAccumulateToDescriptor.mC8M16N16U2S0(i32, %dx.types.LinAlgMatrixC8M16N16U2S0, %dx.types.Handle, i32, i32, i32, i32) #0 @@ -136,7 +136,7 @@ declare %dx.types.LinAlgMatrixC8M16N16U2S1 @dx.op.linAlgMatrixAccumulate.mC8M16N declare i32 @dx.op.linAlgMatrixLength.mC8M16N16U2S1(i32, %dx.types.LinAlgMatrixC8M16N16U2S1) #0 ; Function Attrs: nounwind -declare %dx.types.LinAlgMatrixC8M16N16U0S1 @dx.op.linAlgFillMatrix.mC8M16N16U0S1.f32(i32, float) #0 +declare %dx.types.LinAlgMatrixC8M16N16U0S1 @dx.op.linAlgFillMatrix.mC8M16N16U0S1.f32(i32, i1, float) #0 ; Function Attrs: nounwind declare i32 @dx.op.linAlgMatrixLength.mC8M16N16U0S1(i32, %dx.types.LinAlgMatrixC8M16N16U0S1) #0 diff --git a/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-stage-as.ll b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-stage-as.ll index 11aee3e8e8..9e25a3bb34 100644 --- a/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-stage-as.ll +++ b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-stage-as.ll @@ -59,7 +59,7 @@ define void @mainAS() { %6 = call <16 x half> @dx.op.linAlgMatVecMul.v16f16.mC8M16N16U0S0.v16f16(i32 -2147483623, %dx.types.LinAlgMatrixC8M16N16U0S0 %5, i1 true, <16 x half> zeroinitializer, i32 8) ; LinAlgMatVecMul(matrix,isOutputSigned,inputVector,interpretation) %7 = call <16 x half> @dx.op.linAlgMatVecMulAdd.v16f16.mC8M16N16U0S0.v16f16.v16f16(i32 -2147483622, %dx.types.LinAlgMatrixC8M16N16U0S0 %5, i1 true, <16 x half> %6, i32 8, <16 x half> %6) ; LinAlgMatVecMulAdd(matrix,isOutputSigned,inputVector,inputInterpretation,biasVector) %8 = call <4 x i32> @dx.op.linAlgConvert.v4i32.v16i32(i32 -2147483618, <16 x i32> zeroinitializer, i32 5, i32 21) ; LinAlgConvert(inputVector,inputInterpretation,outputInterpretation) - %9 = call %dx.types.LinAlgMatrixC8M16N16U2S0 @dx.op.linAlgMatrixOuterProduct.mC8M16N16U2S0.v16f16.v16f16(i32 -2147483619, <16 x half> %7, <16 x half> %7) ; LinAlgMatrixOuterProduct(vectorA,vectorB) + %9 = call %dx.types.LinAlgMatrixC8M16N16U2S0 @dx.op.linAlgMatrixOuterProduct.mC8M16N16U2S0.v16f16.v16f16(i32 -2147483619, i1 true, <16 x half> %7, <16 x half> %7) ; LinAlgMatrixOuterProduct(isInputSigned,vectorA,vectorB) %10 = call %dx.types.Handle @dx.op.annotateHandle(i32 216, %dx.types.Handle %1, %dx.types.ResourceProperties { i32 4107, i32 0 }) ; AnnotateHandle(res,props) resource: RWByteAddressBuffer call void @dx.op.linAlgMatrixAccumulateToDescriptor.mC8M16N16U2S0(i32 -2147483621, %dx.types.LinAlgMatrixC8M16N16U2S0 %9, %dx.types.Handle %10, i32 0, i32 0, i32 4, i32 128) ; LinAlgMatrixAccumulateToDescriptor(matrix,handle,offset,stride,layout,align) %11 = call %dx.types.Handle @dx.op.annotateHandle(i32 216, %dx.types.Handle %1, %dx.types.ResourceProperties { i32 4107, i32 0 }) ; AnnotateHandle(res,props) resource: RWByteAddressBuffer @@ -71,7 +71,7 @@ define void @mainAS() { %16 = call %dx.types.LinAlgMatrixC8M16N16U2S1 @dx.op.linAlgMatrixAccumulate.mC8M16N16U2S1.mC8M16N16U2S1.mC8M16N16U0S1(i32 -2147483624, %dx.types.LinAlgMatrixC8M16N16U2S1 %15, %dx.types.LinAlgMatrixC8M16N16U0S1 %13) ; LinAlgMatrixAccumulate(matrixLHS,matrixRHS) %17 = call i32 @dx.op.linAlgMatrixLength.mC8M16N16U2S1(i32 -2147483632, %dx.types.LinAlgMatrixC8M16N16U2S1 %16) ; LinAlgMatrixLength(matrix) %18 = call i32 @dx.op.linAlgMatrixQueryAccumulatorLayout(i32 -2147483626) ; LinAlgMatrixQueryAccumulatorLayout() - %19 = call %dx.types.LinAlgMatrixC8M16N16U0S1 @dx.op.linAlgFillMatrix.mC8M16N16U0S1.f32(i32 -2147483636, float 0x40091EB860000000) ; LinAlgFillMatrix(value) + %19 = call %dx.types.LinAlgMatrixC8M16N16U0S1 @dx.op.linAlgFillMatrix.mC8M16N16U0S1.f32(i32 -2147483636, i1 true, float 0x40091EB860000000) ; LinAlgFillMatrix(isInputSigned,value) %20 = call i32 @dx.op.linAlgMatrixLength.mC8M16N16U0S1(i32 -2147483632, %dx.types.LinAlgMatrixC8M16N16U0S1 %19) ; LinAlgMatrixLength(matrix) %21 = call <2 x i32> @dx.op.linAlgMatrixGetCoordinate.mC8M16N16U0S1(i32 -2147483631, %dx.types.LinAlgMatrixC8M16N16U0S1 %19, i32 %20) ; LinAlgMatrixGetCoordinate(matrix,threadLocalIndex) %22 = call half @dx.op.linAlgMatrixGetElement.f16.mC8M16N16U0S1(i32 -2147483630, %dx.types.LinAlgMatrixC8M16N16U0S1 %19, i32 %20) ; LinAlgMatrixGetElement(matrix,threadLocalIndex) @@ -115,7 +115,7 @@ declare <16 x half> @dx.op.linAlgMatVecMulAdd.v16f16.mC8M16N16U0S0.v16f16.v16f16 declare <4 x i32> @dx.op.linAlgConvert.v4i32.v16i32(i32, <16 x i32>, i32, i32) #0 ; Function Attrs: nounwind -declare %dx.types.LinAlgMatrixC8M16N16U2S0 @dx.op.linAlgMatrixOuterProduct.mC8M16N16U2S0.v16f16.v16f16(i32, <16 x half>, <16 x half>) #0 +declare %dx.types.LinAlgMatrixC8M16N16U2S0 @dx.op.linAlgMatrixOuterProduct.mC8M16N16U2S0.v16f16.v16f16(i32, i1, <16 x half>, <16 x half>) #0 ; Function Attrs: nounwind declare void @dx.op.linAlgMatrixAccumulateToDescriptor.mC8M16N16U2S0(i32, %dx.types.LinAlgMatrixC8M16N16U2S0, %dx.types.Handle, i32, i32, i32, i32) #0 @@ -139,7 +139,7 @@ declare i32 @dx.op.linAlgMatrixLength.mC8M16N16U2S1(i32, %dx.types.LinAlgMatrixC declare i32 @dx.op.linAlgMatrixQueryAccumulatorLayout(i32) #0 ; Function Attrs: nounwind -declare %dx.types.LinAlgMatrixC8M16N16U0S1 @dx.op.linAlgFillMatrix.mC8M16N16U0S1.f32(i32, float) #0 +declare %dx.types.LinAlgMatrixC8M16N16U0S1 @dx.op.linAlgFillMatrix.mC8M16N16U0S1.f32(i32, i1, float) #0 ; Function Attrs: nounwind declare i32 @dx.op.linAlgMatrixLength.mC8M16N16U0S1(i32, %dx.types.LinAlgMatrixC8M16N16U0S1) #0 diff --git a/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-stage-callable.ll b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-stage-callable.ll index 713a571531..2633afcbbd 100644 --- a/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-stage-callable.ll +++ b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-stage-callable.ll @@ -64,7 +64,7 @@ define void @"\01?mainCALL@@YAXUAttribs@@@Z"(%struct.Attribs* noalias nocapture %6 = call <16 x half> @dx.op.linAlgMatVecMul.v16f16.mC8M16N16U0S0.v16f16(i32 -2147483623, %dx.types.LinAlgMatrixC8M16N16U0S0 %5, i1 true, <16 x half> zeroinitializer, i32 8) ; LinAlgMatVecMul(matrix,isOutputSigned,inputVector,interpretation) %7 = call <16 x half> @dx.op.linAlgMatVecMulAdd.v16f16.mC8M16N16U0S0.v16f16.v16f16(i32 -2147483622, %dx.types.LinAlgMatrixC8M16N16U0S0 %5, i1 true, <16 x half> %6, i32 8, <16 x half> %6) ; LinAlgMatVecMulAdd(matrix,isOutputSigned,inputVector,inputInterpretation,biasVector) %8 = call <4 x i32> @dx.op.linAlgConvert.v4i32.v16i32(i32 -2147483618, <16 x i32> zeroinitializer, i32 5, i32 21) ; LinAlgConvert(inputVector,inputInterpretation,outputInterpretation) - %9 = call %dx.types.LinAlgMatrixC8M16N16U2S0 @dx.op.linAlgMatrixOuterProduct.mC8M16N16U2S0.v16f16.v16f16(i32 -2147483619, <16 x half> %7, <16 x half> %7) ; LinAlgMatrixOuterProduct(vectorA,vectorB) + %9 = call %dx.types.LinAlgMatrixC8M16N16U2S0 @dx.op.linAlgMatrixOuterProduct.mC8M16N16U2S0.v16f16.v16f16(i32 -2147483619, i1 true, <16 x half> %7, <16 x half> %7) ; LinAlgMatrixOuterProduct(isInputSigned,vectorA,vectorB) %10 = call %dx.types.Handle @dx.op.createHandleForLib.dx.types.Handle(i32 160, %dx.types.Handle %2) ; CreateHandleForLib(Resource) %11 = call %dx.types.Handle @dx.op.annotateHandle(i32 216, %dx.types.Handle %10, %dx.types.ResourceProperties { i32 4107, i32 0 }) ; AnnotateHandle(res,props) resource: RWByteAddressBuffer call void @dx.op.linAlgMatrixAccumulateToDescriptor.mC8M16N16U2S0(i32 -2147483621, %dx.types.LinAlgMatrixC8M16N16U2S0 %9, %dx.types.Handle %11, i32 0, i32 0, i32 4, i32 128) ; LinAlgMatrixAccumulateToDescriptor(matrix,handle,offset,stride,layout,align) @@ -80,7 +80,7 @@ define void @"\01?mainCALL@@YAXUAttribs@@@Z"(%struct.Attribs* noalias nocapture %20 = call %dx.types.LinAlgMatrixC8M16N16U2S1 @dx.op.linAlgMatrixAccumulate.mC8M16N16U2S1.mC8M16N16U2S1.mC8M16N16U0S1(i32 -2147483624, %dx.types.LinAlgMatrixC8M16N16U2S1 %19, %dx.types.LinAlgMatrixC8M16N16U0S1 %16) ; LinAlgMatrixAccumulate(matrixLHS,matrixRHS) %21 = call i32 @dx.op.linAlgMatrixLength.mC8M16N16U2S1(i32 -2147483632, %dx.types.LinAlgMatrixC8M16N16U2S1 %20) ; LinAlgMatrixLength(matrix) %22 = call i32 @dx.op.linAlgMatrixQueryAccumulatorLayout(i32 -2147483626) ; LinAlgMatrixQueryAccumulatorLayout() - %23 = call %dx.types.LinAlgMatrixC8M16N16U0S1 @dx.op.linAlgFillMatrix.mC8M16N16U0S1.f32(i32 -2147483636, float 0x40091EB860000000) ; LinAlgFillMatrix(value) + %23 = call %dx.types.LinAlgMatrixC8M16N16U0S1 @dx.op.linAlgFillMatrix.mC8M16N16U0S1.f32(i32 -2147483636, i1 true, float 0x40091EB860000000) ; LinAlgFillMatrix(isInputSigned,value) %24 = call i32 @dx.op.linAlgMatrixLength.mC8M16N16U0S1(i32 -2147483632, %dx.types.LinAlgMatrixC8M16N16U0S1 %23) ; LinAlgMatrixLength(matrix) %25 = call <2 x i32> @dx.op.linAlgMatrixGetCoordinate.mC8M16N16U0S1(i32 -2147483631, %dx.types.LinAlgMatrixC8M16N16U0S1 %23, i32 %24) ; LinAlgMatrixGetCoordinate(matrix,threadLocalIndex) %26 = call half @dx.op.linAlgMatrixGetElement.f16.mC8M16N16U0S1(i32 -2147483630, %dx.types.LinAlgMatrixC8M16N16U0S1 %23, i32 %24) ; LinAlgMatrixGetElement(matrix,threadLocalIndex) @@ -114,7 +114,7 @@ declare <16 x half> @dx.op.linAlgMatVecMulAdd.v16f16.mC8M16N16U0S0.v16f16.v16f16 declare <4 x i32> @dx.op.linAlgConvert.v4i32.v16i32(i32, <16 x i32>, i32, i32) #0 ; Function Attrs: nounwind -declare %dx.types.LinAlgMatrixC8M16N16U2S0 @dx.op.linAlgMatrixOuterProduct.mC8M16N16U2S0.v16f16.v16f16(i32, <16 x half>, <16 x half>) #0 +declare %dx.types.LinAlgMatrixC8M16N16U2S0 @dx.op.linAlgMatrixOuterProduct.mC8M16N16U2S0.v16f16.v16f16(i32, i1, <16 x half>, <16 x half>) #0 ; Function Attrs: nounwind declare void @dx.op.linAlgMatrixAccumulateToDescriptor.mC8M16N16U2S0(i32, %dx.types.LinAlgMatrixC8M16N16U2S0, %dx.types.Handle, i32, i32, i32, i32) #0 @@ -135,7 +135,7 @@ declare %dx.types.LinAlgMatrixC8M16N16U2S1 @dx.op.linAlgMatrixAccumulate.mC8M16N declare i32 @dx.op.linAlgMatrixLength.mC8M16N16U2S1(i32, %dx.types.LinAlgMatrixC8M16N16U2S1) #0 ; Function Attrs: nounwind -declare %dx.types.LinAlgMatrixC8M16N16U0S1 @dx.op.linAlgFillMatrix.mC8M16N16U0S1.f32(i32, float) #0 +declare %dx.types.LinAlgMatrixC8M16N16U0S1 @dx.op.linAlgFillMatrix.mC8M16N16U0S1.f32(i32, i1, float) #0 ; Function Attrs: nounwind declare i32 @dx.op.linAlgMatrixLength.mC8M16N16U0S1(i32, %dx.types.LinAlgMatrixC8M16N16U0S1) #0 diff --git a/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-stage-closesthit.ll b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-stage-closesthit.ll index 8803600fd0..e50360b0d1 100644 --- a/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-stage-closesthit.ll +++ b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-stage-closesthit.ll @@ -65,7 +65,7 @@ define void @"\01?mainCH@@YAXURayPayload@@UAttribs@@@Z"(%struct.RayPayload* noal %6 = call <16 x half> @dx.op.linAlgMatVecMul.v16f16.mC8M16N16U0S0.v16f16(i32 -2147483623, %dx.types.LinAlgMatrixC8M16N16U0S0 %5, i1 true, <16 x half> zeroinitializer, i32 8) ; LinAlgMatVecMul(matrix,isOutputSigned,inputVector,interpretation) %7 = call <16 x half> @dx.op.linAlgMatVecMulAdd.v16f16.mC8M16N16U0S0.v16f16.v16f16(i32 -2147483622, %dx.types.LinAlgMatrixC8M16N16U0S0 %5, i1 true, <16 x half> %6, i32 8, <16 x half> %6) ; LinAlgMatVecMulAdd(matrix,isOutputSigned,inputVector,inputInterpretation,biasVector) %8 = call <4 x i32> @dx.op.linAlgConvert.v4i32.v16i32(i32 -2147483618, <16 x i32> zeroinitializer, i32 5, i32 21) ; LinAlgConvert(inputVector,inputInterpretation,outputInterpretation) - %9 = call %dx.types.LinAlgMatrixC8M16N16U2S0 @dx.op.linAlgMatrixOuterProduct.mC8M16N16U2S0.v16f16.v16f16(i32 -2147483619, <16 x half> %7, <16 x half> %7) ; LinAlgMatrixOuterProduct(vectorA,vectorB) + %9 = call %dx.types.LinAlgMatrixC8M16N16U2S0 @dx.op.linAlgMatrixOuterProduct.mC8M16N16U2S0.v16f16.v16f16(i32 -2147483619, i1 true, <16 x half> %7, <16 x half> %7) ; LinAlgMatrixOuterProduct(isInputSigned,vectorA,vectorB) %10 = call %dx.types.Handle @dx.op.createHandleForLib.dx.types.Handle(i32 160, %dx.types.Handle %2) ; CreateHandleForLib(Resource) %11 = call %dx.types.Handle @dx.op.annotateHandle(i32 216, %dx.types.Handle %10, %dx.types.ResourceProperties { i32 4107, i32 0 }) ; AnnotateHandle(res,props) resource: RWByteAddressBuffer call void @dx.op.linAlgMatrixAccumulateToDescriptor.mC8M16N16U2S0(i32 -2147483621, %dx.types.LinAlgMatrixC8M16N16U2S0 %9, %dx.types.Handle %11, i32 0, i32 0, i32 4, i32 128) ; LinAlgMatrixAccumulateToDescriptor(matrix,handle,offset,stride,layout,align) @@ -81,7 +81,7 @@ define void @"\01?mainCH@@YAXURayPayload@@UAttribs@@@Z"(%struct.RayPayload* noal %20 = call %dx.types.LinAlgMatrixC8M16N16U2S1 @dx.op.linAlgMatrixAccumulate.mC8M16N16U2S1.mC8M16N16U2S1.mC8M16N16U0S1(i32 -2147483624, %dx.types.LinAlgMatrixC8M16N16U2S1 %19, %dx.types.LinAlgMatrixC8M16N16U0S1 %16) ; LinAlgMatrixAccumulate(matrixLHS,matrixRHS) %21 = call i32 @dx.op.linAlgMatrixLength.mC8M16N16U2S1(i32 -2147483632, %dx.types.LinAlgMatrixC8M16N16U2S1 %20) ; LinAlgMatrixLength(matrix) %22 = call i32 @dx.op.linAlgMatrixQueryAccumulatorLayout(i32 -2147483626) ; LinAlgMatrixQueryAccumulatorLayout() - %23 = call %dx.types.LinAlgMatrixC8M16N16U0S1 @dx.op.linAlgFillMatrix.mC8M16N16U0S1.f32(i32 -2147483636, float 0x40091EB860000000) ; LinAlgFillMatrix(value) + %23 = call %dx.types.LinAlgMatrixC8M16N16U0S1 @dx.op.linAlgFillMatrix.mC8M16N16U0S1.f32(i32 -2147483636, i1 true, float 0x40091EB860000000) ; LinAlgFillMatrix(isInputSigned,value) %24 = call i32 @dx.op.linAlgMatrixLength.mC8M16N16U0S1(i32 -2147483632, %dx.types.LinAlgMatrixC8M16N16U0S1 %23) ; LinAlgMatrixLength(matrix) %25 = call <2 x i32> @dx.op.linAlgMatrixGetCoordinate.mC8M16N16U0S1(i32 -2147483631, %dx.types.LinAlgMatrixC8M16N16U0S1 %23, i32 %24) ; LinAlgMatrixGetCoordinate(matrix,threadLocalIndex) %26 = call half @dx.op.linAlgMatrixGetElement.f16.mC8M16N16U0S1(i32 -2147483630, %dx.types.LinAlgMatrixC8M16N16U0S1 %23, i32 %24) ; LinAlgMatrixGetElement(matrix,threadLocalIndex) @@ -115,7 +115,7 @@ declare <16 x half> @dx.op.linAlgMatVecMulAdd.v16f16.mC8M16N16U0S0.v16f16.v16f16 declare <4 x i32> @dx.op.linAlgConvert.v4i32.v16i32(i32, <16 x i32>, i32, i32) #0 ; Function Attrs: nounwind -declare %dx.types.LinAlgMatrixC8M16N16U2S0 @dx.op.linAlgMatrixOuterProduct.mC8M16N16U2S0.v16f16.v16f16(i32, <16 x half>, <16 x half>) #0 +declare %dx.types.LinAlgMatrixC8M16N16U2S0 @dx.op.linAlgMatrixOuterProduct.mC8M16N16U2S0.v16f16.v16f16(i32, i1, <16 x half>, <16 x half>) #0 ; Function Attrs: nounwind declare void @dx.op.linAlgMatrixAccumulateToDescriptor.mC8M16N16U2S0(i32, %dx.types.LinAlgMatrixC8M16N16U2S0, %dx.types.Handle, i32, i32, i32, i32) #0 @@ -136,7 +136,7 @@ declare %dx.types.LinAlgMatrixC8M16N16U2S1 @dx.op.linAlgMatrixAccumulate.mC8M16N declare i32 @dx.op.linAlgMatrixLength.mC8M16N16U2S1(i32, %dx.types.LinAlgMatrixC8M16N16U2S1) #0 ; Function Attrs: nounwind -declare %dx.types.LinAlgMatrixC8M16N16U0S1 @dx.op.linAlgFillMatrix.mC8M16N16U0S1.f32(i32, float) #0 +declare %dx.types.LinAlgMatrixC8M16N16U0S1 @dx.op.linAlgFillMatrix.mC8M16N16U0S1.f32(i32, i1, float) #0 ; Function Attrs: nounwind declare i32 @dx.op.linAlgMatrixLength.mC8M16N16U0S1(i32, %dx.types.LinAlgMatrixC8M16N16U0S1) #0 diff --git a/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-stage-cs.ll b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-stage-cs.ll index 89286984e2..63891239e0 100644 --- a/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-stage-cs.ll +++ b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-stage-cs.ll @@ -27,7 +27,7 @@ define void @mainCS() { %5 = call <16 x half> @dx.op.linAlgMatVecMul.v16f16.mC8M16N16U0S0.v16f16(i32 -2147483623, %dx.types.LinAlgMatrixC8M16N16U0S0 %4, i1 true, <16 x half> zeroinitializer, i32 8) ; LinAlgMatVecMul(matrix,isOutputSigned,inputVector,interpretation) %6 = call <16 x half> @dx.op.linAlgMatVecMulAdd.v16f16.mC8M16N16U0S0.v16f16.v16f16(i32 -2147483622, %dx.types.LinAlgMatrixC8M16N16U0S0 %4, i1 true, <16 x half> %5, i32 8, <16 x half> %5) ; LinAlgMatVecMulAdd(matrix,isOutputSigned,inputVector,inputInterpretation,biasVector) %7 = call <4 x i32> @dx.op.linAlgConvert.v4i32.v16i32(i32 -2147483618, <16 x i32> zeroinitializer, i32 5, i32 21) ; LinAlgConvert(inputVector,inputInterpretation,outputInterpretation) - %8 = call %dx.types.LinAlgMatrixC8M16N16U2S0 @dx.op.linAlgMatrixOuterProduct.mC8M16N16U2S0.v16f16.v16f16(i32 -2147483619, <16 x half> %6, <16 x half> %6) ; LinAlgMatrixOuterProduct(vectorA,vectorB) + %8 = call %dx.types.LinAlgMatrixC8M16N16U2S0 @dx.op.linAlgMatrixOuterProduct.mC8M16N16U2S0.v16f16.v16f16(i32 -2147483619, i1 true, <16 x half> %6, <16 x half> %6) ; LinAlgMatrixOuterProduct(isInputSigned,vectorA,vectorB) %9 = call %dx.types.Handle @dx.op.annotateHandle(i32 216, %dx.types.Handle %1, %dx.types.ResourceProperties { i32 4107, i32 0 }) ; AnnotateHandle(res,props) resource: RWByteAddressBuffer call void @dx.op.linAlgMatrixAccumulateToDescriptor.mC8M16N16U2S0(i32 -2147483621, %dx.types.LinAlgMatrixC8M16N16U2S0 %8, %dx.types.Handle %9, i32 0, i32 0, i32 4, i32 128) ; LinAlgMatrixAccumulateToDescriptor(matrix,handle,offset,stride,layout,align) %10 = call %dx.types.Handle @dx.op.annotateHandle(i32 216, %dx.types.Handle %1, %dx.types.ResourceProperties { i32 4107, i32 0 }) ; AnnotateHandle(res,props) resource: RWByteAddressBuffer @@ -39,7 +39,7 @@ define void @mainCS() { %15 = call %dx.types.LinAlgMatrixC8M16N16U2S1 @dx.op.linAlgMatrixAccumulate.mC8M16N16U2S1.mC8M16N16U2S1.mC8M16N16U0S1(i32 -2147483624, %dx.types.LinAlgMatrixC8M16N16U2S1 %14, %dx.types.LinAlgMatrixC8M16N16U0S1 %12) ; LinAlgMatrixAccumulate(matrixLHS,matrixRHS) %16 = call i32 @dx.op.linAlgMatrixLength.mC8M16N16U2S1(i32 -2147483632, %dx.types.LinAlgMatrixC8M16N16U2S1 %15) ; LinAlgMatrixLength(matrix) %17 = call i32 @dx.op.linAlgMatrixQueryAccumulatorLayout(i32 -2147483626) ; LinAlgMatrixQueryAccumulatorLayout() - %18 = call %dx.types.LinAlgMatrixC8M16N16U0S1 @dx.op.linAlgFillMatrix.mC8M16N16U0S1.f32(i32 -2147483636, float 0x40091EB860000000) ; LinAlgFillMatrix(value) + %18 = call %dx.types.LinAlgMatrixC8M16N16U0S1 @dx.op.linAlgFillMatrix.mC8M16N16U0S1.f32(i32 -2147483636, i1 true, float 0x40091EB860000000) ; LinAlgFillMatrix(isInputSigned,value) %19 = call i32 @dx.op.linAlgMatrixLength.mC8M16N16U0S1(i32 -2147483632, %dx.types.LinAlgMatrixC8M16N16U0S1 %18) ; LinAlgMatrixLength(matrix) %20 = call <2 x i32> @dx.op.linAlgMatrixGetCoordinate.mC8M16N16U0S1(i32 -2147483631, %dx.types.LinAlgMatrixC8M16N16U0S1 %18, i32 %19) ; LinAlgMatrixGetCoordinate(matrix,threadLocalIndex) %21 = call half @dx.op.linAlgMatrixGetElement.f16.mC8M16N16U0S1(i32 -2147483630, %dx.types.LinAlgMatrixC8M16N16U0S1 %18, i32 %19) ; LinAlgMatrixGetElement(matrix,threadLocalIndex) @@ -69,7 +69,7 @@ declare <16 x half> @dx.op.linAlgMatVecMulAdd.v16f16.mC8M16N16U0S0.v16f16.v16f16 declare <4 x i32> @dx.op.linAlgConvert.v4i32.v16i32(i32, <16 x i32>, i32, i32) #0 ; Function Attrs: nounwind -declare %dx.types.LinAlgMatrixC8M16N16U2S0 @dx.op.linAlgMatrixOuterProduct.mC8M16N16U2S0.v16f16.v16f16(i32, <16 x half>, <16 x half>) #0 +declare %dx.types.LinAlgMatrixC8M16N16U2S0 @dx.op.linAlgMatrixOuterProduct.mC8M16N16U2S0.v16f16.v16f16(i32, i1, <16 x half>, <16 x half>) #0 ; Function Attrs: nounwind declare void @dx.op.linAlgMatrixAccumulateToDescriptor.mC8M16N16U2S0(i32, %dx.types.LinAlgMatrixC8M16N16U2S0, %dx.types.Handle, i32, i32, i32, i32) #0 @@ -93,7 +93,7 @@ declare i32 @dx.op.linAlgMatrixLength.mC8M16N16U2S1(i32, %dx.types.LinAlgMatrixC declare i32 @dx.op.linAlgMatrixQueryAccumulatorLayout(i32) #0 ; Function Attrs: nounwind -declare %dx.types.LinAlgMatrixC8M16N16U0S1 @dx.op.linAlgFillMatrix.mC8M16N16U0S1.f32(i32, float) #0 +declare %dx.types.LinAlgMatrixC8M16N16U0S1 @dx.op.linAlgFillMatrix.mC8M16N16U0S1.f32(i32, i1, float) #0 ; Function Attrs: nounwind declare i32 @dx.op.linAlgMatrixLength.mC8M16N16U0S1(i32, %dx.types.LinAlgMatrixC8M16N16U0S1) #0 diff --git a/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-stage-ds.ll b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-stage-ds.ll index cc20b04505..1a8c414659 100644 --- a/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-stage-ds.ll +++ b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-stage-ds.ll @@ -60,7 +60,7 @@ define void @mainDS() { %5 = call <16 x half> @dx.op.linAlgMatVecMul.v16f16.mC8M16N16U0S0.v16f16(i32 -2147483623, %dx.types.LinAlgMatrixC8M16N16U0S0 %4, i1 true, <16 x half> zeroinitializer, i32 8) ; LinAlgMatVecMul(matrix,isOutputSigned,inputVector,interpretation) %6 = call <16 x half> @dx.op.linAlgMatVecMulAdd.v16f16.mC8M16N16U0S0.v16f16.v16f16(i32 -2147483622, %dx.types.LinAlgMatrixC8M16N16U0S0 %4, i1 true, <16 x half> %5, i32 8, <16 x half> %5) ; LinAlgMatVecMulAdd(matrix,isOutputSigned,inputVector,inputInterpretation,biasVector) %7 = call <4 x i32> @dx.op.linAlgConvert.v4i32.v16i32(i32 -2147483618, <16 x i32> zeroinitializer, i32 5, i32 21) ; LinAlgConvert(inputVector,inputInterpretation,outputInterpretation) - %8 = call %dx.types.LinAlgMatrixC8M16N16U2S0 @dx.op.linAlgMatrixOuterProduct.mC8M16N16U2S0.v16f16.v16f16(i32 -2147483619, <16 x half> %6, <16 x half> %6) ; LinAlgMatrixOuterProduct(vectorA,vectorB) + %8 = call %dx.types.LinAlgMatrixC8M16N16U2S0 @dx.op.linAlgMatrixOuterProduct.mC8M16N16U2S0.v16f16.v16f16(i32 -2147483619, i1 true, <16 x half> %6, <16 x half> %6) ; LinAlgMatrixOuterProduct(isInputSigned,vectorA,vectorB) %9 = call %dx.types.Handle @dx.op.annotateHandle(i32 216, %dx.types.Handle %1, %dx.types.ResourceProperties { i32 4107, i32 0 }) ; AnnotateHandle(res,props) resource: RWByteAddressBuffer call void @dx.op.linAlgMatrixAccumulateToDescriptor.mC8M16N16U2S0(i32 -2147483621, %dx.types.LinAlgMatrixC8M16N16U2S0 %8, %dx.types.Handle %9, i32 0, i32 0, i32 4, i32 128) ; LinAlgMatrixAccumulateToDescriptor(matrix,handle,offset,stride,layout,align) %10 = call %dx.types.Handle @dx.op.annotateHandle(i32 216, %dx.types.Handle %1, %dx.types.ResourceProperties { i32 4107, i32 0 }) ; AnnotateHandle(res,props) resource: RWByteAddressBuffer @@ -72,7 +72,7 @@ define void @mainDS() { %15 = call %dx.types.LinAlgMatrixC8M16N16U2S1 @dx.op.linAlgMatrixAccumulate.mC8M16N16U2S1.mC8M16N16U2S1.mC8M16N16U0S1(i32 -2147483624, %dx.types.LinAlgMatrixC8M16N16U2S1 %14, %dx.types.LinAlgMatrixC8M16N16U0S1 %12) ; LinAlgMatrixAccumulate(matrixLHS,matrixRHS) %16 = call i32 @dx.op.linAlgMatrixLength.mC8M16N16U2S1(i32 -2147483632, %dx.types.LinAlgMatrixC8M16N16U2S1 %15) ; LinAlgMatrixLength(matrix) %17 = call i32 @dx.op.linAlgMatrixQueryAccumulatorLayout(i32 -2147483626) ; LinAlgMatrixQueryAccumulatorLayout() - %18 = call %dx.types.LinAlgMatrixC8M16N16U0S1 @dx.op.linAlgFillMatrix.mC8M16N16U0S1.f32(i32 -2147483636, float 0x40091EB860000000) ; LinAlgFillMatrix(value) + %18 = call %dx.types.LinAlgMatrixC8M16N16U0S1 @dx.op.linAlgFillMatrix.mC8M16N16U0S1.f32(i32 -2147483636, i1 true, float 0x40091EB860000000) ; LinAlgFillMatrix(isInputSigned,value) %19 = call i32 @dx.op.linAlgMatrixLength.mC8M16N16U0S1(i32 -2147483632, %dx.types.LinAlgMatrixC8M16N16U0S1 %18) ; LinAlgMatrixLength(matrix) %20 = call <2 x i32> @dx.op.linAlgMatrixGetCoordinate.mC8M16N16U0S1(i32 -2147483631, %dx.types.LinAlgMatrixC8M16N16U0S1 %18, i32 %19) ; LinAlgMatrixGetCoordinate(matrix,threadLocalIndex) %21 = call half @dx.op.linAlgMatrixGetElement.f16.mC8M16N16U0S1(i32 -2147483630, %dx.types.LinAlgMatrixC8M16N16U0S1 %18, i32 %19) ; LinAlgMatrixGetElement(matrix,threadLocalIndex) @@ -116,7 +116,7 @@ declare <16 x half> @dx.op.linAlgMatVecMulAdd.v16f16.mC8M16N16U0S0.v16f16.v16f16 declare <4 x i32> @dx.op.linAlgConvert.v4i32.v16i32(i32, <16 x i32>, i32, i32) #1 ; Function Attrs: nounwind -declare %dx.types.LinAlgMatrixC8M16N16U2S0 @dx.op.linAlgMatrixOuterProduct.mC8M16N16U2S0.v16f16.v16f16(i32, <16 x half>, <16 x half>) #1 +declare %dx.types.LinAlgMatrixC8M16N16U2S0 @dx.op.linAlgMatrixOuterProduct.mC8M16N16U2S0.v16f16.v16f16(i32, i1, <16 x half>, <16 x half>) #1 ; Function Attrs: nounwind declare void @dx.op.linAlgMatrixAccumulateToDescriptor.mC8M16N16U2S0(i32, %dx.types.LinAlgMatrixC8M16N16U2S0, %dx.types.Handle, i32, i32, i32, i32) #1 @@ -140,7 +140,7 @@ declare i32 @dx.op.linAlgMatrixLength.mC8M16N16U2S1(i32, %dx.types.LinAlgMatrixC declare i32 @dx.op.linAlgMatrixQueryAccumulatorLayout(i32) #1 ; Function Attrs: nounwind -declare %dx.types.LinAlgMatrixC8M16N16U0S1 @dx.op.linAlgFillMatrix.mC8M16N16U0S1.f32(i32, float) #1 +declare %dx.types.LinAlgMatrixC8M16N16U0S1 @dx.op.linAlgFillMatrix.mC8M16N16U0S1.f32(i32, i1, float) #1 ; Function Attrs: nounwind declare i32 @dx.op.linAlgMatrixLength.mC8M16N16U0S1(i32, %dx.types.LinAlgMatrixC8M16N16U0S1) #1 diff --git a/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-stage-gs.ll b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-stage-gs.ll index a658080a6b..e7ea690be6 100644 --- a/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-stage-gs.ll +++ b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-stage-gs.ll @@ -64,7 +64,7 @@ define void @mainGS() { %7 = call <16 x half> @dx.op.linAlgMatVecMul.v16f16.mC8M16N16U0S0.v16f16(i32 -2147483623, %dx.types.LinAlgMatrixC8M16N16U0S0 %6, i1 true, <16 x half> zeroinitializer, i32 8) ; LinAlgMatVecMul(matrix,isOutputSigned,inputVector,interpretation) %8 = call <16 x half> @dx.op.linAlgMatVecMulAdd.v16f16.mC8M16N16U0S0.v16f16.v16f16(i32 -2147483622, %dx.types.LinAlgMatrixC8M16N16U0S0 %6, i1 true, <16 x half> %7, i32 8, <16 x half> %7) ; LinAlgMatVecMulAdd(matrix,isOutputSigned,inputVector,inputInterpretation,biasVector) %9 = call <4 x i32> @dx.op.linAlgConvert.v4i32.v16i32(i32 -2147483618, <16 x i32> zeroinitializer, i32 5, i32 21) ; LinAlgConvert(inputVector,inputInterpretation,outputInterpretation) - %10 = call %dx.types.LinAlgMatrixC8M16N16U2S0 @dx.op.linAlgMatrixOuterProduct.mC8M16N16U2S0.v16f16.v16f16(i32 -2147483619, <16 x half> %8, <16 x half> %8) ; LinAlgMatrixOuterProduct(vectorA,vectorB) + %10 = call %dx.types.LinAlgMatrixC8M16N16U2S0 @dx.op.linAlgMatrixOuterProduct.mC8M16N16U2S0.v16f16.v16f16(i32 -2147483619, i1 true, <16 x half> %8, <16 x half> %8) ; LinAlgMatrixOuterProduct(isInputSigned,vectorA,vectorB) %11 = call %dx.types.Handle @dx.op.annotateHandle(i32 216, %dx.types.Handle %1, %dx.types.ResourceProperties { i32 4107, i32 0 }) ; AnnotateHandle(res,props) resource: RWByteAddressBuffer call void @dx.op.linAlgMatrixAccumulateToDescriptor.mC8M16N16U2S0(i32 -2147483621, %dx.types.LinAlgMatrixC8M16N16U2S0 %10, %dx.types.Handle %11, i32 0, i32 0, i32 4, i32 128) ; LinAlgMatrixAccumulateToDescriptor(matrix,handle,offset,stride,layout,align) %12 = call %dx.types.Handle @dx.op.annotateHandle(i32 216, %dx.types.Handle %1, %dx.types.ResourceProperties { i32 4107, i32 0 }) ; AnnotateHandle(res,props) resource: RWByteAddressBuffer @@ -76,7 +76,7 @@ define void @mainGS() { %17 = call %dx.types.LinAlgMatrixC8M16N16U2S1 @dx.op.linAlgMatrixAccumulate.mC8M16N16U2S1.mC8M16N16U2S1.mC8M16N16U0S1(i32 -2147483624, %dx.types.LinAlgMatrixC8M16N16U2S1 %16, %dx.types.LinAlgMatrixC8M16N16U0S1 %14) ; LinAlgMatrixAccumulate(matrixLHS,matrixRHS) %18 = call i32 @dx.op.linAlgMatrixLength.mC8M16N16U2S1(i32 -2147483632, %dx.types.LinAlgMatrixC8M16N16U2S1 %17) ; LinAlgMatrixLength(matrix) %19 = call i32 @dx.op.linAlgMatrixQueryAccumulatorLayout(i32 -2147483626) ; LinAlgMatrixQueryAccumulatorLayout() - %20 = call %dx.types.LinAlgMatrixC8M16N16U0S1 @dx.op.linAlgFillMatrix.mC8M16N16U0S1.f32(i32 -2147483636, float 0x40091EB860000000) ; LinAlgFillMatrix(value) + %20 = call %dx.types.LinAlgMatrixC8M16N16U0S1 @dx.op.linAlgFillMatrix.mC8M16N16U0S1.f32(i32 -2147483636, i1 true, float 0x40091EB860000000) ; LinAlgFillMatrix(isInputSigned,value) %21 = call i32 @dx.op.linAlgMatrixLength.mC8M16N16U0S1(i32 -2147483632, %dx.types.LinAlgMatrixC8M16N16U0S1 %20) ; LinAlgMatrixLength(matrix) %22 = call <2 x i32> @dx.op.linAlgMatrixGetCoordinate.mC8M16N16U0S1(i32 -2147483631, %dx.types.LinAlgMatrixC8M16N16U0S1 %20, i32 %21) ; LinAlgMatrixGetCoordinate(matrix,threadLocalIndex) %23 = call half @dx.op.linAlgMatrixGetElement.f16.mC8M16N16U0S1(i32 -2147483630, %dx.types.LinAlgMatrixC8M16N16U0S1 %20, i32 %21) ; LinAlgMatrixGetElement(matrix,threadLocalIndex) @@ -126,7 +126,7 @@ declare <16 x half> @dx.op.linAlgMatVecMulAdd.v16f16.mC8M16N16U0S0.v16f16.v16f16 declare <4 x i32> @dx.op.linAlgConvert.v4i32.v16i32(i32, <16 x i32>, i32, i32) #0 ; Function Attrs: nounwind -declare %dx.types.LinAlgMatrixC8M16N16U2S0 @dx.op.linAlgMatrixOuterProduct.mC8M16N16U2S0.v16f16.v16f16(i32, <16 x half>, <16 x half>) #0 +declare %dx.types.LinAlgMatrixC8M16N16U2S0 @dx.op.linAlgMatrixOuterProduct.mC8M16N16U2S0.v16f16.v16f16(i32, i1, <16 x half>, <16 x half>) #0 ; Function Attrs: nounwind declare void @dx.op.linAlgMatrixAccumulateToDescriptor.mC8M16N16U2S0(i32, %dx.types.LinAlgMatrixC8M16N16U2S0, %dx.types.Handle, i32, i32, i32, i32) #0 @@ -150,7 +150,7 @@ declare i32 @dx.op.linAlgMatrixLength.mC8M16N16U2S1(i32, %dx.types.LinAlgMatrixC declare i32 @dx.op.linAlgMatrixQueryAccumulatorLayout(i32) #0 ; Function Attrs: nounwind -declare %dx.types.LinAlgMatrixC8M16N16U0S1 @dx.op.linAlgFillMatrix.mC8M16N16U0S1.f32(i32, float) #0 +declare %dx.types.LinAlgMatrixC8M16N16U0S1 @dx.op.linAlgFillMatrix.mC8M16N16U0S1.f32(i32, i1, float) #0 ; Function Attrs: nounwind declare i32 @dx.op.linAlgMatrixLength.mC8M16N16U0S1(i32, %dx.types.LinAlgMatrixC8M16N16U0S1) #0 diff --git a/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-stage-hs.ll b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-stage-hs.ll index a6089c2698..b089879da7 100644 --- a/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-stage-hs.ll +++ b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-stage-hs.ll @@ -74,7 +74,7 @@ define void @mainHS() { %6 = call <16 x half> @dx.op.linAlgMatVecMul.v16f16.mC8M16N16U0S0.v16f16(i32 -2147483623, %dx.types.LinAlgMatrixC8M16N16U0S0 %5, i1 true, <16 x half> zeroinitializer, i32 8) ; LinAlgMatVecMul(matrix,isOutputSigned,inputVector,interpretation) %7 = call <16 x half> @dx.op.linAlgMatVecMulAdd.v16f16.mC8M16N16U0S0.v16f16.v16f16(i32 -2147483622, %dx.types.LinAlgMatrixC8M16N16U0S0 %5, i1 true, <16 x half> %6, i32 8, <16 x half> %6) ; LinAlgMatVecMulAdd(matrix,isOutputSigned,inputVector,inputInterpretation,biasVector) %8 = call <4 x i32> @dx.op.linAlgConvert.v4i32.v16i32(i32 -2147483618, <16 x i32> zeroinitializer, i32 5, i32 21) ; LinAlgConvert(inputVector,inputInterpretation,outputInterpretation) - %9 = call %dx.types.LinAlgMatrixC8M16N16U2S0 @dx.op.linAlgMatrixOuterProduct.mC8M16N16U2S0.v16f16.v16f16(i32 -2147483619, <16 x half> %7, <16 x half> %7) ; LinAlgMatrixOuterProduct(vectorA,vectorB) + %9 = call %dx.types.LinAlgMatrixC8M16N16U2S0 @dx.op.linAlgMatrixOuterProduct.mC8M16N16U2S0.v16f16.v16f16(i32 -2147483619, i1 true, <16 x half> %7, <16 x half> %7) ; LinAlgMatrixOuterProduct(isInputSigned,vectorA,vectorB) %10 = call %dx.types.Handle @dx.op.annotateHandle(i32 216, %dx.types.Handle %1, %dx.types.ResourceProperties { i32 4107, i32 0 }) ; AnnotateHandle(res,props) resource: RWByteAddressBuffer call void @dx.op.linAlgMatrixAccumulateToDescriptor.mC8M16N16U2S0(i32 -2147483621, %dx.types.LinAlgMatrixC8M16N16U2S0 %9, %dx.types.Handle %10, i32 0, i32 0, i32 4, i32 128) ; LinAlgMatrixAccumulateToDescriptor(matrix,handle,offset,stride,layout,align) %11 = call %dx.types.Handle @dx.op.annotateHandle(i32 216, %dx.types.Handle %1, %dx.types.ResourceProperties { i32 4107, i32 0 }) ; AnnotateHandle(res,props) resource: RWByteAddressBuffer @@ -86,7 +86,7 @@ define void @mainHS() { %16 = call %dx.types.LinAlgMatrixC8M16N16U2S1 @dx.op.linAlgMatrixAccumulate.mC8M16N16U2S1.mC8M16N16U2S1.mC8M16N16U0S1(i32 -2147483624, %dx.types.LinAlgMatrixC8M16N16U2S1 %15, %dx.types.LinAlgMatrixC8M16N16U0S1 %13) ; LinAlgMatrixAccumulate(matrixLHS,matrixRHS) %17 = call i32 @dx.op.linAlgMatrixLength.mC8M16N16U2S1(i32 -2147483632, %dx.types.LinAlgMatrixC8M16N16U2S1 %16) ; LinAlgMatrixLength(matrix) %18 = call i32 @dx.op.linAlgMatrixQueryAccumulatorLayout(i32 -2147483626) ; LinAlgMatrixQueryAccumulatorLayout() - %19 = call %dx.types.LinAlgMatrixC8M16N16U0S1 @dx.op.linAlgFillMatrix.mC8M16N16U0S1.f32(i32 -2147483636, float 0x40091EB860000000) ; LinAlgFillMatrix(value) + %19 = call %dx.types.LinAlgMatrixC8M16N16U0S1 @dx.op.linAlgFillMatrix.mC8M16N16U0S1.f32(i32 -2147483636, i1 true, float 0x40091EB860000000) ; LinAlgFillMatrix(isInputSigned,value) %20 = call i32 @dx.op.linAlgMatrixLength.mC8M16N16U0S1(i32 -2147483632, %dx.types.LinAlgMatrixC8M16N16U0S1 %19) ; LinAlgMatrixLength(matrix) %21 = call <2 x i32> @dx.op.linAlgMatrixGetCoordinate.mC8M16N16U0S1(i32 -2147483631, %dx.types.LinAlgMatrixC8M16N16U0S1 %19, i32 %20) ; LinAlgMatrixGetCoordinate(matrix,threadLocalIndex) %22 = call half @dx.op.linAlgMatrixGetElement.f16.mC8M16N16U0S1(i32 -2147483630, %dx.types.LinAlgMatrixC8M16N16U0S1 %19, i32 %20) ; LinAlgMatrixGetElement(matrix,threadLocalIndex) @@ -136,7 +136,7 @@ declare <16 x half> @dx.op.linAlgMatVecMulAdd.v16f16.mC8M16N16U0S0.v16f16.v16f16 declare <4 x i32> @dx.op.linAlgConvert.v4i32.v16i32(i32, <16 x i32>, i32, i32) #1 ; Function Attrs: nounwind -declare %dx.types.LinAlgMatrixC8M16N16U2S0 @dx.op.linAlgMatrixOuterProduct.mC8M16N16U2S0.v16f16.v16f16(i32, <16 x half>, <16 x half>) #1 +declare %dx.types.LinAlgMatrixC8M16N16U2S0 @dx.op.linAlgMatrixOuterProduct.mC8M16N16U2S0.v16f16.v16f16(i32, i1, <16 x half>, <16 x half>) #1 ; Function Attrs: nounwind declare void @dx.op.linAlgMatrixAccumulateToDescriptor.mC8M16N16U2S0(i32, %dx.types.LinAlgMatrixC8M16N16U2S0, %dx.types.Handle, i32, i32, i32, i32) #1 @@ -160,7 +160,7 @@ declare i32 @dx.op.linAlgMatrixLength.mC8M16N16U2S1(i32, %dx.types.LinAlgMatrixC declare i32 @dx.op.linAlgMatrixQueryAccumulatorLayout(i32) #1 ; Function Attrs: nounwind -declare %dx.types.LinAlgMatrixC8M16N16U0S1 @dx.op.linAlgFillMatrix.mC8M16N16U0S1.f32(i32, float) #1 +declare %dx.types.LinAlgMatrixC8M16N16U0S1 @dx.op.linAlgFillMatrix.mC8M16N16U0S1.f32(i32, i1, float) #1 ; Function Attrs: nounwind declare i32 @dx.op.linAlgMatrixLength.mC8M16N16U0S1(i32, %dx.types.LinAlgMatrixC8M16N16U0S1) #1 diff --git a/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-stage-intersection.ll b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-stage-intersection.ll index ddfb186ceb..536e83d198 100644 --- a/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-stage-intersection.ll +++ b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-stage-intersection.ll @@ -63,7 +63,7 @@ define void @"\01?mainIS@@YAXXZ"() #0 { %6 = call <16 x half> @dx.op.linAlgMatVecMul.v16f16.mC8M16N16U0S0.v16f16(i32 -2147483623, %dx.types.LinAlgMatrixC8M16N16U0S0 %5, i1 true, <16 x half> zeroinitializer, i32 8) ; LinAlgMatVecMul(matrix,isOutputSigned,inputVector,interpretation) %7 = call <16 x half> @dx.op.linAlgMatVecMulAdd.v16f16.mC8M16N16U0S0.v16f16.v16f16(i32 -2147483622, %dx.types.LinAlgMatrixC8M16N16U0S0 %5, i1 true, <16 x half> %6, i32 8, <16 x half> %6) ; LinAlgMatVecMulAdd(matrix,isOutputSigned,inputVector,inputInterpretation,biasVector) %8 = call <4 x i32> @dx.op.linAlgConvert.v4i32.v16i32(i32 -2147483618, <16 x i32> zeroinitializer, i32 5, i32 21) ; LinAlgConvert(inputVector,inputInterpretation,outputInterpretation) - %9 = call %dx.types.LinAlgMatrixC8M16N16U2S0 @dx.op.linAlgMatrixOuterProduct.mC8M16N16U2S0.v16f16.v16f16(i32 -2147483619, <16 x half> %7, <16 x half> %7) ; LinAlgMatrixOuterProduct(vectorA,vectorB) + %9 = call %dx.types.LinAlgMatrixC8M16N16U2S0 @dx.op.linAlgMatrixOuterProduct.mC8M16N16U2S0.v16f16.v16f16(i32 -2147483619, i1 true, <16 x half> %7, <16 x half> %7) ; LinAlgMatrixOuterProduct(isInputSigned,vectorA,vectorB) %10 = call %dx.types.Handle @dx.op.createHandleForLib.dx.types.Handle(i32 160, %dx.types.Handle %2) ; CreateHandleForLib(Resource) %11 = call %dx.types.Handle @dx.op.annotateHandle(i32 216, %dx.types.Handle %10, %dx.types.ResourceProperties { i32 4107, i32 0 }) ; AnnotateHandle(res,props) resource: RWByteAddressBuffer call void @dx.op.linAlgMatrixAccumulateToDescriptor.mC8M16N16U2S0(i32 -2147483621, %dx.types.LinAlgMatrixC8M16N16U2S0 %9, %dx.types.Handle %11, i32 0, i32 0, i32 4, i32 128) ; LinAlgMatrixAccumulateToDescriptor(matrix,handle,offset,stride,layout,align) @@ -79,7 +79,7 @@ define void @"\01?mainIS@@YAXXZ"() #0 { %20 = call %dx.types.LinAlgMatrixC8M16N16U2S1 @dx.op.linAlgMatrixAccumulate.mC8M16N16U2S1.mC8M16N16U2S1.mC8M16N16U0S1(i32 -2147483624, %dx.types.LinAlgMatrixC8M16N16U2S1 %19, %dx.types.LinAlgMatrixC8M16N16U0S1 %16) ; LinAlgMatrixAccumulate(matrixLHS,matrixRHS) %21 = call i32 @dx.op.linAlgMatrixLength.mC8M16N16U2S1(i32 -2147483632, %dx.types.LinAlgMatrixC8M16N16U2S1 %20) ; LinAlgMatrixLength(matrix) %22 = call i32 @dx.op.linAlgMatrixQueryAccumulatorLayout(i32 -2147483626) ; LinAlgMatrixQueryAccumulatorLayout() - %23 = call %dx.types.LinAlgMatrixC8M16N16U0S1 @dx.op.linAlgFillMatrix.mC8M16N16U0S1.f32(i32 -2147483636, float 0x40091EB860000000) ; LinAlgFillMatrix(value) + %23 = call %dx.types.LinAlgMatrixC8M16N16U0S1 @dx.op.linAlgFillMatrix.mC8M16N16U0S1.f32(i32 -2147483636, i1 true, float 0x40091EB860000000) ; LinAlgFillMatrix(isInputSigned,value) %24 = call i32 @dx.op.linAlgMatrixLength.mC8M16N16U0S1(i32 -2147483632, %dx.types.LinAlgMatrixC8M16N16U0S1 %23) ; LinAlgMatrixLength(matrix) %25 = call <2 x i32> @dx.op.linAlgMatrixGetCoordinate.mC8M16N16U0S1(i32 -2147483631, %dx.types.LinAlgMatrixC8M16N16U0S1 %23, i32 %24) ; LinAlgMatrixGetCoordinate(matrix,threadLocalIndex) %26 = call half @dx.op.linAlgMatrixGetElement.f16.mC8M16N16U0S1(i32 -2147483630, %dx.types.LinAlgMatrixC8M16N16U0S1 %23, i32 %24) ; LinAlgMatrixGetElement(matrix,threadLocalIndex) @@ -113,7 +113,7 @@ declare <16 x half> @dx.op.linAlgMatVecMulAdd.v16f16.mC8M16N16U0S0.v16f16.v16f16 declare <4 x i32> @dx.op.linAlgConvert.v4i32.v16i32(i32, <16 x i32>, i32, i32) #0 ; Function Attrs: nounwind -declare %dx.types.LinAlgMatrixC8M16N16U2S0 @dx.op.linAlgMatrixOuterProduct.mC8M16N16U2S0.v16f16.v16f16(i32, <16 x half>, <16 x half>) #0 +declare %dx.types.LinAlgMatrixC8M16N16U2S0 @dx.op.linAlgMatrixOuterProduct.mC8M16N16U2S0.v16f16.v16f16(i32, i1, <16 x half>, <16 x half>) #0 ; Function Attrs: nounwind declare void @dx.op.linAlgMatrixAccumulateToDescriptor.mC8M16N16U2S0(i32, %dx.types.LinAlgMatrixC8M16N16U2S0, %dx.types.Handle, i32, i32, i32, i32) #0 @@ -134,7 +134,7 @@ declare %dx.types.LinAlgMatrixC8M16N16U2S1 @dx.op.linAlgMatrixAccumulate.mC8M16N declare i32 @dx.op.linAlgMatrixLength.mC8M16N16U2S1(i32, %dx.types.LinAlgMatrixC8M16N16U2S1) #0 ; Function Attrs: nounwind -declare %dx.types.LinAlgMatrixC8M16N16U0S1 @dx.op.linAlgFillMatrix.mC8M16N16U0S1.f32(i32, float) #0 +declare %dx.types.LinAlgMatrixC8M16N16U0S1 @dx.op.linAlgFillMatrix.mC8M16N16U0S1.f32(i32, i1, float) #0 ; Function Attrs: nounwind declare i32 @dx.op.linAlgMatrixLength.mC8M16N16U0S1(i32, %dx.types.LinAlgMatrixC8M16N16U0S1) #0 diff --git a/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-stage-miss.ll b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-stage-miss.ll index 2538ba04db..f82521e04a 100644 --- a/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-stage-miss.ll +++ b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-stage-miss.ll @@ -64,7 +64,7 @@ define void @"\01?mainMS@@YAXURayPayload@@@Z"(%struct.RayPayload* noalias nocapt %6 = call <16 x half> @dx.op.linAlgMatVecMul.v16f16.mC8M16N16U0S0.v16f16(i32 -2147483623, %dx.types.LinAlgMatrixC8M16N16U0S0 %5, i1 true, <16 x half> zeroinitializer, i32 8) ; LinAlgMatVecMul(matrix,isOutputSigned,inputVector,interpretation) %7 = call <16 x half> @dx.op.linAlgMatVecMulAdd.v16f16.mC8M16N16U0S0.v16f16.v16f16(i32 -2147483622, %dx.types.LinAlgMatrixC8M16N16U0S0 %5, i1 true, <16 x half> %6, i32 8, <16 x half> %6) ; LinAlgMatVecMulAdd(matrix,isOutputSigned,inputVector,inputInterpretation,biasVector) %8 = call <4 x i32> @dx.op.linAlgConvert.v4i32.v16i32(i32 -2147483618, <16 x i32> zeroinitializer, i32 5, i32 21) ; LinAlgConvert(inputVector,inputInterpretation,outputInterpretation) - %9 = call %dx.types.LinAlgMatrixC8M16N16U2S0 @dx.op.linAlgMatrixOuterProduct.mC8M16N16U2S0.v16f16.v16f16(i32 -2147483619, <16 x half> %7, <16 x half> %7) ; LinAlgMatrixOuterProduct(vectorA,vectorB) + %9 = call %dx.types.LinAlgMatrixC8M16N16U2S0 @dx.op.linAlgMatrixOuterProduct.mC8M16N16U2S0.v16f16.v16f16(i32 -2147483619, i1 true, <16 x half> %7, <16 x half> %7) ; LinAlgMatrixOuterProduct(isInputSigned,vectorA,vectorB) %10 = call %dx.types.Handle @dx.op.createHandleForLib.dx.types.Handle(i32 160, %dx.types.Handle %2) ; CreateHandleForLib(Resource) %11 = call %dx.types.Handle @dx.op.annotateHandle(i32 216, %dx.types.Handle %10, %dx.types.ResourceProperties { i32 4107, i32 0 }) ; AnnotateHandle(res,props) resource: RWByteAddressBuffer call void @dx.op.linAlgMatrixAccumulateToDescriptor.mC8M16N16U2S0(i32 -2147483621, %dx.types.LinAlgMatrixC8M16N16U2S0 %9, %dx.types.Handle %11, i32 0, i32 0, i32 4, i32 128) ; LinAlgMatrixAccumulateToDescriptor(matrix,handle,offset,stride,layout,align) @@ -80,7 +80,7 @@ define void @"\01?mainMS@@YAXURayPayload@@@Z"(%struct.RayPayload* noalias nocapt %20 = call %dx.types.LinAlgMatrixC8M16N16U2S1 @dx.op.linAlgMatrixAccumulate.mC8M16N16U2S1.mC8M16N16U2S1.mC8M16N16U0S1(i32 -2147483624, %dx.types.LinAlgMatrixC8M16N16U2S1 %19, %dx.types.LinAlgMatrixC8M16N16U0S1 %16) ; LinAlgMatrixAccumulate(matrixLHS,matrixRHS) %21 = call i32 @dx.op.linAlgMatrixLength.mC8M16N16U2S1(i32 -2147483632, %dx.types.LinAlgMatrixC8M16N16U2S1 %20) ; LinAlgMatrixLength(matrix) %22 = call i32 @dx.op.linAlgMatrixQueryAccumulatorLayout(i32 -2147483626) ; LinAlgMatrixQueryAccumulatorLayout() - %23 = call %dx.types.LinAlgMatrixC8M16N16U0S1 @dx.op.linAlgFillMatrix.mC8M16N16U0S1.f32(i32 -2147483636, float 0x40091EB860000000) ; LinAlgFillMatrix(value) + %23 = call %dx.types.LinAlgMatrixC8M16N16U0S1 @dx.op.linAlgFillMatrix.mC8M16N16U0S1.f32(i32 -2147483636, i1 true, float 0x40091EB860000000) ; LinAlgFillMatrix(isInputSigned,value) %24 = call i32 @dx.op.linAlgMatrixLength.mC8M16N16U0S1(i32 -2147483632, %dx.types.LinAlgMatrixC8M16N16U0S1 %23) ; LinAlgMatrixLength(matrix) %25 = call <2 x i32> @dx.op.linAlgMatrixGetCoordinate.mC8M16N16U0S1(i32 -2147483631, %dx.types.LinAlgMatrixC8M16N16U0S1 %23, i32 %24) ; LinAlgMatrixGetCoordinate(matrix,threadLocalIndex) %26 = call half @dx.op.linAlgMatrixGetElement.f16.mC8M16N16U0S1(i32 -2147483630, %dx.types.LinAlgMatrixC8M16N16U0S1 %23, i32 %24) ; LinAlgMatrixGetElement(matrix,threadLocalIndex) @@ -114,7 +114,7 @@ declare <16 x half> @dx.op.linAlgMatVecMulAdd.v16f16.mC8M16N16U0S0.v16f16.v16f16 declare <4 x i32> @dx.op.linAlgConvert.v4i32.v16i32(i32, <16 x i32>, i32, i32) #0 ; Function Attrs: nounwind -declare %dx.types.LinAlgMatrixC8M16N16U2S0 @dx.op.linAlgMatrixOuterProduct.mC8M16N16U2S0.v16f16.v16f16(i32, <16 x half>, <16 x half>) #0 +declare %dx.types.LinAlgMatrixC8M16N16U2S0 @dx.op.linAlgMatrixOuterProduct.mC8M16N16U2S0.v16f16.v16f16(i32, i1, <16 x half>, <16 x half>) #0 ; Function Attrs: nounwind declare void @dx.op.linAlgMatrixAccumulateToDescriptor.mC8M16N16U2S0(i32, %dx.types.LinAlgMatrixC8M16N16U2S0, %dx.types.Handle, i32, i32, i32, i32) #0 @@ -135,7 +135,7 @@ declare %dx.types.LinAlgMatrixC8M16N16U2S1 @dx.op.linAlgMatrixAccumulate.mC8M16N declare i32 @dx.op.linAlgMatrixLength.mC8M16N16U2S1(i32, %dx.types.LinAlgMatrixC8M16N16U2S1) #0 ; Function Attrs: nounwind -declare %dx.types.LinAlgMatrixC8M16N16U0S1 @dx.op.linAlgFillMatrix.mC8M16N16U0S1.f32(i32, float) #0 +declare %dx.types.LinAlgMatrixC8M16N16U0S1 @dx.op.linAlgFillMatrix.mC8M16N16U0S1.f32(i32, i1, float) #0 ; Function Attrs: nounwind declare i32 @dx.op.linAlgMatrixLength.mC8M16N16U0S1(i32, %dx.types.LinAlgMatrixC8M16N16U0S1) #0 diff --git a/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-stage-ms.ll b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-stage-ms.ll index e6b156707a..ca328a6cde 100644 --- a/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-stage-ms.ll +++ b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-stage-ms.ll @@ -58,7 +58,7 @@ define void @mainMeS() { %6 = call <16 x half> @dx.op.linAlgMatVecMul.v16f16.mC8M16N16U0S0.v16f16(i32 -2147483623, %dx.types.LinAlgMatrixC8M16N16U0S0 %5, i1 true, <16 x half> zeroinitializer, i32 8) ; LinAlgMatVecMul(matrix,isOutputSigned,inputVector,interpretation) %7 = call <16 x half> @dx.op.linAlgMatVecMulAdd.v16f16.mC8M16N16U0S0.v16f16.v16f16(i32 -2147483622, %dx.types.LinAlgMatrixC8M16N16U0S0 %5, i1 true, <16 x half> %6, i32 8, <16 x half> %6) ; LinAlgMatVecMulAdd(matrix,isOutputSigned,inputVector,inputInterpretation,biasVector) %8 = call <4 x i32> @dx.op.linAlgConvert.v4i32.v16i32(i32 -2147483618, <16 x i32> zeroinitializer, i32 5, i32 21) ; LinAlgConvert(inputVector,inputInterpretation,outputInterpretation) - %9 = call %dx.types.LinAlgMatrixC8M16N16U2S0 @dx.op.linAlgMatrixOuterProduct.mC8M16N16U2S0.v16f16.v16f16(i32 -2147483619, <16 x half> %7, <16 x half> %7) ; LinAlgMatrixOuterProduct(vectorA,vectorB) + %9 = call %dx.types.LinAlgMatrixC8M16N16U2S0 @dx.op.linAlgMatrixOuterProduct.mC8M16N16U2S0.v16f16.v16f16(i32 -2147483619, i1 true, <16 x half> %7, <16 x half> %7) ; LinAlgMatrixOuterProduct(isInputSigned,vectorA,vectorB) %10 = call %dx.types.Handle @dx.op.annotateHandle(i32 216, %dx.types.Handle %1, %dx.types.ResourceProperties { i32 4107, i32 0 }) ; AnnotateHandle(res,props) resource: RWByteAddressBuffer call void @dx.op.linAlgMatrixAccumulateToDescriptor.mC8M16N16U2S0(i32 -2147483621, %dx.types.LinAlgMatrixC8M16N16U2S0 %9, %dx.types.Handle %10, i32 0, i32 0, i32 4, i32 128) ; LinAlgMatrixAccumulateToDescriptor(matrix,handle,offset,stride,layout,align) %11 = call %dx.types.Handle @dx.op.annotateHandle(i32 216, %dx.types.Handle %1, %dx.types.ResourceProperties { i32 4107, i32 0 }) ; AnnotateHandle(res,props) resource: RWByteAddressBuffer @@ -70,7 +70,7 @@ define void @mainMeS() { %16 = call %dx.types.LinAlgMatrixC8M16N16U2S1 @dx.op.linAlgMatrixAccumulate.mC8M16N16U2S1.mC8M16N16U2S1.mC8M16N16U0S1(i32 -2147483624, %dx.types.LinAlgMatrixC8M16N16U2S1 %15, %dx.types.LinAlgMatrixC8M16N16U0S1 %13) ; LinAlgMatrixAccumulate(matrixLHS,matrixRHS) %17 = call i32 @dx.op.linAlgMatrixLength.mC8M16N16U2S1(i32 -2147483632, %dx.types.LinAlgMatrixC8M16N16U2S1 %16) ; LinAlgMatrixLength(matrix) %18 = call i32 @dx.op.linAlgMatrixQueryAccumulatorLayout(i32 -2147483626) ; LinAlgMatrixQueryAccumulatorLayout() - %19 = call %dx.types.LinAlgMatrixC8M16N16U0S1 @dx.op.linAlgFillMatrix.mC8M16N16U0S1.f32(i32 -2147483636, float 0x40091EB860000000) ; LinAlgFillMatrix(value) + %19 = call %dx.types.LinAlgMatrixC8M16N16U0S1 @dx.op.linAlgFillMatrix.mC8M16N16U0S1.f32(i32 -2147483636, i1 true, float 0x40091EB860000000) ; LinAlgFillMatrix(isInputSigned,value) %20 = call i32 @dx.op.linAlgMatrixLength.mC8M16N16U0S1(i32 -2147483632, %dx.types.LinAlgMatrixC8M16N16U0S1 %19) ; LinAlgMatrixLength(matrix) %21 = call <2 x i32> @dx.op.linAlgMatrixGetCoordinate.mC8M16N16U0S1(i32 -2147483631, %dx.types.LinAlgMatrixC8M16N16U0S1 %19, i32 %20) ; LinAlgMatrixGetCoordinate(matrix,threadLocalIndex) %22 = call half @dx.op.linAlgMatrixGetElement.f16.mC8M16N16U0S1(i32 -2147483630, %dx.types.LinAlgMatrixC8M16N16U0S1 %19, i32 %20) ; LinAlgMatrixGetElement(matrix,threadLocalIndex) @@ -114,7 +114,7 @@ declare <16 x half> @dx.op.linAlgMatVecMulAdd.v16f16.mC8M16N16U0S0.v16f16.v16f16 declare <4 x i32> @dx.op.linAlgConvert.v4i32.v16i32(i32, <16 x i32>, i32, i32) #1 ; Function Attrs: nounwind -declare %dx.types.LinAlgMatrixC8M16N16U2S0 @dx.op.linAlgMatrixOuterProduct.mC8M16N16U2S0.v16f16.v16f16(i32, <16 x half>, <16 x half>) #1 +declare %dx.types.LinAlgMatrixC8M16N16U2S0 @dx.op.linAlgMatrixOuterProduct.mC8M16N16U2S0.v16f16.v16f16(i32, i1, <16 x half>, <16 x half>) #1 ; Function Attrs: nounwind declare void @dx.op.linAlgMatrixAccumulateToDescriptor.mC8M16N16U2S0(i32, %dx.types.LinAlgMatrixC8M16N16U2S0, %dx.types.Handle, i32, i32, i32, i32) #1 @@ -138,7 +138,7 @@ declare i32 @dx.op.linAlgMatrixLength.mC8M16N16U2S1(i32, %dx.types.LinAlgMatrixC declare i32 @dx.op.linAlgMatrixQueryAccumulatorLayout(i32) #1 ; Function Attrs: nounwind -declare %dx.types.LinAlgMatrixC8M16N16U0S1 @dx.op.linAlgFillMatrix.mC8M16N16U0S1.f32(i32, float) #1 +declare %dx.types.LinAlgMatrixC8M16N16U0S1 @dx.op.linAlgFillMatrix.mC8M16N16U0S1.f32(i32, i1, float) #1 ; Function Attrs: nounwind declare i32 @dx.op.linAlgMatrixLength.mC8M16N16U0S1(i32, %dx.types.LinAlgMatrixC8M16N16U0S1) #1 diff --git a/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-stage-node.ll b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-stage-node.ll index 4f6972c399..f6b1cd4db4 100644 --- a/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-stage-node.ll +++ b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-stage-node.ll @@ -60,7 +60,7 @@ define void @mainNS() #0 { %6 = call <16 x half> @dx.op.linAlgMatVecMul.v16f16.mC8M16N16U0S0.v16f16(i32 -2147483623, %dx.types.LinAlgMatrixC8M16N16U0S0 %5, i1 true, <16 x half> zeroinitializer, i32 8) ; LinAlgMatVecMul(matrix,isOutputSigned,inputVector,interpretation) %7 = call <16 x half> @dx.op.linAlgMatVecMulAdd.v16f16.mC8M16N16U0S0.v16f16.v16f16(i32 -2147483622, %dx.types.LinAlgMatrixC8M16N16U0S0 %5, i1 true, <16 x half> %6, i32 8, <16 x half> %6) ; LinAlgMatVecMulAdd(matrix,isOutputSigned,inputVector,inputInterpretation,biasVector) %8 = call <4 x i32> @dx.op.linAlgConvert.v4i32.v16i32(i32 -2147483618, <16 x i32> zeroinitializer, i32 5, i32 21) ; LinAlgConvert(inputVector,inputInterpretation,outputInterpretation) - %9 = call %dx.types.LinAlgMatrixC8M16N16U2S0 @dx.op.linAlgMatrixOuterProduct.mC8M16N16U2S0.v16f16.v16f16(i32 -2147483619, <16 x half> %7, <16 x half> %7) ; LinAlgMatrixOuterProduct(vectorA,vectorB) + %9 = call %dx.types.LinAlgMatrixC8M16N16U2S0 @dx.op.linAlgMatrixOuterProduct.mC8M16N16U2S0.v16f16.v16f16(i32 -2147483619, i1 true, <16 x half> %7, <16 x half> %7) ; LinAlgMatrixOuterProduct(isInputSigned,vectorA,vectorB) %10 = call %dx.types.Handle @dx.op.createHandleForLib.dx.types.Handle(i32 160, %dx.types.Handle %2) ; CreateHandleForLib(Resource) %11 = call %dx.types.Handle @dx.op.annotateHandle(i32 216, %dx.types.Handle %10, %dx.types.ResourceProperties { i32 4107, i32 0 }) ; AnnotateHandle(res,props) resource: RWByteAddressBuffer call void @dx.op.linAlgMatrixAccumulateToDescriptor.mC8M16N16U2S0(i32 -2147483621, %dx.types.LinAlgMatrixC8M16N16U2S0 %9, %dx.types.Handle %11, i32 0, i32 0, i32 4, i32 128) ; LinAlgMatrixAccumulateToDescriptor(matrix,handle,offset,stride,layout,align) @@ -76,7 +76,7 @@ define void @mainNS() #0 { %20 = call %dx.types.LinAlgMatrixC8M16N16U2S1 @dx.op.linAlgMatrixAccumulate.mC8M16N16U2S1.mC8M16N16U2S1.mC8M16N16U0S1(i32 -2147483624, %dx.types.LinAlgMatrixC8M16N16U2S1 %19, %dx.types.LinAlgMatrixC8M16N16U0S1 %16) ; LinAlgMatrixAccumulate(matrixLHS,matrixRHS) %21 = call i32 @dx.op.linAlgMatrixLength.mC8M16N16U2S1(i32 -2147483632, %dx.types.LinAlgMatrixC8M16N16U2S1 %20) ; LinAlgMatrixLength(matrix) %22 = call i32 @dx.op.linAlgMatrixQueryAccumulatorLayout(i32 -2147483626) ; LinAlgMatrixQueryAccumulatorLayout() - %23 = call %dx.types.LinAlgMatrixC8M16N16U0S1 @dx.op.linAlgFillMatrix.mC8M16N16U0S1.f32(i32 -2147483636, float 0x40091EB860000000) ; LinAlgFillMatrix(value) + %23 = call %dx.types.LinAlgMatrixC8M16N16U0S1 @dx.op.linAlgFillMatrix.mC8M16N16U0S1.f32(i32 -2147483636, i1 true, float 0x40091EB860000000) ; LinAlgFillMatrix(isInputSigned,value) %24 = call i32 @dx.op.linAlgMatrixLength.mC8M16N16U0S1(i32 -2147483632, %dx.types.LinAlgMatrixC8M16N16U0S1 %23) ; LinAlgMatrixLength(matrix) %25 = call <2 x i32> @dx.op.linAlgMatrixGetCoordinate.mC8M16N16U0S1(i32 -2147483631, %dx.types.LinAlgMatrixC8M16N16U0S1 %23, i32 %24) ; LinAlgMatrixGetCoordinate(matrix,threadLocalIndex) %26 = call half @dx.op.linAlgMatrixGetElement.f16.mC8M16N16U0S1(i32 -2147483630, %dx.types.LinAlgMatrixC8M16N16U0S1 %23, i32 %24) ; LinAlgMatrixGetElement(matrix,threadLocalIndex) @@ -110,7 +110,7 @@ declare <16 x half> @dx.op.linAlgMatVecMulAdd.v16f16.mC8M16N16U0S0.v16f16.v16f16 declare <4 x i32> @dx.op.linAlgConvert.v4i32.v16i32(i32, <16 x i32>, i32, i32) #0 ; Function Attrs: nounwind -declare %dx.types.LinAlgMatrixC8M16N16U2S0 @dx.op.linAlgMatrixOuterProduct.mC8M16N16U2S0.v16f16.v16f16(i32, <16 x half>, <16 x half>) #0 +declare %dx.types.LinAlgMatrixC8M16N16U2S0 @dx.op.linAlgMatrixOuterProduct.mC8M16N16U2S0.v16f16.v16f16(i32, i1, <16 x half>, <16 x half>) #0 ; Function Attrs: nounwind declare void @dx.op.linAlgMatrixAccumulateToDescriptor.mC8M16N16U2S0(i32, %dx.types.LinAlgMatrixC8M16N16U2S0, %dx.types.Handle, i32, i32, i32, i32) #0 @@ -131,7 +131,7 @@ declare %dx.types.LinAlgMatrixC8M16N16U2S1 @dx.op.linAlgMatrixAccumulate.mC8M16N declare i32 @dx.op.linAlgMatrixLength.mC8M16N16U2S1(i32, %dx.types.LinAlgMatrixC8M16N16U2S1) #0 ; Function Attrs: nounwind -declare %dx.types.LinAlgMatrixC8M16N16U0S1 @dx.op.linAlgFillMatrix.mC8M16N16U0S1.f32(i32, float) #0 +declare %dx.types.LinAlgMatrixC8M16N16U0S1 @dx.op.linAlgFillMatrix.mC8M16N16U0S1.f32(i32, i1, float) #0 ; Function Attrs: nounwind declare i32 @dx.op.linAlgMatrixLength.mC8M16N16U0S1(i32, %dx.types.LinAlgMatrixC8M16N16U0S1) #0 diff --git a/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-stage-ps.ll b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-stage-ps.ll index 7e847b90e1..c925b5519a 100644 --- a/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-stage-ps.ll +++ b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-stage-ps.ll @@ -60,7 +60,7 @@ define void @mainPS() { %5 = call <16 x half> @dx.op.linAlgMatVecMul.v16f16.mC8M16N16U0S0.v16f16(i32 -2147483623, %dx.types.LinAlgMatrixC8M16N16U0S0 %4, i1 true, <16 x half> zeroinitializer, i32 8) ; LinAlgMatVecMul(matrix,isOutputSigned,inputVector,interpretation) %6 = call <16 x half> @dx.op.linAlgMatVecMulAdd.v16f16.mC8M16N16U0S0.v16f16.v16f16(i32 -2147483622, %dx.types.LinAlgMatrixC8M16N16U0S0 %4, i1 true, <16 x half> %5, i32 8, <16 x half> %5) ; LinAlgMatVecMulAdd(matrix,isOutputSigned,inputVector,inputInterpretation,biasVector) %7 = call <4 x i32> @dx.op.linAlgConvert.v4i32.v16i32(i32 -2147483618, <16 x i32> zeroinitializer, i32 5, i32 21) ; LinAlgConvert(inputVector,inputInterpretation,outputInterpretation) - %8 = call %dx.types.LinAlgMatrixC8M16N16U2S0 @dx.op.linAlgMatrixOuterProduct.mC8M16N16U2S0.v16f16.v16f16(i32 -2147483619, <16 x half> %6, <16 x half> %6) ; LinAlgMatrixOuterProduct(vectorA,vectorB) + %8 = call %dx.types.LinAlgMatrixC8M16N16U2S0 @dx.op.linAlgMatrixOuterProduct.mC8M16N16U2S0.v16f16.v16f16(i32 -2147483619, i1 true, <16 x half> %6, <16 x half> %6) ; LinAlgMatrixOuterProduct(isInputSigned,vectorA,vectorB) %9 = call %dx.types.Handle @dx.op.annotateHandle(i32 216, %dx.types.Handle %1, %dx.types.ResourceProperties { i32 4107, i32 0 }) ; AnnotateHandle(res,props) resource: RWByteAddressBuffer call void @dx.op.linAlgMatrixAccumulateToDescriptor.mC8M16N16U2S0(i32 -2147483621, %dx.types.LinAlgMatrixC8M16N16U2S0 %8, %dx.types.Handle %9, i32 0, i32 0, i32 4, i32 128) ; LinAlgMatrixAccumulateToDescriptor(matrix,handle,offset,stride,layout,align) %10 = call %dx.types.Handle @dx.op.annotateHandle(i32 216, %dx.types.Handle %1, %dx.types.ResourceProperties { i32 4107, i32 0 }) ; AnnotateHandle(res,props) resource: RWByteAddressBuffer @@ -72,7 +72,7 @@ define void @mainPS() { %15 = call %dx.types.LinAlgMatrixC8M16N16U2S1 @dx.op.linAlgMatrixAccumulate.mC8M16N16U2S1.mC8M16N16U2S1.mC8M16N16U0S1(i32 -2147483624, %dx.types.LinAlgMatrixC8M16N16U2S1 %14, %dx.types.LinAlgMatrixC8M16N16U0S1 %12) ; LinAlgMatrixAccumulate(matrixLHS,matrixRHS) %16 = call i32 @dx.op.linAlgMatrixLength.mC8M16N16U2S1(i32 -2147483632, %dx.types.LinAlgMatrixC8M16N16U2S1 %15) ; LinAlgMatrixLength(matrix) %17 = call i32 @dx.op.linAlgMatrixQueryAccumulatorLayout(i32 -2147483626) ; LinAlgMatrixQueryAccumulatorLayout() - %18 = call %dx.types.LinAlgMatrixC8M16N16U0S1 @dx.op.linAlgFillMatrix.mC8M16N16U0S1.f32(i32 -2147483636, float 0x40091EB860000000) ; LinAlgFillMatrix(value) + %18 = call %dx.types.LinAlgMatrixC8M16N16U0S1 @dx.op.linAlgFillMatrix.mC8M16N16U0S1.f32(i32 -2147483636, i1 true, float 0x40091EB860000000) ; LinAlgFillMatrix(isInputSigned,value) %19 = call i32 @dx.op.linAlgMatrixLength.mC8M16N16U0S1(i32 -2147483632, %dx.types.LinAlgMatrixC8M16N16U0S1 %18) ; LinAlgMatrixLength(matrix) %20 = call <2 x i32> @dx.op.linAlgMatrixGetCoordinate.mC8M16N16U0S1(i32 -2147483631, %dx.types.LinAlgMatrixC8M16N16U0S1 %18, i32 %19) ; LinAlgMatrixGetCoordinate(matrix,threadLocalIndex) %21 = call half @dx.op.linAlgMatrixGetElement.f16.mC8M16N16U0S1(i32 -2147483630, %dx.types.LinAlgMatrixC8M16N16U0S1 %18, i32 %19) ; LinAlgMatrixGetElement(matrix,threadLocalIndex) @@ -109,7 +109,7 @@ declare <16 x half> @dx.op.linAlgMatVecMulAdd.v16f16.mC8M16N16U0S0.v16f16.v16f16 declare <4 x i32> @dx.op.linAlgConvert.v4i32.v16i32(i32, <16 x i32>, i32, i32) #0 ; Function Attrs: nounwind -declare %dx.types.LinAlgMatrixC8M16N16U2S0 @dx.op.linAlgMatrixOuterProduct.mC8M16N16U2S0.v16f16.v16f16(i32, <16 x half>, <16 x half>) #0 +declare %dx.types.LinAlgMatrixC8M16N16U2S0 @dx.op.linAlgMatrixOuterProduct.mC8M16N16U2S0.v16f16.v16f16(i32, i1, <16 x half>, <16 x half>) #0 ; Function Attrs: nounwind declare void @dx.op.linAlgMatrixAccumulateToDescriptor.mC8M16N16U2S0(i32, %dx.types.LinAlgMatrixC8M16N16U2S0, %dx.types.Handle, i32, i32, i32, i32) #0 @@ -133,7 +133,7 @@ declare i32 @dx.op.linAlgMatrixLength.mC8M16N16U2S1(i32, %dx.types.LinAlgMatrixC declare i32 @dx.op.linAlgMatrixQueryAccumulatorLayout(i32) #0 ; Function Attrs: nounwind -declare %dx.types.LinAlgMatrixC8M16N16U0S1 @dx.op.linAlgFillMatrix.mC8M16N16U0S1.f32(i32, float) #0 +declare %dx.types.LinAlgMatrixC8M16N16U0S1 @dx.op.linAlgFillMatrix.mC8M16N16U0S1.f32(i32, i1, float) #0 ; Function Attrs: nounwind declare i32 @dx.op.linAlgMatrixLength.mC8M16N16U0S1(i32, %dx.types.LinAlgMatrixC8M16N16U0S1) #0 diff --git a/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-stage-raygeneration.ll b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-stage-raygeneration.ll index 3ecc80f0a7..2ffcb0cdc2 100644 --- a/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-stage-raygeneration.ll +++ b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-stage-raygeneration.ll @@ -63,7 +63,7 @@ define void @"\01?mainRG@@YAXXZ"() #0 { %6 = call <16 x half> @dx.op.linAlgMatVecMul.v16f16.mC8M16N16U0S0.v16f16(i32 -2147483623, %dx.types.LinAlgMatrixC8M16N16U0S0 %5, i1 true, <16 x half> zeroinitializer, i32 8) ; LinAlgMatVecMul(matrix,isOutputSigned,inputVector,interpretation) %7 = call <16 x half> @dx.op.linAlgMatVecMulAdd.v16f16.mC8M16N16U0S0.v16f16.v16f16(i32 -2147483622, %dx.types.LinAlgMatrixC8M16N16U0S0 %5, i1 true, <16 x half> %6, i32 8, <16 x half> %6) ; LinAlgMatVecMulAdd(matrix,isOutputSigned,inputVector,inputInterpretation,biasVector) %8 = call <4 x i32> @dx.op.linAlgConvert.v4i32.v16i32(i32 -2147483618, <16 x i32> zeroinitializer, i32 5, i32 21) ; LinAlgConvert(inputVector,inputInterpretation,outputInterpretation) - %9 = call %dx.types.LinAlgMatrixC8M16N16U2S0 @dx.op.linAlgMatrixOuterProduct.mC8M16N16U2S0.v16f16.v16f16(i32 -2147483619, <16 x half> %7, <16 x half> %7) ; LinAlgMatrixOuterProduct(vectorA,vectorB) + %9 = call %dx.types.LinAlgMatrixC8M16N16U2S0 @dx.op.linAlgMatrixOuterProduct.mC8M16N16U2S0.v16f16.v16f16(i32 -2147483619, i1 true, <16 x half> %7, <16 x half> %7) ; LinAlgMatrixOuterProduct(isInputSigned,vectorA,vectorB) %10 = call %dx.types.Handle @dx.op.createHandleForLib.dx.types.Handle(i32 160, %dx.types.Handle %2) ; CreateHandleForLib(Resource) %11 = call %dx.types.Handle @dx.op.annotateHandle(i32 216, %dx.types.Handle %10, %dx.types.ResourceProperties { i32 4107, i32 0 }) ; AnnotateHandle(res,props) resource: RWByteAddressBuffer call void @dx.op.linAlgMatrixAccumulateToDescriptor.mC8M16N16U2S0(i32 -2147483621, %dx.types.LinAlgMatrixC8M16N16U2S0 %9, %dx.types.Handle %11, i32 0, i32 0, i32 4, i32 128) ; LinAlgMatrixAccumulateToDescriptor(matrix,handle,offset,stride,layout,align) @@ -79,7 +79,7 @@ define void @"\01?mainRG@@YAXXZ"() #0 { %20 = call %dx.types.LinAlgMatrixC8M16N16U2S1 @dx.op.linAlgMatrixAccumulate.mC8M16N16U2S1.mC8M16N16U2S1.mC8M16N16U0S1(i32 -2147483624, %dx.types.LinAlgMatrixC8M16N16U2S1 %19, %dx.types.LinAlgMatrixC8M16N16U0S1 %16) ; LinAlgMatrixAccumulate(matrixLHS,matrixRHS) %21 = call i32 @dx.op.linAlgMatrixLength.mC8M16N16U2S1(i32 -2147483632, %dx.types.LinAlgMatrixC8M16N16U2S1 %20) ; LinAlgMatrixLength(matrix) %22 = call i32 @dx.op.linAlgMatrixQueryAccumulatorLayout(i32 -2147483626) ; LinAlgMatrixQueryAccumulatorLayout() - %23 = call %dx.types.LinAlgMatrixC8M16N16U0S1 @dx.op.linAlgFillMatrix.mC8M16N16U0S1.f32(i32 -2147483636, float 0x40091EB860000000) ; LinAlgFillMatrix(value) + %23 = call %dx.types.LinAlgMatrixC8M16N16U0S1 @dx.op.linAlgFillMatrix.mC8M16N16U0S1.f32(i32 -2147483636, i1 true, float 0x40091EB860000000) ; LinAlgFillMatrix(isInputSigned,value) %24 = call i32 @dx.op.linAlgMatrixLength.mC8M16N16U0S1(i32 -2147483632, %dx.types.LinAlgMatrixC8M16N16U0S1 %23) ; LinAlgMatrixLength(matrix) %25 = call <2 x i32> @dx.op.linAlgMatrixGetCoordinate.mC8M16N16U0S1(i32 -2147483631, %dx.types.LinAlgMatrixC8M16N16U0S1 %23, i32 %24) ; LinAlgMatrixGetCoordinate(matrix,threadLocalIndex) %26 = call half @dx.op.linAlgMatrixGetElement.f16.mC8M16N16U0S1(i32 -2147483630, %dx.types.LinAlgMatrixC8M16N16U0S1 %23, i32 %24) ; LinAlgMatrixGetElement(matrix,threadLocalIndex) @@ -113,7 +113,7 @@ declare <16 x half> @dx.op.linAlgMatVecMulAdd.v16f16.mC8M16N16U0S0.v16f16.v16f16 declare <4 x i32> @dx.op.linAlgConvert.v4i32.v16i32(i32, <16 x i32>, i32, i32) #0 ; Function Attrs: nounwind -declare %dx.types.LinAlgMatrixC8M16N16U2S0 @dx.op.linAlgMatrixOuterProduct.mC8M16N16U2S0.v16f16.v16f16(i32, <16 x half>, <16 x half>) #0 +declare %dx.types.LinAlgMatrixC8M16N16U2S0 @dx.op.linAlgMatrixOuterProduct.mC8M16N16U2S0.v16f16.v16f16(i32, i1, <16 x half>, <16 x half>) #0 ; Function Attrs: nounwind declare void @dx.op.linAlgMatrixAccumulateToDescriptor.mC8M16N16U2S0(i32, %dx.types.LinAlgMatrixC8M16N16U2S0, %dx.types.Handle, i32, i32, i32, i32) #0 @@ -134,7 +134,7 @@ declare %dx.types.LinAlgMatrixC8M16N16U2S1 @dx.op.linAlgMatrixAccumulate.mC8M16N declare i32 @dx.op.linAlgMatrixLength.mC8M16N16U2S1(i32, %dx.types.LinAlgMatrixC8M16N16U2S1) #0 ; Function Attrs: nounwind -declare %dx.types.LinAlgMatrixC8M16N16U0S1 @dx.op.linAlgFillMatrix.mC8M16N16U0S1.f32(i32, float) #0 +declare %dx.types.LinAlgMatrixC8M16N16U0S1 @dx.op.linAlgFillMatrix.mC8M16N16U0S1.f32(i32, i1, float) #0 ; Function Attrs: nounwind declare i32 @dx.op.linAlgMatrixLength.mC8M16N16U0S1(i32, %dx.types.LinAlgMatrixC8M16N16U0S1) #0 diff --git a/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-stage-vs.ll b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-stage-vs.ll index 79e48c6328..5b67c435ed 100644 --- a/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-stage-vs.ll +++ b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-stage-vs.ll @@ -60,7 +60,7 @@ define void @mainVS() { %5 = call <16 x half> @dx.op.linAlgMatVecMul.v16f16.mC8M16N16U0S0.v16f16(i32 -2147483623, %dx.types.LinAlgMatrixC8M16N16U0S0 %4, i1 true, <16 x half> zeroinitializer, i32 8) ; LinAlgMatVecMul(matrix,isOutputSigned,inputVector,interpretation) %6 = call <16 x half> @dx.op.linAlgMatVecMulAdd.v16f16.mC8M16N16U0S0.v16f16.v16f16(i32 -2147483622, %dx.types.LinAlgMatrixC8M16N16U0S0 %4, i1 true, <16 x half> %5, i32 8, <16 x half> %5) ; LinAlgMatVecMulAdd(matrix,isOutputSigned,inputVector,inputInterpretation,biasVector) %7 = call <4 x i32> @dx.op.linAlgConvert.v4i32.v16i32(i32 -2147483618, <16 x i32> zeroinitializer, i32 5, i32 21) ; LinAlgConvert(inputVector,inputInterpretation,outputInterpretation) - %8 = call %dx.types.LinAlgMatrixC8M16N16U2S0 @dx.op.linAlgMatrixOuterProduct.mC8M16N16U2S0.v16f16.v16f16(i32 -2147483619, <16 x half> %6, <16 x half> %6) ; LinAlgMatrixOuterProduct(vectorA,vectorB) + %8 = call %dx.types.LinAlgMatrixC8M16N16U2S0 @dx.op.linAlgMatrixOuterProduct.mC8M16N16U2S0.v16f16.v16f16(i32 -2147483619, i1 true, <16 x half> %6, <16 x half> %6) ; LinAlgMatrixOuterProduct(isInputSigned,vectorA,vectorB) %9 = call %dx.types.Handle @dx.op.annotateHandle(i32 216, %dx.types.Handle %1, %dx.types.ResourceProperties { i32 4107, i32 0 }) ; AnnotateHandle(res,props) resource: RWByteAddressBuffer call void @dx.op.linAlgMatrixAccumulateToDescriptor.mC8M16N16U2S0(i32 -2147483621, %dx.types.LinAlgMatrixC8M16N16U2S0 %8, %dx.types.Handle %9, i32 0, i32 0, i32 4, i32 128) ; LinAlgMatrixAccumulateToDescriptor(matrix,handle,offset,stride,layout,align) %10 = call %dx.types.Handle @dx.op.annotateHandle(i32 216, %dx.types.Handle %1, %dx.types.ResourceProperties { i32 4107, i32 0 }) ; AnnotateHandle(res,props) resource: RWByteAddressBuffer @@ -72,7 +72,7 @@ define void @mainVS() { %15 = call %dx.types.LinAlgMatrixC8M16N16U2S1 @dx.op.linAlgMatrixAccumulate.mC8M16N16U2S1.mC8M16N16U2S1.mC8M16N16U0S1(i32 -2147483624, %dx.types.LinAlgMatrixC8M16N16U2S1 %14, %dx.types.LinAlgMatrixC8M16N16U0S1 %12) ; LinAlgMatrixAccumulate(matrixLHS,matrixRHS) %16 = call i32 @dx.op.linAlgMatrixLength.mC8M16N16U2S1(i32 -2147483632, %dx.types.LinAlgMatrixC8M16N16U2S1 %15) ; LinAlgMatrixLength(matrix) %17 = call i32 @dx.op.linAlgMatrixQueryAccumulatorLayout(i32 -2147483626) ; LinAlgMatrixQueryAccumulatorLayout() - %18 = call %dx.types.LinAlgMatrixC8M16N16U0S1 @dx.op.linAlgFillMatrix.mC8M16N16U0S1.f32(i32 -2147483636, float 0x40091EB860000000) ; LinAlgFillMatrix(value) + %18 = call %dx.types.LinAlgMatrixC8M16N16U0S1 @dx.op.linAlgFillMatrix.mC8M16N16U0S1.f32(i32 -2147483636, i1 true, float 0x40091EB860000000) ; LinAlgFillMatrix(isInputSigned,value) %19 = call i32 @dx.op.linAlgMatrixLength.mC8M16N16U0S1(i32 -2147483632, %dx.types.LinAlgMatrixC8M16N16U0S1 %18) ; LinAlgMatrixLength(matrix) %20 = call <2 x i32> @dx.op.linAlgMatrixGetCoordinate.mC8M16N16U0S1(i32 -2147483631, %dx.types.LinAlgMatrixC8M16N16U0S1 %18, i32 %19) ; LinAlgMatrixGetCoordinate(matrix,threadLocalIndex) %21 = call half @dx.op.linAlgMatrixGetElement.f16.mC8M16N16U0S1(i32 -2147483630, %dx.types.LinAlgMatrixC8M16N16U0S1 %18, i32 %19) ; LinAlgMatrixGetElement(matrix,threadLocalIndex) @@ -109,7 +109,7 @@ declare <16 x half> @dx.op.linAlgMatVecMulAdd.v16f16.mC8M16N16U0S0.v16f16.v16f16 declare <4 x i32> @dx.op.linAlgConvert.v4i32.v16i32(i32, <16 x i32>, i32, i32) #0 ; Function Attrs: nounwind -declare %dx.types.LinAlgMatrixC8M16N16U2S0 @dx.op.linAlgMatrixOuterProduct.mC8M16N16U2S0.v16f16.v16f16(i32, <16 x half>, <16 x half>) #0 +declare %dx.types.LinAlgMatrixC8M16N16U2S0 @dx.op.linAlgMatrixOuterProduct.mC8M16N16U2S0.v16f16.v16f16(i32, i1, <16 x half>, <16 x half>) #0 ; Function Attrs: nounwind declare void @dx.op.linAlgMatrixAccumulateToDescriptor.mC8M16N16U2S0(i32, %dx.types.LinAlgMatrixC8M16N16U2S0, %dx.types.Handle, i32, i32, i32, i32) #0 @@ -133,7 +133,7 @@ declare i32 @dx.op.linAlgMatrixLength.mC8M16N16U2S1(i32, %dx.types.LinAlgMatrixC declare i32 @dx.op.linAlgMatrixQueryAccumulatorLayout(i32) #0 ; Function Attrs: nounwind -declare %dx.types.LinAlgMatrixC8M16N16U0S1 @dx.op.linAlgFillMatrix.mC8M16N16U0S1.f32(i32, float) #0 +declare %dx.types.LinAlgMatrixC8M16N16U0S1 @dx.op.linAlgFillMatrix.mC8M16N16U0S1.f32(i32, i1, float) #0 ; Function Attrs: nounwind declare i32 @dx.op.linAlgMatrixLength.mC8M16N16U0S1(i32, %dx.types.LinAlgMatrixC8M16N16U0S1) #0 diff --git a/tools/clang/test/SemaHLSL/hlsl/linalg/builtins/matrix-builtins-ast.hlsl b/tools/clang/test/SemaHLSL/hlsl/linalg/builtins/matrix-builtins-ast.hlsl index 55a8a6eab7..93acd750c0 100644 --- a/tools/clang/test/SemaHLSL/hlsl/linalg/builtins/matrix-builtins-ast.hlsl +++ b/tools/clang/test/SemaHLSL/hlsl/linalg/builtins/matrix-builtins-ast.hlsl @@ -19,12 +19,13 @@ void main() { // CHECK-NEXT: AvailabilityAttr {{.*}} Implicit 6.10 0 0 "" __builtin_LinAlg_CopyConvertMatrix(mat2, mat1, true); -// CHECK: FunctionDecl {{.*}} implicit used __builtin_LinAlg_FillMatrix 'void (__builtin_LinAlgMatrix & {{.*}}, unsigned int)' extern +// CHECK: FunctionDecl {{.*}} implicit used __builtin_LinAlg_FillMatrix 'void (__builtin_LinAlgMatrix & {{.*}}, bool, unsigned int)' extern // CHECK-NEXT: ParmVarDecl {{.*}} ret '__builtin_LinAlgMatrix &&__restrict {{.*}}' +// CHECK-NEXT: ParmVarDecl {{.*}} isInputSigned 'bool' // CHECK-NEXT: ParmVarDecl {{.*}} value 'unsigned int' // CHECK-NEXT: HLSLIntrinsicAttr {{.*}} Implicit "op" "" 402 // CHECK-NEXT: AvailabilityAttr {{.*}} Implicit 6.10 0 0 "" - __builtin_LinAlg_FillMatrix(mat1, 15); + __builtin_LinAlg_FillMatrix(mat1, true, 15); // CHECK: FunctionDecl {{.*}} implicit used __builtin_LinAlg_MatrixAccumulate 'void (__builtin_LinAlgMatrix {{.*}}, __builtin_LinAlgMatrix {{.*}}, __builtin_LinAlgMatrix {{.*}})' extern // CHECK-NEXT: ParmVarDecl {{.*}} matrixC '__builtin_LinAlgMatrix {{.*}}' @@ -124,15 +125,16 @@ void main() { // CHECK-NEXT: AvailabilityAttr {{.*}} Implicit 6.10 0 0 "" __builtin_LinAlg_MatrixMatrixMultiplyAccumulate(mat1, mat2, mat3, mat1); -// CHECK: FunctionDecl {{.*}} implicit used __builtin_LinAlg_MatrixOuterProduct 'void (__builtin_LinAlgMatrix {{.*}}, vector, vector)' extern +// CHECK: FunctionDecl {{.*}} implicit used __builtin_LinAlg_MatrixOuterProduct 'void (__builtin_LinAlgMatrix {{.*}}, bool, vector, vector)' extern // CHECK-NEXT: ParmVarDecl {{.*}} ret '__builtin_LinAlgMatrix {{.*}}' +// CHECK-NEXT: ParmVarDecl {{.*}} isInputSigned 'bool' // CHECK-NEXT: ParmVarDecl {{.*}} vecA 'vector':'vector' // CHECK-NEXT: ParmVarDecl {{.*}} vecB 'vector':'vector' // CHECK-NEXT: HLSLIntrinsicAttr {{.*}} Implicit "op" "" 417 // CHECK-NEXT: AvailabilityAttr {{.*}} Implicit 6.10 0 0 "" int4 vecA = {1,2,3,4}; int4 vecB = {1,2,3,4}; - __builtin_LinAlg_MatrixOuterProduct(mat1, vecA, vecB); + __builtin_LinAlg_MatrixOuterProduct(mat1, true, vecA, vecB); // CHECK: FunctionDecl {{.*}} implicit used __builtin_LinAlg_MatrixQueryAccumulatorLayout 'unsigned int ()' extern // CHECK-NEXT: HLSLIntrinsicAttr {{.*}} Implicit "op" "" 414 diff --git a/tools/clang/test/SemaHLSL/hlsl/linalg/builtins/stage-errors.hlsl b/tools/clang/test/SemaHLSL/hlsl/linalg/builtins/stage-errors.hlsl index 25b4ec5171..4b70526863 100644 --- a/tools/clang/test/SemaHLSL/hlsl/linalg/builtins/stage-errors.hlsl +++ b/tools/clang/test/SemaHLSL/hlsl/linalg/builtins/stage-errors.hlsl @@ -30,7 +30,7 @@ void CallFunction() #endif #ifdef MATRIX_FILL - #define DO_FUNC __builtin_LinAlg_FillMatrix(mat1, 15); + #define DO_FUNC __builtin_LinAlg_FillMatrix(mat1, true, 15); #endif #ifdef MATRIX_GET_COORDINATE @@ -82,7 +82,7 @@ void CallFunction() // then the test will fail with "saw unexpected diagnostic" uint layout = __builtin_LinAlg_MatrixQueryAccumulatorLayout(); __builtin_LinAlg_MatrixLoadFromDescriptor(mat1, buf, 5, 5, 5, 4); - __builtin_LinAlg_MatrixOuterProduct(mat1, vecA, vecB); + __builtin_LinAlg_MatrixOuterProduct(mat1, true, vecA, vecB); __builtin_LinAlg_MatrixAccumulateToDescriptor(mat1, buf, 1, 2, 3, 4); __builtin_LinAlg_MatrixVectorMultiply(vecA, mat1, true, vecB, 1); __builtin_LinAlg_MatrixVectorMultiplyAdd(vecA, mat1, true, vecB, 2, vecC); diff --git a/tools/clang/test/SemaHLSL/hlsl/linalg/builtins/unavailable_pre_sm610.hlsl b/tools/clang/test/SemaHLSL/hlsl/linalg/builtins/unavailable_pre_sm610.hlsl index 771d53ec14..6506daa21c 100644 --- a/tools/clang/test/SemaHLSL/hlsl/linalg/builtins/unavailable_pre_sm610.hlsl +++ b/tools/clang/test/SemaHLSL/hlsl/linalg/builtins/unavailable_pre_sm610.hlsl @@ -16,7 +16,7 @@ void main() { __builtin_LinAlg_CopyConvertMatrix(mat, mat2, true); // expected-error@+1{{intrinsic __builtin_LinAlg_FillMatrix potentially used by ''main'' requires shader model 6.10 or greater}} - __builtin_LinAlg_FillMatrix(mat, 1); + __builtin_LinAlg_FillMatrix(mat, true, 1); // expected-error@+1{{intrinsic __builtin_LinAlg_MatrixAccumulate potentially used by ''main'' requires shader model 6.10 or greater}} __builtin_LinAlg_MatrixAccumulate(mat2, mat, mat); @@ -43,7 +43,7 @@ void main() { __builtin_LinAlg_MatrixMatrixMultiplyAccumulate(mat, mat2, mat2, mat); // expected-error@+1{{intrinsic __builtin_LinAlg_MatrixOuterProduct potentially used by ''main'' requires shader model 6.10 or greater}} - __builtin_LinAlg_MatrixOuterProduct(mat, vec1, vec2); + __builtin_LinAlg_MatrixOuterProduct(mat, true, vec1, vec2); // expected-error@+1{{intrinsic __builtin_LinAlg_MatrixQueryAccumulatorLayout potentially used by ''main'' requires shader model 6.10 or greater}} uint layout = __builtin_LinAlg_MatrixQueryAccumulatorLayout(); diff --git a/tools/clang/unittests/HLSLExec/LinAlgTests.cpp b/tools/clang/unittests/HLSLExec/LinAlgTests.cpp index 2d5fb83692..62798e497b 100644 --- a/tools/clang/unittests/HLSLExec/LinAlgTests.cpp +++ b/tools/clang/unittests/HLSLExec/LinAlgTests.cpp @@ -1604,15 +1604,19 @@ static std::string buildCompilerArgs(const MatrixParams &Params, switch (Params.CompType) { case ComponentType::F16: SS << " -DELEM_TYPE=half"; + SS << " -DIS_SIGNED=true"; break; case ComponentType::F32: SS << " -DELEM_TYPE=float"; + SS << " -DIS_SIGNED=true"; break; case ComponentType::I32: SS << " -DELEM_TYPE=int"; + SS << " -DIS_SIGNED=true"; break; case ComponentType::U32: SS << " -DELEM_TYPE=uint"; + SS << " -DIS_SIGNED=false"; break; default: VERIFY_IS_TRUE(false, "Unsupported LinAlg component type"); @@ -4748,7 +4752,7 @@ static const char SplatStoreShader[] = R"( __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(COMP_TYPE, M_DIM, N_DIM, USE, SCOPE)]] Mat; - __builtin_LinAlg_FillMatrix(Mat, FILL_VALUE); + __builtin_LinAlg_FillMatrix(Mat, IS_SIGNED, FILL_VALUE); __builtin_LinAlg_MatrixStoreToDescriptor( Mat, Output, 0, STRIDE, LAYOUT, 128); } @@ -5896,12 +5900,12 @@ static const char MatMatMulShader[] = R"( __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(COMP_TYPE, M_DIM, K_DIM, USE_A, SCOPE)]] MatA; - __builtin_LinAlg_FillMatrix(MatA, A_FILL); + __builtin_LinAlg_FillMatrix(MatA, IS_SIGNED, A_FILL); __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(COMP_TYPE, K_DIM, N_DIM, USE_B, SCOPE)]] MatB; - __builtin_LinAlg_FillMatrix(MatB, B_FILL); + __builtin_LinAlg_FillMatrix(MatB, IS_SIGNED, B_FILL); __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(COMP_TYPE, M_DIM, N_DIM, USE_ACC, SCOPE)]] @@ -5988,17 +5992,17 @@ static const char MatMatMulAccumShader[] = R"( __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(COMP_TYPE, M_DIM, K_DIM, USE_A, SCOPE)]] MatA; - __builtin_LinAlg_FillMatrix(MatA, A_FILL); + __builtin_LinAlg_FillMatrix(MatA, IS_SIGNED, A_FILL); __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(COMP_TYPE, K_DIM, N_DIM, USE_B, SCOPE)]] MatB; - __builtin_LinAlg_FillMatrix(MatB, B_FILL); + __builtin_LinAlg_FillMatrix(MatB, IS_SIGNED, B_FILL); __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(COMP_TYPE, M_DIM, N_DIM, USE_ACC, SCOPE)]] MatC; - __builtin_LinAlg_FillMatrix(MatC, C_FILL); + __builtin_LinAlg_FillMatrix(MatC, IS_SIGNED, C_FILL); __builtin_LinAlg_MatrixMatrixMultiplyAccumulate(MatC, MatA, MatB, MatC); @@ -6086,12 +6090,12 @@ static const char MatAccumShader[] = R"( __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(COMP_TYPE, M_DIM, N_DIM, USE_ACC, SCOPE)]] MatLHS; - __builtin_LinAlg_FillMatrix(MatLHS, LHS_FILL); + __builtin_LinAlg_FillMatrix(MatLHS, IS_SIGNED, LHS_FILL); __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(COMP_TYPE, M_DIM, N_DIM, USE_A, SCOPE)]] MatRHS; - __builtin_LinAlg_FillMatrix(MatRHS, RHS_FILL); + __builtin_LinAlg_FillMatrix(MatRHS, IS_SIGNED, RHS_FILL); __builtin_LinAlg_MatrixAccumulate(MatLHS, MatLHS, MatRHS); @@ -8060,7 +8064,7 @@ static const char OuterProductShader[] = R"( __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(COMP_TYPE, M_DIM, N_DIM, USE, SCOPE_THREAD)]] Mat; - __builtin_LinAlg_MatrixOuterProduct(Mat, VecA, VecB); + __builtin_LinAlg_MatrixOuterProduct(Mat, IS_SIGNED, VecA, VecB); // Outer product accumulators are stored in the OuterProductOptimal layout // Matching the dx::linalg header's thread-scoped @@ -8250,17 +8254,17 @@ static const char QueryAccumLayoutShader[] = R"( [[__LinAlgMatrix_Attributes( COMP_TYPE, M_DIM, N_DIM, USE_ACC, SCOPE)]] Accumulator; - __builtin_LinAlg_FillMatrix(Accumulator, 2.0); + __builtin_LinAlg_FillMatrix(Accumulator, true, 2.0); __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(COMP_TYPE, M_DIM, N_DIM, USE_A, SCOPE)]] MatrixA; - __builtin_LinAlg_FillMatrix(MatrixA, 3.0); + __builtin_LinAlg_FillMatrix(MatrixA, true, 3.0); __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(COMP_TYPE, M_DIM, N_DIM, USE_B, SCOPE)]] MatrixB; - __builtin_LinAlg_FillMatrix(MatrixB, 7.0); + __builtin_LinAlg_FillMatrix(MatrixB, true, 7.0); __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes( @@ -8481,7 +8485,7 @@ static const char StoreMemoryShader[] = R"( __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(COMP_TYPE, M_DIM, N_DIM, USE, SCOPE)]] Mat; - __builtin_LinAlg_FillMatrix(Mat, FILL_VALUE); + __builtin_LinAlg_FillMatrix(Mat, IS_SIGNED, FILL_VALUE); __builtin_LinAlg_MatrixStoreToMemory( Mat, GsData, OFFSET / ELEM_SIZE, STRIDE / ELEM_SIZE, LAYOUT); @@ -8574,7 +8578,7 @@ static const char AccumulateMemoryShader[] = R"( __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(COMP_TYPE, M_DIM, N_DIM, USE, SCOPE)]] Mat; - __builtin_LinAlg_FillMatrix(Mat, FILL_VALUE); + __builtin_LinAlg_FillMatrix(Mat, IS_SIGNED, FILL_VALUE); __builtin_LinAlg_MatrixAccumulateToMemory( Mat, GsData, OFFSET / ELEM_SIZE, STRIDE / ELEM_SIZE, LAYOUT); @@ -9437,7 +9441,7 @@ static const char GroupSharedAccumulateShader[] = R"( __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(COMP_TYPE, M_DIM, N_DIM, USE, SCOPE)]] Mat; - __builtin_LinAlg_FillMatrix(Mat, 0); + __builtin_LinAlg_FillMatrix(Mat, IS_SIGNED, 0); for (uint I = 0; I < __builtin_LinAlg_MatrixLength(Mat); ++I) { uint2 Coord = __builtin_LinAlg_MatrixGetCoordinate(Mat, I); __builtin_LinAlg_MatrixSetElement( diff --git a/utils/hct/gen_intrin_main.txt b/utils/hct/gen_intrin_main.txt index a44d1145bf..b6af387bce 100644 --- a/utils/hct/gen_intrin_main.txt +++ b/utils/hct/gen_intrin_main.txt @@ -389,7 +389,7 @@ uint [[min_sm=6.8,max_sm=6.9]] GetRemainingRecursionLevels(); // LinAlg intrinsics -void [[min_sm=6.10]] __builtin_LinAlg_FillMatrix(out LinAlgMatrix ret, in numeric value); +void [[min_sm=6.10]] __builtin_LinAlg_FillMatrix(out LinAlgMatrix ret, in bool isInputSigned, in numeric value); void [[min_sm=6.10]] __builtin_LinAlg_CopyConvertMatrix(out LinAlgMatrix ret, in LinAlgMatrix source, in bool transpose); void [[min_sm=6.10]] __builtin_LinAlg_MatrixLoadFromDescriptor(out LinAlgMatrix ret, in ByteAddressBuffer buf, in uint offset, in uint stride, in uint layout, in uint align); void [[min_sm=6.10]] __builtin_LinAlg_MatrixLoadFromDescriptor(out LinAlgMatrix ret, in RWByteAddressBuffer buf, in uint offset, in uint stride, in uint layout, in uint align); @@ -408,7 +408,7 @@ void [[min_sm=6.10]] __builtin_LinAlg_MatrixVectorMultiply(out LinAlg ret, in void [[min_sm=6.10]] __builtin_LinAlg_MatrixVectorMultiplyAdd(out LinAlg ret, in LinAlgMatrix mat, in bool isOutputSigned, in LinAlg input, in uint inputInterp, in LinAlg bias); void [[min_sm=6.10]] __builtin_LinAlg_MatrixAccumulateToDescriptor(in LinAlgMatrix matrix, in RWByteAddressBuffer buf, in uint offset, in uint stride, in uint layout, in uint align); void [[min_sm=6.10]] __builtin_LinAlg_MatrixAccumulateToMemory(in LinAlgMatrix matrix, groupshared LinAlg<>[] memory, in uint offset, in uint stride, in uint layout); -void [[min_sm=6.10]] __builtin_LinAlg_MatrixOuterProduct(out LinAlgMatrix ret, in LinAlg vecA, in LinAlg vecB); +void [[min_sm=6.10]] __builtin_LinAlg_MatrixOuterProduct(out LinAlgMatrix ret, in bool isInputSigned, in LinAlg vecA, in LinAlg vecB); void [[min_sm=6.10]] __builtin_LinAlg_Convert(out LinAlg ret, in LinAlg vec, in uint input_interp, in uint output_interp); void [[min_sm=6.10]] __builtin_LinAlg_VectorAccumulateToDescriptor(in RWByteAddressBuffer buf, in uint offset, in uint align, in LinAlg<> vec); diff --git a/utils/hct/hctdb.py b/utils/hct/hctdb.py index fadce93ae2..812e205ae1 100644 --- a/utils/hct/hctdb.py +++ b/utils/hct/hctdb.py @@ -6281,7 +6281,10 @@ def populate_ExperimentalOps(self): "", [ db_dxil_param(0, "$x0", "", "resulting matrix"), - db_dxil_param(2, "$x1", "value", "value to fill matrix with"), + db_dxil_param( + 2, "i1", "isInputSigned", "true if input is signed" + ), + db_dxil_param(3, "$x1", "value", "value to fill matrix with"), ], ) @@ -6573,8 +6576,11 @@ def populate_ExperimentalOps(self): "", [ db_dxil_param(0, "$x0", "", "resulting matrix"), - db_dxil_param(2, "$x1", "vectorA", "M dim vector"), - db_dxil_param(3, "$x2", "vectorB", "N dim vector"), + db_dxil_param( + 2, "i1", "isInputSigned", "true if input is signed" + ), + db_dxil_param(3, "$x1", "vectorA", "M dim vector"), + db_dxil_param(4, "$x2", "vectorB", "N dim vector"), ], ) From 76cac9aff2031e32a844271b689e425f43317a92 Mon Sep 17 00:00:00 2001 From: Ashley Coleman Date: Tue, 22 Sep 2026 14:39:35 -0600 Subject: [PATCH 2/3] cleanup --- lib/DxilValidation/DxilValidation.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/DxilValidation/DxilValidation.cpp b/lib/DxilValidation/DxilValidation.cpp index 20e61d57aa..43dac48c3d 100644 --- a/lib/DxilValidation/DxilValidation.cpp +++ b/lib/DxilValidation/DxilValidation.cpp @@ -2032,9 +2032,7 @@ static void ValidateLinAlgMatrixOuterProduct(CallInst *CI, DxilInst_LinAlgMatrixOuterProduct Op(CI); VectorType *AVecTy = cast(Op.get_vectorA()->getType()); VectorType *BVecTy = cast(Op.get_vectorB()->getType()); - Type *SignednessTy = - AVecTy->getElementType()->isFloatingPointTy() ? AVecTy : BVecTy; - ValidateLinAlgIsInputSigned(CI, Op.get_isInputSigned(), SignednessTy, ValCtx, + ValidateLinAlgIsInputSigned(CI, Op.get_isInputSigned(), AVecTy, ValCtx, "LinAlgMatrixOuterProduct"); std::optional RetMat = GetCheckedLATT(CI->getType(), ValCtx); From 7726a9bf46c09b5071670d1d20a4ee4a90e16265 Mon Sep 17 00:00:00 2001 From: Ashley Coleman Date: Tue, 22 Sep 2026 15:17:25 -0600 Subject: [PATCH 3/3] address comments --- .../clang/unittests/HLSLExec/LinAlgTests.cpp | 43 +++++++++++-------- 1 file changed, 25 insertions(+), 18 deletions(-) diff --git a/tools/clang/unittests/HLSLExec/LinAlgTests.cpp b/tools/clang/unittests/HLSLExec/LinAlgTests.cpp index 62798e497b..5adc7e0e44 100644 --- a/tools/clang/unittests/HLSLExec/LinAlgTests.cpp +++ b/tools/clang/unittests/HLSLExec/LinAlgTests.cpp @@ -1601,22 +1601,23 @@ static std::string buildCompilerArgs(const MatrixParams &Params, SS << " -DLAYOUT=" << static_cast(Params.Layout); SS << " -DELEM_SIZE=" << static_cast(elementSize(Params.CompType)); SS << " -DNUMTHREADS=" << Params.NumThreads; + SS << " -DFILL_INPUT_IS_SIGNED=true"; switch (Params.CompType) { case ComponentType::F16: SS << " -DELEM_TYPE=half"; - SS << " -DIS_SIGNED=true"; + SS << " -DELEM_IS_SIGNED=true"; break; case ComponentType::F32: SS << " -DELEM_TYPE=float"; - SS << " -DIS_SIGNED=true"; + SS << " -DELEM_IS_SIGNED=true"; break; case ComponentType::I32: SS << " -DELEM_TYPE=int"; - SS << " -DIS_SIGNED=true"; + SS << " -DELEM_IS_SIGNED=true"; break; case ComponentType::U32: SS << " -DELEM_TYPE=uint"; - SS << " -DIS_SIGNED=false"; + SS << " -DELEM_IS_SIGNED=false"; break; default: VERIFY_IS_TRUE(false, "Unsupported LinAlg component type"); @@ -3088,10 +3089,16 @@ void LinAlgCPUOracleTests::TypedMatrixBufferRoundTrip() { Params.Layout = MatrixLayout::RowMajor; Params.NumThreads = 4; Params.CompType = ComponentType::I32; - VERIFY_IS_TRUE(buildCompilerArgs(Params).find(" -DELEM_TYPE=int") != + std::string I32Args = buildCompilerArgs(Params); + VERIFY_IS_TRUE(I32Args.find(" -DELEM_TYPE=int") != std::string::npos); + VERIFY_IS_TRUE(I32Args.find(" -DELEM_IS_SIGNED=true") != std::string::npos); + VERIFY_IS_TRUE(I32Args.find(" -DFILL_INPUT_IS_SIGNED=true") != std::string::npos); Params.CompType = ComponentType::U32; - VERIFY_IS_TRUE(buildCompilerArgs(Params).find(" -DELEM_TYPE=uint") != + std::string U32Args = buildCompilerArgs(Params); + VERIFY_IS_TRUE(U32Args.find(" -DELEM_TYPE=uint") != std::string::npos); + VERIFY_IS_TRUE(U32Args.find(" -DELEM_IS_SIGNED=false") != std::string::npos); + VERIFY_IS_TRUE(U32Args.find(" -DFILL_INPUT_IS_SIGNED=true") != std::string::npos); } @@ -4752,7 +4759,7 @@ static const char SplatStoreShader[] = R"( __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(COMP_TYPE, M_DIM, N_DIM, USE, SCOPE)]] Mat; - __builtin_LinAlg_FillMatrix(Mat, IS_SIGNED, FILL_VALUE); + __builtin_LinAlg_FillMatrix(Mat, FILL_INPUT_IS_SIGNED, FILL_VALUE); __builtin_LinAlg_MatrixStoreToDescriptor( Mat, Output, 0, STRIDE, LAYOUT, 128); } @@ -5900,12 +5907,12 @@ static const char MatMatMulShader[] = R"( __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(COMP_TYPE, M_DIM, K_DIM, USE_A, SCOPE)]] MatA; - __builtin_LinAlg_FillMatrix(MatA, IS_SIGNED, A_FILL); + __builtin_LinAlg_FillMatrix(MatA, FILL_INPUT_IS_SIGNED, A_FILL); __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(COMP_TYPE, K_DIM, N_DIM, USE_B, SCOPE)]] MatB; - __builtin_LinAlg_FillMatrix(MatB, IS_SIGNED, B_FILL); + __builtin_LinAlg_FillMatrix(MatB, FILL_INPUT_IS_SIGNED, B_FILL); __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(COMP_TYPE, M_DIM, N_DIM, USE_ACC, SCOPE)]] @@ -5992,17 +5999,17 @@ static const char MatMatMulAccumShader[] = R"( __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(COMP_TYPE, M_DIM, K_DIM, USE_A, SCOPE)]] MatA; - __builtin_LinAlg_FillMatrix(MatA, IS_SIGNED, A_FILL); + __builtin_LinAlg_FillMatrix(MatA, FILL_INPUT_IS_SIGNED, A_FILL); __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(COMP_TYPE, K_DIM, N_DIM, USE_B, SCOPE)]] MatB; - __builtin_LinAlg_FillMatrix(MatB, IS_SIGNED, B_FILL); + __builtin_LinAlg_FillMatrix(MatB, FILL_INPUT_IS_SIGNED, B_FILL); __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(COMP_TYPE, M_DIM, N_DIM, USE_ACC, SCOPE)]] MatC; - __builtin_LinAlg_FillMatrix(MatC, IS_SIGNED, C_FILL); + __builtin_LinAlg_FillMatrix(MatC, FILL_INPUT_IS_SIGNED, C_FILL); __builtin_LinAlg_MatrixMatrixMultiplyAccumulate(MatC, MatA, MatB, MatC); @@ -6090,12 +6097,12 @@ static const char MatAccumShader[] = R"( __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(COMP_TYPE, M_DIM, N_DIM, USE_ACC, SCOPE)]] MatLHS; - __builtin_LinAlg_FillMatrix(MatLHS, IS_SIGNED, LHS_FILL); + __builtin_LinAlg_FillMatrix(MatLHS, FILL_INPUT_IS_SIGNED, LHS_FILL); __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(COMP_TYPE, M_DIM, N_DIM, USE_A, SCOPE)]] MatRHS; - __builtin_LinAlg_FillMatrix(MatRHS, IS_SIGNED, RHS_FILL); + __builtin_LinAlg_FillMatrix(MatRHS, FILL_INPUT_IS_SIGNED, RHS_FILL); __builtin_LinAlg_MatrixAccumulate(MatLHS, MatLHS, MatRHS); @@ -8064,7 +8071,7 @@ static const char OuterProductShader[] = R"( __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(COMP_TYPE, M_DIM, N_DIM, USE, SCOPE_THREAD)]] Mat; - __builtin_LinAlg_MatrixOuterProduct(Mat, IS_SIGNED, VecA, VecB); + __builtin_LinAlg_MatrixOuterProduct(Mat, ELEM_IS_SIGNED, VecA, VecB); // Outer product accumulators are stored in the OuterProductOptimal layout // Matching the dx::linalg header's thread-scoped @@ -8485,7 +8492,7 @@ static const char StoreMemoryShader[] = R"( __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(COMP_TYPE, M_DIM, N_DIM, USE, SCOPE)]] Mat; - __builtin_LinAlg_FillMatrix(Mat, IS_SIGNED, FILL_VALUE); + __builtin_LinAlg_FillMatrix(Mat, FILL_INPUT_IS_SIGNED, FILL_VALUE); __builtin_LinAlg_MatrixStoreToMemory( Mat, GsData, OFFSET / ELEM_SIZE, STRIDE / ELEM_SIZE, LAYOUT); @@ -8578,7 +8585,7 @@ static const char AccumulateMemoryShader[] = R"( __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(COMP_TYPE, M_DIM, N_DIM, USE, SCOPE)]] Mat; - __builtin_LinAlg_FillMatrix(Mat, IS_SIGNED, FILL_VALUE); + __builtin_LinAlg_FillMatrix(Mat, FILL_INPUT_IS_SIGNED, FILL_VALUE); __builtin_LinAlg_MatrixAccumulateToMemory( Mat, GsData, OFFSET / ELEM_SIZE, STRIDE / ELEM_SIZE, LAYOUT); @@ -9441,7 +9448,7 @@ static const char GroupSharedAccumulateShader[] = R"( __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(COMP_TYPE, M_DIM, N_DIM, USE, SCOPE)]] Mat; - __builtin_LinAlg_FillMatrix(Mat, IS_SIGNED, 0); + __builtin_LinAlg_FillMatrix(Mat, FILL_INPUT_IS_SIGNED, 0); for (uint I = 0; I < __builtin_LinAlg_MatrixLength(Mat); ++I) { uint2 Coord = __builtin_LinAlg_MatrixGetCoordinate(Mat, I); __builtin_LinAlg_MatrixSetElement(