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

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

Merged
merged 2 commits into from
Jan 27, 2025

Conversation

pow2clk
Copy link
Member

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

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
Status: Done
4 participants