mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 01:04:03 +00:00
5d22b18bf2
Previously checking for `pmoda == 0` would get LLVM to generate branchy code, when, for `stride = 1` the offset can be computed without such a branch by doing effectively a `-p % a`. For well-known (constant) alignments, with the new ordering of these conditionals, we end up generating 2 to 3 cheap instructions on x86_64: movq %rdi, %rax negl %eax andl $7, %eax instead of 5+ as previously. For unknown alignments the new code also generates just 3 instructions: negq %rdi leaq -1(%rsi), %rax andq %rdi, %rax |
||
---|---|---|
.. | ||
benches | ||
src | ||
tests | ||
Cargo.toml |