You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description
When using the dot intrinsic to calculate a dot product, the generated code will use a signed mad operator instead of the umad operator that the mul intrinsic uses when it amounts to a dot product.
Steps to Reproduce
Just pass unsigned integer vectors of 2 or more elements to the dot intrinsic.
Switching the defined FUNC between dot and mul in this godbolt link will show the difference in output: https://godbolt.org/z/Pz6a5a38r
Actual Behavior
You can see that it will change between calling IMad with opcode 48 and UMad with opcode 49.
Environment
DXC version 1.8.2407
Host Operating System macos 14.7.2
The text was updated successfully, but these errors were encountered:
Dot products on uint vectors were not using the unsigned mad operations when they were formed using the dot intrinsic though they did when it was the effect of the mul intrinsic. While such operations aren't very common and less common still are the cases where the unsigned variant makes a difference, this was an internal inconsistency as well as with the clang implementation. This corrects the problem using a dummy op for udot similar to how other intrinsics address similar problems to pass the unsigned information to operation lowering.
Incidentally adds unsigned notations to all the mul intrinsic entries. This is a non-functional change as any one overload that specifies an unsigned variant will apply for all of them, but it is less confusing than having half of them do it and the other half not.
The test verifies the output of a few dot operations with sint, float, and uint types for both dot and mul intrinsics
Fixesmicrosoft#7058
Description
When using the
dot
intrinsic to calculate a dot product, the generated code will use a signed mad operator instead of the umad operator that themul
intrinsic uses when it amounts to a dot product.Steps to Reproduce
Just pass unsigned integer vectors of 2 or more elements to the
dot
intrinsic.Switching the defined FUNC between
dot
andmul
in this godbolt link will show the difference in output: https://godbolt.org/z/Pz6a5a38rActual Behavior
You can see that it will change between calling IMad with opcode 48 and UMad with opcode 49.
Environment
The text was updated successfully, but these errors were encountered: