rust/library/core/src
Matthias Krüger bc9c31df69
Rollup merge of #122884 - mzabaluev:pow-remove-exit-branch, r=Amanieu
Optimize integer `pow` by removing the exit branch

The branch at the end of the `pow` implementations is redundant with multiplication code already present in the loop. By rotating the exit check, this branch can be largely removed, improving code size and reducing instruction cache misses.

Testing on my machine (`x86_64`, 11th Gen Intel Core i5-1135G7 @ 2.40GHz), the `num::int_pow` benchmarks improve by some 40% for the unchecked operations and show some slight improvement for the checked operations as well.
2024-08-13 21:11:12 +02:00
..
alloc Reformat use declarations. 2024-07-29 08:26:52 +10:00
array fix: Ensure Guard's drop method is removed at opt-level=s for Copy types 2024-08-09 11:10:30 +08:00
ascii core: optimise Debug impl for ascii::Char 2024-08-09 22:50:57 +02:00
async_iter Reformat use declarations. 2024-07-29 08:26:52 +10:00
cell Reformat use declarations. 2024-07-29 08:26:52 +10:00
char Auto merge of #128083 - Mark-Simulacrum:bump-bootstrap, r=albertlarsan68 2024-07-30 17:49:08 +00:00
cmp Use generic NonZero everywhere in core. 2024-02-22 15:17:33 +01:00
convert Fix doc nits 2024-07-26 13:26:33 +01:00
ffi Auto merge of #128083 - Mark-Simulacrum:bump-bootstrap, r=albertlarsan68 2024-07-30 17:49:08 +00:00
fmt std::fmt::FormatterFn -> std::fmt::FromFn 2024-08-12 18:33:30 +01:00
future Reformat use declarations. 2024-07-29 08:26:52 +10:00
hash Reformat use declarations. 2024-07-29 08:26:52 +10:00
intrinsics custom MIR: add support for tail calls 2024-08-05 18:23:14 +02:00
io Fix doc nits 2024-07-26 13:26:33 +01:00
iter Implement UncheckedIterator directly for RepeatN 2024-08-01 21:58:34 -07:00
macros Rollup merge of #128240 - mbrubeck:patch-3, r=joboet 2024-07-28 20:07:46 +02:00
mem Polymorphize RawVec 2024-08-09 20:06:26 -04:00
net Reformat use declarations. 2024-07-29 08:26:52 +10:00
num Rollup merge of #122884 - mzabaluev:pow-remove-exit-branch, r=Amanieu 2024-08-13 21:11:12 +02:00
ops Rollup merge of #128497 - Bryanskiy:fix-dropck-doc, r=lcnr 2024-08-01 18:43:41 +02:00
panic Auto merge of #128083 - Mark-Simulacrum:bump-bootstrap, r=albertlarsan68 2024-07-30 17:49:08 +00:00
prelude Avoid comments that describe multiple use items. 2024-07-17 08:02:46 +10:00
ptr Rollup merge of #128306 - WiktorPrzetacznik:WiktorPrzetacznik-nonnull-alignoffset-update, r=Amanieu 2024-08-08 18:57:00 +02:00
range Reformat use declarations. 2024-07-29 08:26:52 +10:00
slice Rollup merge of #128273 - Voultapher:improve-ord-violation-help, r=workingjubilee 2024-08-10 16:23:51 +02:00
str Reformat use declarations. 2024-07-29 08:26:52 +10:00
sync Auto merge of #128083 - Mark-Simulacrum:bump-bootstrap, r=albertlarsan68 2024-07-30 17:49:08 +00:00
task make LocalWaker::will_wake consistent with Waker::will_wake 2024-08-09 18:05:57 +02:00
unicode Use #[rustfmt::skip] on some use groups to prevent reordering. 2024-07-19 13:26:48 +10:00
any.rs Reformat use declarations. 2024-07-29 08:26:52 +10:00
arch.rs Add the sha512, sm3 and sm4 target features 2024-08-02 02:29:15 +05:30
ascii.rs Reformat use declarations. 2024-07-29 08:26:52 +10:00
asserting.rs Reformat use declarations. 2024-07-29 08:26:52 +10:00
bool.rs core is now compilable 2023-04-16 07:20:26 +00:00
borrow.rs Suggest borrowing on fn argument that is impl AsRef 2024-05-09 23:25:31 +00:00
cell.rs PinCoerceUnsized trait into core 2024-07-31 17:10:55 +08:00
clone.rs Make Clone::clone a lang item 2024-07-25 18:46:07 -04:00
cmp.rs Fix doc nits 2024-07-26 13:26:33 +01:00
default.rs Revert "Rollup merge of #127107 - mu001999-contrib:dead/enhance-2, r=pnkfelix" 2024-08-03 07:57:31 -04:00
error.md Mention core's PanicInfo in error.md. 2024-06-11 15:47:00 +02:00
error.rs Auto merge of #128083 - Mark-Simulacrum:bump-bootstrap, r=albertlarsan68 2024-07-30 17:49:08 +00:00
escape.rs Remove feature(effects) from the standard library 2024-06-21 09:23:24 +00:00
hint.rs Auto merge of #128083 - Mark-Simulacrum:bump-bootstrap, r=albertlarsan68 2024-07-30 17:49:08 +00:00
internal_macros.rs Fix doc nits 2024-07-26 13:26:33 +01:00
intrinsics.rs Rollup merge of #128149 - RalfJung:nontemporal_store, r=jieyouxu,Amanieu,Jubilee 2024-08-12 17:09:14 +02:00
lib.miri.rs add 'x.py miri', and make it work for 'library/{core,alloc,std}' 2024-04-03 20:27:20 +02:00
lib.rs Rollup merge of #122884 - mzabaluev:pow-remove-exit-branch, r=Amanieu 2024-08-13 21:11:12 +02:00
marker.rs Auto merge of #128083 - Mark-Simulacrum:bump-bootstrap, r=albertlarsan68 2024-07-30 17:49:08 +00:00
option.rs Reformat use declarations. 2024-07-29 08:26:52 +10:00
panic.rs Auto merge of #128083 - Mark-Simulacrum:bump-bootstrap, r=albertlarsan68 2024-07-30 17:49:08 +00:00
panicking.rs Fix doc nits 2024-07-26 13:26:33 +01:00
pat.rs Add tracking issue to core-pattern-type 2024-08-07 20:43:05 -04:00
pin.rs PinCoerceUnsized trait into core 2024-07-31 17:10:55 +08:00
primitive.rs library/core/src/primitive.rs: small doc fix 2024-07-23 23:11:26 +03:00
primitive_docs.rs Add a disclaimer about x86 f128 math functions 2024-08-01 15:38:53 -04:00
range.rs Reformat use declarations. 2024-07-29 08:26:52 +10:00
result.rs Start using #[diagnostic::do_not_recommend] in the standard library 2024-07-22 07:29:59 +02:00
time.rs time.rs: remove "Basic usage text" 2024-08-02 05:16:01 +02:00
tuple.rs Reformat use declarations. 2024-07-29 08:26:52 +10:00
ub_checks.rs Reformat use declarations. 2024-07-29 08:26:52 +10:00
unit.rs Import the 2021 prelude in the core crate 2024-03-25 13:12:06 -07:00