about summary refs log tree commit diff
path: root/compiler/rustc_codegen_gcc/example/alloc_example.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2021-08-04 12:58:31 +0000
committerbors <bors@rust-lang.org>2021-08-04 12:58:31 +0000
commit7f3dc0464422ebadf3b8647f591bcf6e3107e805 (patch)
treea59cd1b4392ab4df27811595393a1d1fe523feeb /compiler/rustc_codegen_gcc/example/alloc_example.rs
parent87d713ff2b000e3827ebb8be974b280188fac783 (diff)
parenta3fb1d618823ccab589fbca2b6d4cc3619900bc1 (diff)
downloadrust-7f3dc0464422ebadf3b8647f591bcf6e3107e805.tar.gz
rust-7f3dc0464422ebadf3b8647f591bcf6e3107e805.zip
Auto merge of #87150 - rusticstuff:simplify_wrapping_neg, r=m-ou-se
Make wrapping_neg() use wrapping_sub(), #[inline(always)]

This is a follow-up change to the fix for #75598. It simplifies the implementation of wrapping_neg() for all integer types by just calling 0.wrapping_sub(self) and always inlines it. This leads to much less assembly code being emitted for opt-level≤1 and thus much better performance for debug-compiled code.

Background is [this discussion on the internals forum](https://internals.rust-lang.org/t/why-does-rust-generate-10x-as-much-unoptimized-assembly-as-gcc/14930).
Diffstat (limited to 'compiler/rustc_codegen_gcc/example/alloc_example.rs')
0 files changed, 0 insertions, 0 deletions