diff options
| author | Scott McMurray <scottmcm@users.noreply.github.com> | 2017-05-04 20:28:34 -0700 |
|---|---|---|
| committer | Scott McMurray <scottmcm@users.noreply.github.com> | 2017-05-04 20:28:34 -0700 |
| commit | e8fad325fe8630c0a6561d3e0c9c5fc51423aac0 (patch) | |
| tree | 802ce2c90817ccfbe44a3a680a685f83902e3643 /src/rustllvm/RustWrapper.cpp | |
| parent | 06fb4d25642a3f223db1441972dd5962085cfba1 (diff) | |
| download | rust-e8fad325fe8630c0a6561d3e0c9c5fc51423aac0.tar.gz rust-e8fad325fe8630c0a6561d3e0c9c5fc51423aac0.zip | |
Make [u8]::reverse() 5x faster
Since LLVM doesn't vectorize the loop for us, do unaligned reads of a larger type and use LLVM's bswap intrinsic to do the reversing of the actual bytes. cfg!-restricted to x86 and x86_64, as I assume it wouldn't help on things like ARMv5. Also makes [u16]::reverse() a more modest 1.5x faster by loading/storing u32 and swapping the u16s with ROT16. Thank you ptr::*_unaligned for making this easy :)
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions
