Skip to content

Commit

Permalink
Use Hacker's Delight impl in i64::midpoint instead of wide i128 impl
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Urgau committed Oct 27, 2024
1 parent 9fa0146 commit ad80da6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions library/core/src/num/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ impl i64 {
from_xe_bytes_doc = "",
bound_condition = "",
}
midpoint_impl! { i64, i128, signed }
midpoint_impl! { i64, signed }
}

impl i128 {
Expand Down Expand Up @@ -530,7 +530,7 @@ impl isize {
from_xe_bytes_doc = usize_isize_from_xe_bytes_doc!(),
bound_condition = " on 64-bit targets",
}
midpoint_impl! { isize, i128, signed }
midpoint_impl! { isize, signed }
}

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

0 comments on commit ad80da6

Please sign in to comment.