-
Notifications
You must be signed in to change notification settings - Fork 85
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
WIP implement guards in rem and div unsound cases #55
Conversation
Thanks @thomcc ! |
I'm mostly noting it for future reference. |
Awesome, thanks for the input. |
Given that it's not UB, that SIMD is a performance-oriented API, and that we don't panic for int overflow on adds and such (I think? or we'd have solved this already), it seems worth kicking the overflow checking in debug mode down the road a bit. |
This was my other question here. If neg is implemented in terms of sub, then it arguably should have already been doing the right thing (if perhaps with a suboptimal message). But I also thing that it would be fine for you as a WG to decide that checked-in-debug isn't worth doing for simd, and define all the +/-/etc to always be wrapping. (I don't immediately know whether that's the right answer, but I assume you'll make a persuasive case for whichever direction you pick.) |
Yeah, I'd argue in favor of this, mostly because |
While we're likely going to settle the issue regarding Neg some other day, that leaves the rest of issue #54, if you wish to continue to take this on. To recap, in the Zulip, I said:
so when that is removed and only the SIMD op is compiled in, running that test instead gets something like:
So the tests should be updated to not include the scalar comparisons, and instead just run the ops without checking the results, since we're only looking for a "successful" panic at runtime, not that the arithmetic results of the SIMD operation would match the arithmetic results of a comparable scalar operation. |
Tests now all pass, but the branch is still requesting a review from @workingjubilee from a resolved convo. |
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.
Much better! My quibbles appear to be resolved and things appear to do what they say they do.
Shoutout to Mario Carneiro for spotting a missing conditional. |
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.
Somewhere in the review flow these were altered again.
I'm leaving this WIP to address the rest of #54
I have to leave for a bit so I'm just opening this for now and will be back briefly to shape it up.
I'm doing this to get started with the contributing workflow and to test out my initial idea of just adding a
panic!
if any of the lanes match the int::MIN.There's a lot of moving parts and I probably missed a lot of easy stuff, so please, all feedback is welcome.