From 62df3ea622c17c94e794e5b1dfa4b635e60547c9 Mon Sep 17 00:00:00 2001 From: Helena Kotas Date: Wed, 11 Mar 2026 14:26:31 -0700 Subject: [PATCH 1/3] [SM6.10] Combine LinAlg Matrix unavailable_pre_sm610.hlsl tests into a single file --- .../unavailable_pre_sm610.hlsl | 10 --- .../fillmatrix/unavailable_pre_sm610.hlsl | 9 --- .../unavailable_pre_sm610.hlsl | 10 --- .../unavailable_pre_sm610.hlsl | 11 ---- .../unavailable_pre_sm610.hlsl | 9 --- .../unavailable_pre_sm610.hlsl | 10 --- .../matrixlength/unavailable_pre_sm610.hlsl | 9 --- .../unavailable_pre_sm610.hlsl | 11 ---- .../unavailable_pre_sm610.hlsl | 10 --- .../unavailable_pre_sm610.hlsl | 10 --- .../unavailable_pre_sm610.hlsl | 11 ---- .../unavailable_pre_sm610.hlsl | 7 --- .../unavailable_pre_sm610.hlsl | 9 --- .../unavailable_pre_sm610.hlsl | 11 ---- .../unavailable_pre_sm610.hlsl | 11 ---- .../unavailable_pre_sm610.hlsl | 12 ---- .../builtins/unavailable_pre_sm610.hlsl | 63 +++++++++++++++++++ 17 files changed, 63 insertions(+), 160 deletions(-) delete mode 100644 tools/clang/test/SemaHLSL/hlsl/linalg/builtins/copyconvertmatrix/unavailable_pre_sm610.hlsl delete mode 100644 tools/clang/test/SemaHLSL/hlsl/linalg/builtins/fillmatrix/unavailable_pre_sm610.hlsl delete mode 100644 tools/clang/test/SemaHLSL/hlsl/linalg/builtins/matrixaccumulate/unavailable_pre_sm610.hlsl delete mode 100644 tools/clang/test/SemaHLSL/hlsl/linalg/builtins/matrixaccumulatetodescriptor/unavailable_pre_sm610.hlsl delete mode 100644 tools/clang/test/SemaHLSL/hlsl/linalg/builtins/matrixgetcoordinate/unavailable_pre_sm610.hlsl delete mode 100644 tools/clang/test/SemaHLSL/hlsl/linalg/builtins/matrixgetelement/unavailable_pre_sm610.hlsl delete mode 100644 tools/clang/test/SemaHLSL/hlsl/linalg/builtins/matrixlength/unavailable_pre_sm610.hlsl delete mode 100644 tools/clang/test/SemaHLSL/hlsl/linalg/builtins/matrixloadfromdescriptor/unavailable_pre_sm610.hlsl delete mode 100644 tools/clang/test/SemaHLSL/hlsl/linalg/builtins/matrixmatrixmultiply/unavailable_pre_sm610.hlsl delete mode 100644 tools/clang/test/SemaHLSL/hlsl/linalg/builtins/matrixmatrixmultiplyaccumulate/unavailable_pre_sm610.hlsl delete mode 100644 tools/clang/test/SemaHLSL/hlsl/linalg/builtins/matrixouterproduct/unavailable_pre_sm610.hlsl delete mode 100644 tools/clang/test/SemaHLSL/hlsl/linalg/builtins/matrixqueryaccumulatorlayout/unavailable_pre_sm610.hlsl delete mode 100644 tools/clang/test/SemaHLSL/hlsl/linalg/builtins/matrixsetelement/unavailable_pre_sm610.hlsl delete mode 100644 tools/clang/test/SemaHLSL/hlsl/linalg/builtins/matrixstoretodescriptor/unavailable_pre_sm610.hlsl delete mode 100644 tools/clang/test/SemaHLSL/hlsl/linalg/builtins/matrixvectormultiply/unavailable_pre_sm610.hlsl delete mode 100644 tools/clang/test/SemaHLSL/hlsl/linalg/builtins/matrixvectormultiplyadd/unavailable_pre_sm610.hlsl create mode 100644 tools/clang/test/SemaHLSL/hlsl/linalg/builtins/unavailable_pre_sm610.hlsl diff --git a/tools/clang/test/SemaHLSL/hlsl/linalg/builtins/copyconvertmatrix/unavailable_pre_sm610.hlsl b/tools/clang/test/SemaHLSL/hlsl/linalg/builtins/copyconvertmatrix/unavailable_pre_sm610.hlsl deleted file mode 100644 index be69e99b1e..0000000000 --- a/tools/clang/test/SemaHLSL/hlsl/linalg/builtins/copyconvertmatrix/unavailable_pre_sm610.hlsl +++ /dev/null @@ -1,10 +0,0 @@ -// RUN: %dxc -I %hlsl_headers -T cs_6_9 -E main %s -verify - -[numthreads(4,1,1)] -void main() { - __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(1, 5, 4, 0, 0)]] mat; - __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(1, 1, 1, 1, 1)]] mat2; - - // expected-error@+1{{intrinsic __builtin_LinAlg_CopyConvertMatrix potentially used by ''main'' requires shader model 6.10 or greater}} - __builtin_LinAlg_CopyConvertMatrix(mat, mat2, true); -} diff --git a/tools/clang/test/SemaHLSL/hlsl/linalg/builtins/fillmatrix/unavailable_pre_sm610.hlsl b/tools/clang/test/SemaHLSL/hlsl/linalg/builtins/fillmatrix/unavailable_pre_sm610.hlsl deleted file mode 100644 index 48f01ae493..0000000000 --- a/tools/clang/test/SemaHLSL/hlsl/linalg/builtins/fillmatrix/unavailable_pre_sm610.hlsl +++ /dev/null @@ -1,9 +0,0 @@ -// RUN: %dxc -I %hlsl_headers -T cs_6_9 -E main %s -verify - -[numthreads(4,1,1)] -void main() { - __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(1, 5, 4, 0, 0)]] mat; - - // expected-error@+1{{intrinsic __builtin_LinAlg_FillMatrix potentially used by ''main'' requires shader model 6.10 or greater}} - __builtin_LinAlg_FillMatrix(mat, 1); -} diff --git a/tools/clang/test/SemaHLSL/hlsl/linalg/builtins/matrixaccumulate/unavailable_pre_sm610.hlsl b/tools/clang/test/SemaHLSL/hlsl/linalg/builtins/matrixaccumulate/unavailable_pre_sm610.hlsl deleted file mode 100644 index 0610e4723a..0000000000 --- a/tools/clang/test/SemaHLSL/hlsl/linalg/builtins/matrixaccumulate/unavailable_pre_sm610.hlsl +++ /dev/null @@ -1,10 +0,0 @@ -// RUN: %dxc -I %hlsl_headers -T cs_6_9 -E main %s -verify - -[numthreads(4,1,1)] -void main() { - __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(1, 5, 4, 0, 0)]] mat; - __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(1, 1, 1, 1, 1)]] mat2; - - // expected-error@+1{{intrinsic __builtin_LinAlg_MatrixAccumulate potentially used by ''main'' requires shader model 6.10 or greater}} - __builtin_LinAlg_MatrixAccumulate(mat2, mat, mat); -} diff --git a/tools/clang/test/SemaHLSL/hlsl/linalg/builtins/matrixaccumulatetodescriptor/unavailable_pre_sm610.hlsl b/tools/clang/test/SemaHLSL/hlsl/linalg/builtins/matrixaccumulatetodescriptor/unavailable_pre_sm610.hlsl deleted file mode 100644 index 5126e3631e..0000000000 --- a/tools/clang/test/SemaHLSL/hlsl/linalg/builtins/matrixaccumulatetodescriptor/unavailable_pre_sm610.hlsl +++ /dev/null @@ -1,11 +0,0 @@ -// RUN: %dxc -I %hlsl_headers -T cs_6_9 -E main %s -verify - -RWByteAddressBuffer outbuf; - -[numthreads(4,1,1)] -void main() { - __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(1, 5, 4, 0, 0)]] mat; - - // expected-error@+1{{intrinsic __builtin_LinAlg_MatrixAccumulateToDescriptor potentially used by ''main'' requires shader model 6.10 or greater}} - __builtin_LinAlg_MatrixAccumulateToDescriptor(mat, outbuf, 9, 8, 7); -} diff --git a/tools/clang/test/SemaHLSL/hlsl/linalg/builtins/matrixgetcoordinate/unavailable_pre_sm610.hlsl b/tools/clang/test/SemaHLSL/hlsl/linalg/builtins/matrixgetcoordinate/unavailable_pre_sm610.hlsl deleted file mode 100644 index d82824d511..0000000000 --- a/tools/clang/test/SemaHLSL/hlsl/linalg/builtins/matrixgetcoordinate/unavailable_pre_sm610.hlsl +++ /dev/null @@ -1,9 +0,0 @@ -// RUN: %dxc -I %hlsl_headers -T cs_6_9 -E main %s -verify - -[numthreads(4,1,1)] -void main() { - __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(1, 5, 4, 0, 0)]] mat; - - // expected-error@+1{{intrinsic __builtin_LinAlg_MatrixGetCoordinate potentially used by ''main'' requires shader model 6.10 or greater}} - uint2 coord = __builtin_LinAlg_MatrixGetCoordinate(mat, 0); -} diff --git a/tools/clang/test/SemaHLSL/hlsl/linalg/builtins/matrixgetelement/unavailable_pre_sm610.hlsl b/tools/clang/test/SemaHLSL/hlsl/linalg/builtins/matrixgetelement/unavailable_pre_sm610.hlsl deleted file mode 100644 index 2c714efe33..0000000000 --- a/tools/clang/test/SemaHLSL/hlsl/linalg/builtins/matrixgetelement/unavailable_pre_sm610.hlsl +++ /dev/null @@ -1,10 +0,0 @@ -// RUN: %dxc -I %hlsl_headers -T cs_6_9 -E main %s -verify - -[numthreads(4,1,1)] -void main() { - __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(1, 5, 4, 0, 0)]] mat; - uint elem; - - // expected-error@+1{{intrinsic __builtin_LinAlg_MatrixGetElement potentially used by ''main'' requires shader model 6.10 or greater}} - __builtin_LinAlg_MatrixGetElement(elem, mat, 0); -} diff --git a/tools/clang/test/SemaHLSL/hlsl/linalg/builtins/matrixlength/unavailable_pre_sm610.hlsl b/tools/clang/test/SemaHLSL/hlsl/linalg/builtins/matrixlength/unavailable_pre_sm610.hlsl deleted file mode 100644 index 90da58d600..0000000000 --- a/tools/clang/test/SemaHLSL/hlsl/linalg/builtins/matrixlength/unavailable_pre_sm610.hlsl +++ /dev/null @@ -1,9 +0,0 @@ -// RUN: %dxc -I %hlsl_headers -T cs_6_9 -E main %s -verify - -[numthreads(4,1,1)] -void main() { - __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(1, 5, 4, 0, 0)]] mat; - - // expected-error@+1{{intrinsic __builtin_LinAlg_MatrixLength potentially used by ''main'' requires shader model 6.10 or greater}} - __builtin_LinAlg_MatrixLength(mat); -} diff --git a/tools/clang/test/SemaHLSL/hlsl/linalg/builtins/matrixloadfromdescriptor/unavailable_pre_sm610.hlsl b/tools/clang/test/SemaHLSL/hlsl/linalg/builtins/matrixloadfromdescriptor/unavailable_pre_sm610.hlsl deleted file mode 100644 index 126b213a05..0000000000 --- a/tools/clang/test/SemaHLSL/hlsl/linalg/builtins/matrixloadfromdescriptor/unavailable_pre_sm610.hlsl +++ /dev/null @@ -1,11 +0,0 @@ -// RUN: %dxc -I %hlsl_headers -T cs_6_9 -E main %s -verify - -RWByteAddressBuffer inbuf; - -[numthreads(4,1,1)] -void main() { - __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(1, 5, 4, 0, 0)]] mat; - - // expected-error@+1{{intrinsic __builtin_LinAlg_MatrixLoadFromDescriptor potentially used by ''main'' requires shader model 6.10 or greater}} - __builtin_LinAlg_MatrixLoadFromDescriptor(mat, inbuf, 1, 1, 1); -} diff --git a/tools/clang/test/SemaHLSL/hlsl/linalg/builtins/matrixmatrixmultiply/unavailable_pre_sm610.hlsl b/tools/clang/test/SemaHLSL/hlsl/linalg/builtins/matrixmatrixmultiply/unavailable_pre_sm610.hlsl deleted file mode 100644 index 12a11c0332..0000000000 --- a/tools/clang/test/SemaHLSL/hlsl/linalg/builtins/matrixmatrixmultiply/unavailable_pre_sm610.hlsl +++ /dev/null @@ -1,10 +0,0 @@ -// RUN: %dxc -I %hlsl_headers -T cs_6_9 -E main %s -verify - -[numthreads(4,1,1)] -void main() { - __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(1, 5, 4, 0, 0)]] mat; - __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(1, 1, 1, 1, 1)]] mat2; - - // expected-error@+1{{intrinsic __builtin_LinAlg_MatrixMatrixMultiply potentially used by ''main'' requires shader model 6.10 or greater}} - __builtin_LinAlg_MatrixMatrixMultiply(mat2, mat, mat); -} diff --git a/tools/clang/test/SemaHLSL/hlsl/linalg/builtins/matrixmatrixmultiplyaccumulate/unavailable_pre_sm610.hlsl b/tools/clang/test/SemaHLSL/hlsl/linalg/builtins/matrixmatrixmultiplyaccumulate/unavailable_pre_sm610.hlsl deleted file mode 100644 index c0984bd1bb..0000000000 --- a/tools/clang/test/SemaHLSL/hlsl/linalg/builtins/matrixmatrixmultiplyaccumulate/unavailable_pre_sm610.hlsl +++ /dev/null @@ -1,10 +0,0 @@ -// RUN: %dxc -I %hlsl_headers -T cs_6_9 -E main %s -verify - -[numthreads(4,1,1)] -void main() { - __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(1, 5, 4, 0, 0)]] mat; - __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(1, 1, 1, 1, 1)]] mat2; - - // expected-error@+1{{intrinsic __builtin_LinAlg_MatrixMatrixMultiplyAccumulate potentially used by ''main'' requires shader model 6.10 or greater}} - __builtin_LinAlg_MatrixMatrixMultiplyAccumulate(mat, mat2, mat2, mat); -} diff --git a/tools/clang/test/SemaHLSL/hlsl/linalg/builtins/matrixouterproduct/unavailable_pre_sm610.hlsl b/tools/clang/test/SemaHLSL/hlsl/linalg/builtins/matrixouterproduct/unavailable_pre_sm610.hlsl deleted file mode 100644 index f996ebedf3..0000000000 --- a/tools/clang/test/SemaHLSL/hlsl/linalg/builtins/matrixouterproduct/unavailable_pre_sm610.hlsl +++ /dev/null @@ -1,11 +0,0 @@ -// RUN: %dxc -I %hlsl_headers -T cs_6_9 -E main %s -verify - -[numthreads(4,1,1)] -void main() { - __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(1, 5, 4, 0, 0)]] mat; - float4 lhs = {1,2,3,4}; - float4 rhs = {4,3,2,1}; - - // expected-error@+1{{intrinsic __builtin_LinAlg_MatrixOuterProduct potentially used by ''main'' requires shader model 6.10 or greater}} - __builtin_LinAlg_MatrixOuterProduct(mat, lhs, rhs); -} diff --git a/tools/clang/test/SemaHLSL/hlsl/linalg/builtins/matrixqueryaccumulatorlayout/unavailable_pre_sm610.hlsl b/tools/clang/test/SemaHLSL/hlsl/linalg/builtins/matrixqueryaccumulatorlayout/unavailable_pre_sm610.hlsl deleted file mode 100644 index 1b38126cd4..0000000000 --- a/tools/clang/test/SemaHLSL/hlsl/linalg/builtins/matrixqueryaccumulatorlayout/unavailable_pre_sm610.hlsl +++ /dev/null @@ -1,7 +0,0 @@ -// RUN: %dxc -I %hlsl_headers -T cs_6_9 -E main %s -verify - -[numthreads(4,1,1)] -void main() { - // 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/test/SemaHLSL/hlsl/linalg/builtins/matrixsetelement/unavailable_pre_sm610.hlsl b/tools/clang/test/SemaHLSL/hlsl/linalg/builtins/matrixsetelement/unavailable_pre_sm610.hlsl deleted file mode 100644 index cc8f750a2d..0000000000 --- a/tools/clang/test/SemaHLSL/hlsl/linalg/builtins/matrixsetelement/unavailable_pre_sm610.hlsl +++ /dev/null @@ -1,9 +0,0 @@ -// RUN: %dxc -I %hlsl_headers -T cs_6_9 -E main %s -verify - -[numthreads(4,1,1)] -void main() { - __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(1, 5, 4, 0, 0)]] mat; - - // expected-error@+1{{intrinsic __builtin_LinAlg_MatrixSetElement potentially used by ''main'' requires shader model 6.10 or greater}} - __builtin_LinAlg_MatrixSetElement(mat, mat, 1, 1); -} diff --git a/tools/clang/test/SemaHLSL/hlsl/linalg/builtins/matrixstoretodescriptor/unavailable_pre_sm610.hlsl b/tools/clang/test/SemaHLSL/hlsl/linalg/builtins/matrixstoretodescriptor/unavailable_pre_sm610.hlsl deleted file mode 100644 index 3ab3d16668..0000000000 --- a/tools/clang/test/SemaHLSL/hlsl/linalg/builtins/matrixstoretodescriptor/unavailable_pre_sm610.hlsl +++ /dev/null @@ -1,11 +0,0 @@ -// RUN: %dxc -I %hlsl_headers -T cs_6_9 -E main %s -verify - -RWByteAddressBuffer outbuf; - -[numthreads(4,1,1)] -void main() { - __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(1, 5, 4, 0, 0)]] mat; - - // expected-error@+1{{intrinsic __builtin_LinAlg_MatrixStoreToDescriptor potentially used by ''main'' requires shader model 6.10 or greater}} - __builtin_LinAlg_MatrixStoreToDescriptor(mat, outbuf, 1, 1, 1); -} diff --git a/tools/clang/test/SemaHLSL/hlsl/linalg/builtins/matrixvectormultiply/unavailable_pre_sm610.hlsl b/tools/clang/test/SemaHLSL/hlsl/linalg/builtins/matrixvectormultiply/unavailable_pre_sm610.hlsl deleted file mode 100644 index 805b8b3d66..0000000000 --- a/tools/clang/test/SemaHLSL/hlsl/linalg/builtins/matrixvectormultiply/unavailable_pre_sm610.hlsl +++ /dev/null @@ -1,11 +0,0 @@ -// RUN: %dxc -I %hlsl_headers -T cs_6_9 -E main %s -verify - -[numthreads(4,1,1)] -void main() { - __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(1, 5, 4, 0, 0)]] mat; - float4 input = {1,2,3,4}; - float4 result; - - // expected-error@+1{{intrinsic __builtin_LinAlg_MatrixVectorMultiply potentially used by ''main'' requires shader model 6.10 or greater}} - __builtin_LinAlg_MatrixVectorMultiply(result, mat, input, 1); -} diff --git a/tools/clang/test/SemaHLSL/hlsl/linalg/builtins/matrixvectormultiplyadd/unavailable_pre_sm610.hlsl b/tools/clang/test/SemaHLSL/hlsl/linalg/builtins/matrixvectormultiplyadd/unavailable_pre_sm610.hlsl deleted file mode 100644 index ab078999b0..0000000000 --- a/tools/clang/test/SemaHLSL/hlsl/linalg/builtins/matrixvectormultiplyadd/unavailable_pre_sm610.hlsl +++ /dev/null @@ -1,12 +0,0 @@ -// RUN: %dxc -I %hlsl_headers -T cs_6_9 -E main %s -verify - -[numthreads(4,1,1)] -void main() { - __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(1, 5, 4, 0, 0)]] mat; - float4 input = {1,2,3,4}; - float4 bias = {4,3,2,1}; - float4 result; - - // expected-error@+1{{intrinsic __builtin_LinAlg_MatrixVectorMultiplyAdd potentially used by ''main'' requires shader model 6.10 or greater}} - __builtin_LinAlg_MatrixVectorMultiplyAdd(result, mat, input, 1, bias, 0); -} 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 new file mode 100644 index 0000000000..b794b925c7 --- /dev/null +++ b/tools/clang/test/SemaHLSL/hlsl/linalg/builtins/unavailable_pre_sm610.hlsl @@ -0,0 +1,63 @@ +// RUN: %dxc -I %hlsl_headers -T cs_6_9 -E main %s -verify + +RWByteAddressBuffer buf; + +[numthreads(4,1,1)] +void main() { + __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(1, 5, 4, 0, 0)]] mat; + __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(1, 1, 1, 1, 1)]] mat2; + float4 vec1 = {1,2,3,4}; + float4 vec2 = {4,3,2,1}; + float4 result; + uint elem; + + // expected-error@+1{{intrinsic __builtin_LinAlg_CopyConvertMatrix potentially used by ''main'' requires shader model 6.10 or greater}} + __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); + + // expected-error@+1{{intrinsic __builtin_LinAlg_MatrixAccumulate potentially used by ''main'' requires shader model 6.10 or greater}} + __builtin_LinAlg_MatrixAccumulate(mat2, mat, mat); + + // expected-error@+1{{intrinsic __builtin_LinAlg_MatrixAccumulateToDescriptor potentially used by ''main'' requires shader model 6.10 or greater}} + __builtin_LinAlg_MatrixAccumulateToDescriptor(mat, buf, 9, 8, 7); + + // expected-error@+1{{intrinsic __builtin_LinAlg_MatrixGetCoordinate potentially used by ''main'' requires shader model 6.10 or greater}} + uint2 coord = __builtin_LinAlg_MatrixGetCoordinate(mat, 0); + + // expected-error@+1{{intrinsic __builtin_LinAlg_MatrixGetElement potentially used by ''main'' requires shader model 6.10 or greater}} + __builtin_LinAlg_MatrixGetElement(elem, mat, 0); + + // expected-error@+1{{intrinsic __builtin_LinAlg_MatrixLength potentially used by ''main'' requires shader model 6.10 or greater}} + __builtin_LinAlg_MatrixLength(mat); + + // expected-error@+1{{intrinsic __builtin_LinAlg_MatrixLoadFromDescriptor potentially used by ''main'' requires shader model 6.10 or greater}} + __builtin_LinAlg_MatrixLoadFromDescriptor(mat, buf, 1, 1, 1); + + // expected-error@+1{{intrinsic __builtin_LinAlg_MatrixMatrixMultiply potentially used by ''main'' requires shader model 6.10 or greater}} + __builtin_LinAlg_MatrixMatrixMultiply(mat2, mat, mat); + + // expected-error@+1{{intrinsic __builtin_LinAlg_MatrixMatrixMultiplyAccumulate potentially used by ''main'' requires shader model 6.10 or greater}} + __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); + + // expected-error@+1{{intrinsic __builtin_LinAlg_MatrixQueryAccumulatorLayout potentially used by ''main'' requires shader model 6.10 or greater}} + uint layout = __builtin_LinAlg_MatrixQueryAccumulatorLayout(); + + // expected-error@+1{{intrinsic __builtin_LinAlg_MatrixSetElement potentially used by ''main'' requires shader model 6.10 or greater}} + __builtin_LinAlg_MatrixSetElement(mat, mat, 1, 1); + + // expected-error@+1{{intrinsic __builtin_LinAlg_MatrixStoreToDescriptor potentially used by ''main'' requires shader model 6.10 or greater}} + __builtin_LinAlg_MatrixStoreToDescriptor(mat, buf, 1, 1, 1); + + // expected-error@+1{{intrinsic __builtin_LinAlg_MatrixVectorMultiply potentially used by ''main'' requires shader model 6.10 or greater}} + __builtin_LinAlg_MatrixVectorMultiply(result, mat, vec1, 1); + + // expected-error@+1{{intrinsic __builtin_LinAlg_MatrixVectorMultiplyAdd potentially used by ''main'' requires shader model 6.10 or greater}} + __builtin_LinAlg_MatrixVectorMultiplyAdd(result, mat, vec1, 1, vec2, 0); + + // FIXME: add remaining 3 ops +} From 6173bf1471255fbf552c0a0908aad08188a458fd Mon Sep 17 00:00:00 2001 From: Helena Kotas Date: Wed, 11 Mar 2026 14:36:57 -0700 Subject: [PATCH 2/3] Remove unnecessary include --- .../SemaHLSL/hlsl/linalg/builtins/unavailable_pre_sm610.hlsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 b794b925c7..7c03d618e7 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 @@ -1,4 +1,4 @@ -// RUN: %dxc -I %hlsl_headers -T cs_6_9 -E main %s -verify +// RUN: %dxc -T cs_6_9 -E main %s -verify RWByteAddressBuffer buf; From 3cded7bd4ad60684a9869e8460175230e487de0a Mon Sep 17 00:00:00 2001 From: Helena Kotas Date: Fri, 13 Mar 2026 14:13:14 -0700 Subject: [PATCH 3/3] Add remaining 3 ops --- .../unavailable_pre_sm610.hlsl | 11 ----------- .../matrixloadfrommemory/unavailable_pre_sm610.hlsl | 11 ----------- .../matrixstoretomemory/unavailable_pre_sm610.hlsl | 11 ----------- .../hlsl/linalg/builtins/unavailable_pre_sm610.hlsl | 10 +++++++++- 4 files changed, 9 insertions(+), 34 deletions(-) delete mode 100644 tools/clang/test/SemaHLSL/hlsl/linalg/builtins/matrixaccumulatetomemory/unavailable_pre_sm610.hlsl delete mode 100644 tools/clang/test/SemaHLSL/hlsl/linalg/builtins/matrixloadfrommemory/unavailable_pre_sm610.hlsl delete mode 100644 tools/clang/test/SemaHLSL/hlsl/linalg/builtins/matrixstoretomemory/unavailable_pre_sm610.hlsl diff --git a/tools/clang/test/SemaHLSL/hlsl/linalg/builtins/matrixaccumulatetomemory/unavailable_pre_sm610.hlsl b/tools/clang/test/SemaHLSL/hlsl/linalg/builtins/matrixaccumulatetomemory/unavailable_pre_sm610.hlsl deleted file mode 100644 index e5a9ea4895..0000000000 --- a/tools/clang/test/SemaHLSL/hlsl/linalg/builtins/matrixaccumulatetomemory/unavailable_pre_sm610.hlsl +++ /dev/null @@ -1,11 +0,0 @@ -// RUN: %dxc -T cs_6_9 -HV 202x -E main %s -verify - -groupshared float SharedArr[64]; - -[numthreads(4,1,1)] -void main() { - __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(4, 5, 4, 1, 2)]] mat; - - // expected-error@+1{{intrinsic __builtin_LinAlg_MatrixAccumulateToMemory potentially used by ''main'' requires shader model 6.10 or greater}} - __builtin_LinAlg_MatrixAccumulateToMemory(mat, SharedArr, 0, 0, 0); -} diff --git a/tools/clang/test/SemaHLSL/hlsl/linalg/builtins/matrixloadfrommemory/unavailable_pre_sm610.hlsl b/tools/clang/test/SemaHLSL/hlsl/linalg/builtins/matrixloadfrommemory/unavailable_pre_sm610.hlsl deleted file mode 100644 index d8472ad92b..0000000000 --- a/tools/clang/test/SemaHLSL/hlsl/linalg/builtins/matrixloadfrommemory/unavailable_pre_sm610.hlsl +++ /dev/null @@ -1,11 +0,0 @@ -// RUN: %dxc -T cs_6_9 -HV 202x -E main %s -verify - -groupshared float SharedArr[64]; - -[numthreads(4,1,1)] -void main() { - __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(4, 5, 4, 1, 2)]] mat; - - // expected-error@+1{{intrinsic __builtin_LinAlg_MatrixLoadFromMemory potentially used by ''main'' requires shader model 6.10 or greater}} - __builtin_LinAlg_MatrixLoadFromMemory(mat, SharedArr, 0, 0, 0); -} diff --git a/tools/clang/test/SemaHLSL/hlsl/linalg/builtins/matrixstoretomemory/unavailable_pre_sm610.hlsl b/tools/clang/test/SemaHLSL/hlsl/linalg/builtins/matrixstoretomemory/unavailable_pre_sm610.hlsl deleted file mode 100644 index d3468a2a02..0000000000 --- a/tools/clang/test/SemaHLSL/hlsl/linalg/builtins/matrixstoretomemory/unavailable_pre_sm610.hlsl +++ /dev/null @@ -1,11 +0,0 @@ -// RUN: %dxc -T cs_6_9 -HV 202x -E main %s -verify - -groupshared float SharedArr[64]; - -[numthreads(4,1,1)] -void main() { - __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(4, 5, 4, 1, 2)]] mat; - - // expected-error@+1{{intrinsic __builtin_LinAlg_MatrixStoreToMemory potentially used by ''main'' requires shader model 6.10 or greater}} - __builtin_LinAlg_MatrixStoreToMemory(mat, SharedArr, 0, 0, 0); -} 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 7c03d618e7..55caf3199e 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 @@ -1,6 +1,7 @@ // RUN: %dxc -T cs_6_9 -E main %s -verify RWByteAddressBuffer buf; +groupshared float SharedArr[64]; [numthreads(4,1,1)] void main() { @@ -59,5 +60,12 @@ void main() { // expected-error@+1{{intrinsic __builtin_LinAlg_MatrixVectorMultiplyAdd potentially used by ''main'' requires shader model 6.10 or greater}} __builtin_LinAlg_MatrixVectorMultiplyAdd(result, mat, vec1, 1, vec2, 0); - // FIXME: add remaining 3 ops + // expected-error@+1{{intrinsic __builtin_LinAlg_MatrixAccumulateToMemory potentially used by ''main'' requires shader model 6.10 or greater}} + __builtin_LinAlg_MatrixAccumulateToMemory(mat, SharedArr, 0, 0, 0); + + // expected-error@+1{{intrinsic __builtin_LinAlg_MatrixLoadFromMemory potentially used by ''main'' requires shader model 6.10 or greater}} + __builtin_LinAlg_MatrixLoadFromMemory(mat, SharedArr, 0, 0, 0); + + // expected-error@+1{{intrinsic __builtin_LinAlg_MatrixStoreToMemory potentially used by ''main'' requires shader model 6.10 or greater}} + __builtin_LinAlg_MatrixStoreToMemory(mat, SharedArr, 0, 0, 0); }