Skip to content

Fix and/or intrinsics with non-int parameters (cp to 1.8.2502) - #7099

Merged
Gregory Roth (pow2clk) merged 2 commits into
microsoft:release-1.8.2502from
pow2clk:cp-andor
Jan 29, 2025
Merged

Gregory Roth (pow2clk) merged 2 commits into
microsoft:release-1.8.2502from
pow2clk:cp-andor

Conversation

@pow2clk

Copy link
Copy Markdown
Collaborator

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)

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
Gregory Roth (pow2clk) requested a review from a team as a code owner January 29, 2025 19:17
@pow2clk Gregory Roth (pow2clk) changed the title Fix and/or intrinsics with non-int parameters (#7060) Fix and/or intrinsics with non-int parameters Jan 29, 2025
@pow2clk Gregory Roth (pow2clk) changed the title Fix and/or intrinsics with non-int parameters Fix and/or intrinsics with non-int parameters (cp to 1.8.2502) Jan 29, 2025
@pow2clk
Gregory Roth (pow2clk) enabled auto-merge (squash) January 29, 2025 19:19
@pow2clk
Gregory Roth (pow2clk) merged commit d6dc036 into microsoft:release-1.8.2502 Jan 29, 2025
Mxr (SjMxr233) pushed a commit to ShaderHelper/DirectXShaderCompiler that referenced this pull request Jul 24, 2025
…soft#7099)

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)
Erich Gubler (ErichDonGubler) pushed a commit to erichdongubler-mozilla/DirectXShaderCompiler that referenced this pull request Feb 13, 2026
…soft#7099)

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)
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.

3 participants