-
Notifications
You must be signed in to change notification settings - Fork 229
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 scalar relational operator translation. #1753
base: main
Are you sure you want to change the base?
Conversation
Fixes #1752 |
The CL spec for relational operators says that for scalar values the return value is 0/1 not 0/-1 which is for vectors. Fix the translator to use 0/1 when it's a scalar operator.
6923b1b
to
a3984e5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, thanks for the report and the PR!
Unlike OpenCL spec - SPIR-V says nothing about, what bits should be set, but I believe that the fix is correct. Not sure if it worth to add a test.
@svenvh please take a look.
Closing and reopening PR to restart tests |
LGTM, but I'd recommend adding/extending a test case. |
@svenvh any pointers on what sort of test could be used here? I'm not really sure where the current code is tested if at all, so how would I test the return value here? |
The current pattern doesn't seem to be tested indeed (otherwise some tests would have failed with your change). I think |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for adding the test! // Oops, wrong review, was look at this PR and in #1962 , can't delete the comment for some reasons
The CL spec for relational operators says that for scalar values the return value is 0/1 not 0/-1 which is for vectors.
Fix the translator to use 0/1 when it's a scalar operator