Skip to content

Commit 8c0bdb3

Browse files
committed
Auto merge of rust-lang#132238 - Urgau:midpoint-i64-hackers-impl, r=joboet
Use Hacker's Delight impl in `i64::midpoint` instead of wide `i128` impl This PR switches `i64::midpoint` and (`isize::midpoint` where `isize == i64`) to using our Hacker's Delight impl instead of wide `i128` implementation. As LLVM seems to be outperformed by the complexity of signed 128-bits number compared to our Hacker's Delight implementation.[^1] It doesn't seems like it's an improvement for the other sizes[^2], so we let them with the wide implementation. [^1]: https://rust.godbolt.org/z/ravE75EYj [^2]: https://rust.godbolt.org/z/fzr171zKh r? libs
2 parents 9b9ea35 + b534a02 commit 8c0bdb3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

core/src/num/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ impl i64 {
429429
from_xe_bytes_doc = "",
430430
bound_condition = "",
431431
}
432-
midpoint_impl! { i64, i128, signed }
432+
midpoint_impl! { i64, signed }
433433
}
434434

435435
impl i128 {
@@ -530,7 +530,7 @@ impl isize {
530530
from_xe_bytes_doc = usize_isize_from_xe_bytes_doc!(),
531531
bound_condition = " on 64-bit targets",
532532
}
533-
midpoint_impl! { isize, i128, signed }
533+
midpoint_impl! { isize, signed }
534534
}
535535

536536
/// If the 6th bit is set ascii is lower case.

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy