rust/library/core
Matthias Krüger 9a42121135
Rollup merge of #93962 - joboet:branchless_slice_ord, r=Mark-Simulacrum
Make [u8]::cmp implementation branchless

The current implementation generates rather ugly assembly code, branching when the common parts are equal. By performing the comparison of the lengths upfront using a subtraction, the assembly gets much prettier: https://godbolt.org/z/4e5fnEKGd.

This will probably not impact speed too much, as the expensive part is in most cases the `memcmp`, but it sure looks better (I'm porting a sorting algorithm currently, and that branch just bothered me).
2022-02-16 18:59:29 +01:00
..
benches Respond to review feedback, and improve implementation somewhat 2022-02-05 11:15:18 -08:00
primitive_docs Add primitive documentation to libcore 2021-09-12 02:23:08 +00:00
src Rollup merge of #93962 - joboet:branchless_slice_ord, r=Mark-Simulacrum 2022-02-16 18:59:29 +01:00
tests Write {ui,} tests for pin_macro and pin! 2022-02-14 16:56:37 +01:00
Cargo.toml Build libcore as 2021 in a few more places 2022-02-06 15:41:01 -08:00