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

feat: select! macro for no-std environments #2903

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

ytakano
Copy link

@ytakano ytakano commented Dec 25, 2024

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.

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>
Signed-off-by: Yuuki Takano <ytakanoster@gmail.com>
Signed-off-by: Yuuki Takano <ytakanoster@gmail.com>
Comment on lines 70 to 73
x ^= x >> 12;
x ^= x << 25;
x ^= x >> 27;
x = x.wrapping_mul(0x2545_f491_4f6c_dd1d);
Copy link
Contributor

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.

Copy link
Author

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ytakano thanks, I should have mentioned that I am just an outside contributor, hope we can get a review from @taiki-e

Signed-off-by: Yuuki Takano <ytakanoster@gmail.com>
Signed-off-by: Yuuki Takano <ytakanoster@gmail.com>
Signed-off-by: Yuuki Takano <ytakanoster@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants