]> git.proxmox.com Git - rustc.git/blobdiff - vendor/compiler_builtins/src/int/specialized_div_rem/delegate.rs
New upstream version 1.54.0+dfsg1
[rustc.git] / vendor / compiler_builtins / src / int / specialized_div_rem / delegate.rs
index 135d3402a3af7950910dacd8ec6ac3c49eb7b235..330c6e4f80bb701164ac4ec561073f5521c54be6 100644 (file)
@@ -2,8 +2,7 @@
 /// binary long division to divide integers larger than what hardware division by itself can do. This
 /// function is intended for microarchitectures that have division hardware, but not fast enough
 /// multiplication hardware for `impl_trifecta` to be faster.
-#[doc(hidden)]
-#[macro_export]
+#[allow(unused_macros)]
 macro_rules! impl_delegate {
     (
         $fn:ident, // name of the unsigned division function
@@ -186,6 +185,7 @@ macro_rules! impl_delegate {
     };
 }
 
+public_test_dep! {
 /// Returns `n / d` and sets `*rem = n % d`.
 ///
 /// This specialization exists because:
@@ -193,8 +193,9 @@ macro_rules! impl_delegate {
 ///    so we have to use an old fashioned `&mut u128` argument to return the remainder.
 ///  - 64-bit SPARC does not have u64 * u64 => u128 widening multiplication, which makes the
 ///    delegate algorithm strategy the only reasonably fast way to perform `u128` division.
-#[doc(hidden)]
-pub fn u128_divide_sparc(duo: u128, div: u128, rem: &mut u128) -> u128 {
+// used on SPARC
+#[allow(dead_code)]
+pub(crate) fn u128_divide_sparc(duo: u128, div: u128, rem: &mut u128) -> u128 {
     use super::*;
     let duo_lo = duo as u64;
     let duo_hi = (duo >> 64) as u64;
@@ -315,3 +316,4 @@ pub fn u128_divide_sparc(duo: u128, div: u128, rem: &mut u128) -> u128 {
         }
     }
 }
+}