Lines Matching +full:64 +full:- +full:bit
1 // SPDX-License-Identifier: GPL-2.0
5 * Based on former do_div() implementation from asm-parisc/div64.h:
6 * Copyright (C) 1999 Hewlett-Packard Co
7 * Copyright (C) 1999 David Mosberger-Tang <davidm@hpl.hp.com>
10 * Generic C version of 64bit/32bit division and modulo, with
11 * 64bit result and 32bit remainder.
16 * for some CPUs. __div64_32() can be overridden by linking arch-specific
27 /* Not needed on 64bit architectures */
38 /* Reduce the thing a bit first */ in __div64_32()
43 rem -= (uint64_t) (high*base) << 32; in __div64_32()
53 rem -= b; in __div64_32()
67 * div_s64_rem - signed 64bit divide with 64bit divisor and remainder
68 * @dividend: 64bit dividend
69 * @divisor: 64bit divisor
70 * @remainder: 64bit remainder
78 quotient = div_u64_rem(-dividend, abs(divisor), (u32 *)remainder); in div_s64_rem()
79 *remainder = -*remainder; in div_s64_rem()
81 quotient = -quotient; in div_s64_rem()
85 quotient = -quotient; in div_s64_rem()
93 * div64_u64_rem - unsigned 64bit divide with 64bit divisor and remainder
94 * @dividend: 64bit dividend
95 * @divisor: 64bit divisor
96 * @remainder: 64bit remainder
100 * is kept distinct to avoid slowing down the div64_u64 operation on 32bit
118 quot--; in div64_u64_rem()
120 *remainder = dividend - quot * divisor; in div64_u64_rem()
123 *remainder -= divisor; in div64_u64_rem()
133 * div64_u64 - unsigned 64bit divide with 64bit divisor
134 * @dividend: 64bit dividend
135 * @divisor: 64bit divisor
156 quot--; in div64_u64()
157 if ((dividend - quot * divisor) >= divisor) in div64_u64()
167 * div64_s64 - signed 64bit divide with 64bit divisor
168 * @dividend: 64bit dividend
169 * @divisor: 64bit divisor
179 return (quot ^ t) - t; in div64_s64()
223 shift = ilog2(a) + ilog2(b) - 62; in mul_u64_u64_div_u64()