Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MSL: Work around internal compiler error from mulhi. #2392

Merged
merged 1 commit into from
Oct 15, 2024

Conversation

squidbus
Copy link
Contributor

Proposed fix for #2385

This introduces a helper function to perform Op*MulExtended instructions. The helper takes the following template parameters:

  • The type of the result container.
  • The type of the operands and result container fields. This is needed because OpSMulExtended can be used with unsigned types but will perform signed multiplication. The inputs are cast to signed to perform correct multiplication, and the results need to be cast back to unsigned afterwards in order to satisfy Metal/C++ rules for initializer list types.
  • The type the function will use to multiply arguments, based on the instruction.

Updated the tests for these changes, and the shader in the linked issue now compiles without error.

@CLAassistant
Copy link

CLAassistant commented Oct 14, 2024

CLA assistant check
All committers have signed the CLA.

@HansKristian-Work
Copy link
Contributor

On a quick glance this is fine, it can also be considered a cleanup, which is nice. I'll look at it in more detail tomorrow.

@HansKristian-Work HansKristian-Work merged commit 80cdb5e into KhronosGroup:main Oct 15, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants