-
Notifications
You must be signed in to change notification settings - Fork 88
Panic-free ops via masking: {div,rem}_or
#202
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
Comments
The recommended way to do this is to simply perform the operation and mask as desired--when producing the asm, the backend will recognize that the two operations can be performed with a single instruction. |
Ah, I see. That's reasonable then - something like let a = ...;
let b = ...;
let mask = ...;
let operated = operate(a, b);
mask.select(operated, a) |
this could still be reopened, cuz many operations still need masked versions, such as masked integer division, masked shift, etc. basically everything that could panic or cause UB or has other side-effects that can't be masked just by ignoring lanes in the result. |
{div,rem}_or
re: shifts, I believe we should simply default our SIMD shift to the "wrapping" semantic the same way we default other operations to wrapping, also see rust-lang/rust#91237 I would be surprised if |
This is a duplicate of #118, |
As of the sync getting merged, the shift ops on |
Uh oh!
There was an error while loading. Please reload this page.
Hi, I was wondering if this team is considering the addition of masking arbitrary operations rather than just the gather select?
This is something already available in AVX512 through the kmask registers, though would probably require emulation on other platforms, but it seems like a very useful thing to have if at all possible.
One of the more awesome use cases I've seen for this is with vectorised emulation: https://gamozolabs.github.io/fuzzing/2018/10/14/vectorized_emulation.html which makes heavy use of masking to run / fuzz 8 virtual machines in parallel per core per thread.
The text was updated successfully, but these errors were encountered: