Skip to content

[0035] Fix LinAlg MatrixMulAccumulate - #791

Merged
Ashley Coleman (V-FEXrt) merged 1 commit into
microsoft:mainfrom
V-FEXrt:0035-mul-accumulate
Feb 13, 2026
Merged

Ashley Coleman (V-FEXrt) merged 1 commit into
microsoft:mainfrom
V-FEXrt:0035-mul-accumulate

Conversation

@V-FEXrt

Copy link
Copy Markdown
Collaborator

Fixes #781

@V-FEXrt

Copy link
Copy Markdown
Collaborator Author

@hekota Helena Kotas (hekota) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM!

Ashley Coleman (V-FEXrt) added a commit to microsoft/DirectXShaderCompiler that referenced this pull request Feb 13, 2026
microsoft/hlsl-specs#791 splits the MulOp
operation into two distinct ops. Update the implementation to
reflect that
@V-FEXrt
Ashley Coleman (V-FEXrt) merged commit 5896507 into microsoft:main Feb 13, 2026
5 checks passed
@github-project-automation github-project-automation Bot moved this to Triaged in HLSL Triage Feb 13, 2026
@V-FEXrt
Ashley Coleman (V-FEXrt) deleted the 0035-mul-accumulate branch February 13, 2026 18:19
Ashley Coleman (V-FEXrt) added a commit to microsoft/DirectXShaderCompiler that referenced this pull request Feb 13, 2026
microsoft/hlsl-specs#791 splits the MulOp
operation into two distinct ops. Update the implementation to
reflect that
Ashley Coleman (V-FEXrt) added a commit to microsoft/DirectXShaderCompiler that referenced this pull request Feb 14, 2026
microsoft/hlsl-specs#791 splits the MulOp
operation into two distinct ops. Update the implementation to
reflect that
Ashley Coleman (V-FEXrt) added a commit to microsoft/DirectXShaderCompiler that referenced this pull request Feb 14, 2026
microsoft/hlsl-specs#791 splits the MulOp
operation into two distinct ops. Update the implementation to
reflect that
Ashley Coleman (V-FEXrt) added a commit to microsoft/DirectXShaderCompiler that referenced this pull request Feb 14, 2026
microsoft/hlsl-specs#791 splits the MulOp
operation into two distinct ops. Update the implementation to
reflect that
Must be called from wave-uniform control flow.

```llvm
declare %dx.types.LinAlgMatrix<mangling> @dx.op.linAlgMatrixMultiplyAccumulate.[MatTyR].[MatTyA].[MatTyB].[MatTyC](

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'm late, but I encountered this same problem and came up with my own solution. The only way it differed is that I placed C first so it could have just a 3 way overload since return and C need to be the same anyway with only minor change to the overload checking logic instead of having to allow out of order extended overloads.

So:

declare %dx.types.LinAlgMatrix<mangling> @dx.op.linAlgMatrixMultiplyAccumulate.[MatTyC].[MatTyA].[MatTyB](
  immarg i32,                        ; opcode
  %dx.types.LinAlgMatrix<mangling>   ; matrix C
  %dx.types.LinAlgMatrix<mangling>,  ; matrix A
  %dx.types.LinAlgMatrix<mangling>   ; matrix B
)

This still requires some change to the script logic to allow reusing an extended overload, but I think that we should allow such reuse just as we do for singular overloads

Ashley Coleman (V-FEXrt) added a commit to microsoft/DirectXShaderCompiler that referenced this pull request Feb 17, 2026
microsoft/hlsl-specs#791 splits the MulOp
operation into two distinct ops. Update the implementation to
reflect that
Ashley Coleman (V-FEXrt) added a commit to microsoft/DirectXShaderCompiler that referenced this pull request Feb 17, 2026
microsoft/hlsl-specs#791 splits the MulOp
operation into two distinct ops. Update the implementation to
reflect that
Ashley Coleman (V-FEXrt) added a commit to microsoft/DirectXShaderCompiler that referenced this pull request Feb 18, 2026
microsoft/hlsl-specs#791 splits the MulOp
operation into two distinct ops. Update the implementation to
reflect that
Ashley Coleman (V-FEXrt) added a commit to microsoft/DirectXShaderCompiler that referenced this pull request Feb 18, 2026
microsoft/hlsl-specs#791 splits the MulOp
operation into two distinct ops. Update the implementation to
reflect that
Ashley Coleman (V-FEXrt) added a commit to microsoft/DirectXShaderCompiler that referenced this pull request Feb 18, 2026
microsoft/hlsl-specs#791 splits the MulOp
operation into two distinct ops. Update the implementation to
reflect that
Ashley Coleman (V-FEXrt) added a commit to microsoft/DirectXShaderCompiler that referenced this pull request Feb 19, 2026
microsoft/hlsl-specs#791 splits the MulOp
operation into two distinct ops. Update the implementation to
reflect that
Ashley Coleman (V-FEXrt) added a commit to microsoft/DirectXShaderCompiler that referenced this pull request Feb 20, 2026
microsoft/hlsl-specs#791 splits the MulOp
operation into two distinct ops. Update the implementation to
reflect that
Ashley Coleman (V-FEXrt) added a commit to microsoft/DirectXShaderCompiler that referenced this pull request Feb 20, 2026
microsoft/hlsl-specs#791 splits the MulOp
operation into two distinct ops. Update the placeholder code to reflect
that.

Interesting changes are in `gen_intrin_main`, `hctdb.py`, and
`HLOperationLower.cpp`. The rest of the code is generated code
Lucie Choi (luciechoi) pushed a commit to luciechoi/DirectXShaderCompiler that referenced this pull request Feb 20, 2026
microsoft/hlsl-specs#791 splits the MulOp
operation into two distinct ops. Update the placeholder code to reflect
that.

Interesting changes are in `gen_intrin_main`, `hctdb.py`, and
`HLOperationLower.cpp`. The rest of the code is generated code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Triaged

Development

Successfully merging this pull request may close these issues.

[0035] Mat Mat Mul with Accumulation doesn't have anything to accumulate into

4 participants