Skip to content

Conversation

@tarcieri
Copy link
Member

@tarcieri tarcieri commented Jan 15, 2026

Uses the masksel function added in #1342 to impl CmovEq. This should be less circuitious than the previous implementation.

This approach means we can get rid of all of the test* functions like testeq*, testne*, and testnz* and implement everything in terms of mask generation.

The pure Rust versions of masknz32 and masknz64 still internally use black_box to prevent optimizations around the non-zero bit extracted before computing the mask.

Uses the `masksel` function added in #1342 to impl `CmovEq`. This should
be less circuitious than the previous implementation.

This approach means we can get rid of all of the `test*` functions like
`testeq*`, `testne*`, and `testnz*` and implement everything in terms of
mask generation.

The pure Rust versions of `masknz32` and `masknz64` still internally use
`black_box` to prevent optimizations around the non-zero bit extracted
before computing the mask.
@tarcieri tarcieri force-pushed the cmov/impl-cmoveq-with-masksel branch from ee9ca8d to 0ce07a0 Compare January 15, 2026 15:39
@tarcieri tarcieri merged commit 65f1aec into master Jan 15, 2026
22 checks passed
@tarcieri tarcieri deleted the cmov/impl-cmoveq-with-masksel branch January 15, 2026 15:42
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