-
Notifications
You must be signed in to change notification settings - Fork 635
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
feat: select!
macro for no-std environments
#2903
base: master
Are you sure you want to change the base?
Conversation
Currently, `select!` macro works on only 64 bit architectures. Signed-off-by: Yuuki Takano <ytakanoster@gmail.com>
Signed-off-by: Yuuki Takano <ytakanoster@gmail.com>
x ^= x >> 12; | ||
x ^= x << 25; | ||
x ^= x >> 27; | ||
x = x.wrapping_mul(0x2545_f491_4f6c_dd1d); |
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.
This looks like repeated code, would be nice if we could refactor this somehow.
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.
Thank you for your review.
I prepared xorshift64star
and xorshift32
functions.
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.
Signed-off-by: Yuuki Takano <ytakanoster@gmail.com>
Signed-off-by: Yuuki Takano <ytakanoster@gmail.com>
Signed-off-by: Yuuki Takano <ytakanoster@gmail.com>
Currently, the
select!
macro works only in the std environment.This PR fixes the implementation so that the
select!
macro also works in no-std environments for 32- and 64-bit CPUs.The behavior in the std environment remains unchanged.