19 #include <linux/export.h>
20 #include <linux/kernel.h>
24 #if BITS_PER_LONG == 32
41 while ((int64_t)b > 0 && b < rem) {
67 quotient = div_u64_rem(-dividend,
abs(divisor), (
u32 *)remainder);
68 *remainder = -*remainder;
72 quotient = div_u64_rem(dividend,
abs(divisor), (
u32 *)remainder);
95 u32 high = divisor >> 32;
99 quot = div_u64(dividend, divisor);
101 int n = 1 + fls(high);
102 quot = div_u64(dividend >> n, divisor >> n);
106 if ((dividend - quot * divisor) >= divisor)
125 quot = div64_u64(
abs64(dividend),
abs64(divisor));
126 t = (dividend ^
divisor) >> 63;
128 return (quot ^ t) -
t;
141 return __iter_div_u64_rem(dividend, divisor, remainder);