Skip to content

Conversation

@pow2clk
Copy link
Collaborator

@pow2clk pow2clk commented Jan 27, 2025

Cherry-pick of #7060 to release-1.8.2502

And/or intrinsics were set to allow any parameters, which is consistent
with the behavior of the && and || operators they were meant to replace,
however this meant that if they were passed floating point values, those
values would be applied to the binary and/or operands, which isn't
allowed. Instead, they should be converted to booleans to be consistent
with the behavior of && and ||. This can be done simply by restricting
the parameters to booleans which forces the appropriate conversions.
Adds tests for for using bools, ints, and floats in scalars, different
sized vectors, and matrices as parameters to or and and.

Fixes: #7057
Fixes: #6995
(cherry picked from commit 25faa88)

Greg Roth added 2 commits January 27, 2025 15:33
And/or intrinsics were set to allow any parameters, which is consistent
with the behavior of the && and || operators they were meant to replace,
however this meant that if they were passed floating point values, those
values would be applied to the binary and/or operands, which isn't
allowed. Instead, they should be converted to booleans to be consistent
with the behavior of && and ||. This can be done simply by restricting
the parameters to booleans which forces the appropriate conversions.
Adds tests for for using bools, ints, and floats in scalars, different
sized vectors, and matrices as parameters to or and and.

Fixes: microsoft#7057
FIxes: microsoft#6995
(cherry picked from commit 25faa88)
@pow2clk pow2clk requested a review from a team as a code owner January 27, 2025 22:35
@pow2clk pow2clk enabled auto-merge (squash) January 27, 2025 23:24
@pow2clk pow2clk merged commit ef1472a into microsoft:main Jan 27, 2025
13 checks passed
@pow2clk pow2clk deleted the cp-andor branch January 29, 2025 19:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

non-integer parameters to or/and intrinsics crash the compiler [SPIR-V] Invalid generated SPIR-V when nesting HLSL 2021 and intrinsic.

4 participants