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

cmov: add correct usage examples for both Cmov and CmovEq #921

Open
brxken128 opened this issue Jun 18, 2023 · 0 comments
Open

cmov: add correct usage examples for both Cmov and CmovEq #921

brxken128 opened this issue Jun 18, 2023 · 0 comments

Comments

@brxken128
Copy link
Contributor

I plan to get these done later today also, and they'll follow the tests as a rough example (but obviously cleaner, easier to understand and commented so users know what's going on).

I plan to add warnings about using Cmov directly, as it would act more of an optimisation barrier if a condition is set to x == y.

I may also add warnings about branching in general, and using the ^ operator where the functions provided by CmovEq aren't adequate (which will be extremely unlikely but still probably worth noting). I'll also briefly explain why using == is bad, but I'm no branching expert so that may require some tweaking.

I'll try to adhere to the RustCrypto example format in order to reduce PR review time, and for consistency.

I think I'll try and get #920 fixed up first though.

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

No branches or pull requests

1 participant