Skip to content

[SM6.10] Fix numeric types allowed in LinAlg intrins#8465

Merged
V-FEXrt merged 1 commit into
microsoft:mainfrom
V-FEXrt:issue-8271-LinAlg-intrin
May 21, 2026
Merged

[SM6.10] Fix numeric types allowed in LinAlg intrins#8465
V-FEXrt merged 1 commit into
microsoft:mainfrom
V-FEXrt:issue-8271-LinAlg-intrin

Conversation

@V-FEXrt
Copy link
Copy Markdown
Collaborator

@V-FEXrt V-FEXrt commented May 21, 2026

Fixes #8271

Use LinAlg as the intrinsic type instead of numeric for LinAlg intrinsics and update the LinAlg to match current allowed types

Comment thread tools/clang/lib/Sema/SemaHLSL.cpp
AR_BASIC_UINT16, AR_BASIC_INT8_4PACKED,
AR_BASIC_UINT8_4PACKED, AR_BASIC_NOCAST,
AR_BASIC_UNKNOWN};
AR_BASIC_FLOAT64, AR_BASIC_LITERAL_INT,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually don't think we want/need to keep AR_BASIC_LITERAL_INT, or AR_BASIC_LITERAL_FLOAT here.

Also, AR_BASIC_FLOAT32_PARTIAL_PRECISION is half when in min-precision mode that maps to ordinary float. I don't think it's necessary to support that, but it probably doesn't hurt.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix will be up in a couple minutes

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay so removing AR_BASIC_LITERAL_INT caused some test failures. Specifically, in SetElement

dxc/DirectXShaderCompiler/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixsetelement/nominal.hlsl:21:3: note: candidate function not viable: no known conversion from 'literal int' to 'unsigned int' for 4th argument
  __builtin_LinAlg_MatrixSetElement(mat2, mat1, 1, 5);

I think this would be fine in real use cases because of the header implementation but given that is a slightly larger change/longer discussion I'm going to take your offer to punt :)

Copy link
Copy Markdown
Contributor

@tex3d tex3d left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could address tightening of the g_LinAlgCT in the future. For now, this looks good.

@V-FEXrt
Copy link
Copy Markdown
Collaborator Author

V-FEXrt commented May 21, 2026

#8468 issue to track follow up fixes/discussions

@V-FEXrt V-FEXrt merged commit 14696d1 into microsoft:main May 21, 2026
14 checks passed
@github-project-automation github-project-automation Bot moved this from New to Done in HLSL Roadmap May 21, 2026
@V-FEXrt V-FEXrt deleted the issue-8271-LinAlg-intrin branch May 21, 2026 19:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[SM6.10] Replace numeric with LingAlg<> in gen_intrin_main

3 participants