Home
last modified time | relevance | path

Searched full:dividend (Results 1 – 25 of 86) sorted by relevance

1234

/linux/include/linux/
H A Dmath64.h17 * @dividend: unsigned 64bit dividend
21 * Return: sets ``*remainder``, then returns dividend / divisor
26 static inline u64 div_u64_rem(u64 dividend, u32 divisor, u32 *remainder) in div_u64_rem() argument
28 *remainder = dividend % divisor; in div_u64_rem()
29 return dividend / divisor; in div_u64_rem()
34 * @dividend: signed 64bit dividend
38 * Return: sets ``*remainder``, then returns dividend / divisor
40 static inline s64 div_s64_rem(s64 dividend, s32 divisor, s32 *remainder) in div_s64_rem() argument
42 *remainder = dividend % divisor; in div_s64_rem()
43 return dividend / divisor; in div_s64_rem()
[all …]
/linux/arch/arm/lib/
H A Dlib1funcs.S40 .macro ARM_DIV_BODY dividend, divisor, result, curbit
45 clz \result, \dividend
66 @ larger than the dividend.
68 cmplo \divisor, \dividend
76 cmplo \divisor, \dividend
86 1: cmp \dividend, \divisor
87 subhs \dividend, \dividend, \divisor
89 cmp \dividend, \divisor, lsr #1
90 subhs \dividend, \dividend, \divisor, lsr #1
92 cmp \dividend, \divisor, lsr #2
[all …]
H A Ddiv64.S5 * Optimized computation of 64-bit dividend / 32-bit divisor
29 * __do_div64: perform a division with 64-bit dividend and 32-bit divisor.
35 * xh-xl = dividend (clobbered)
59 @ Align divisor with upper part of dividend.
85 @ Break out early if dividend reaches 0.
/linux/lib/math/
H A Ddiv64.c68 s64 div_s64_rem(s64 dividend, s32 divisor, s32 *remainder) in div_s64_rem() argument
72 if (dividend < 0) { in div_s64_rem()
73 quotient = div_u64_rem(-dividend, abs(divisor), (u32 *)remainder); in div_s64_rem()
78 quotient = div_u64_rem(dividend, abs(divisor), (u32 *)remainder); in div_s64_rem()
89 * @dividend: 64bit dividend
99 u64 div64_u64_rem(u64 dividend, u64 divisor, u64 *remainder) in div64_u64_rem() argument
106 quot = div_u64_rem(dividend, divisor, &rem32); in div64_u64_rem()
110 quot = div_u64(dividend >> n, divisor >> n); in div64_u64_rem()
115 *remainder = dividend - quot * divisor; in div64_u64_rem()
129 * @dividend: 64bit dividend
[all …]
/linux/arch/powerpc/lib/
H A Ddiv64.S4 * This routine assumes that the top 32 bits of the dividend are
6 * On entry, r3 points to the dividend, which get overwritten with
16 lwz r5,0(r3) # get the dividend into r5/r6
22 divwu r7,r5,r4 # if dividend.hi >= divisor,
23 mullw r0,r7,r4 # quotient.hi = dividend.hi / divisor
24 subf. r5,r0,r5 # dividend.hi %= divisor
26 1: mr r11,r5 # here dividend.hi != 0
29 cntlzw r0,r5 # we are shifting the dividend right
/linux/arch/powerpc/boot/
H A Ddiv64.S4 * This routine assumes that the top 32 bits of the dividend are
6 * On entry, r3 points to the dividend, which get overwritten with
16 lwz r5,0(r3) # get the dividend into r5/r6
22 divwu r7,r5,r4 # if dividend.hi >= divisor,
23 mullw r0,r7,r4 # quotient.hi = dividend.hi / divisor
24 subf. r5,r0,r5 # dividend.hi %= divisor
26 1: mr r11,r5 # here dividend.hi != 0
29 cntlzw r0,r5 # we are shifting the dividend right
/linux/drivers/net/wireless/realtek/rtw89/
H A Dutil.h35 /* The result of negative dividend and positive divisor is undefined, but it
41 static inline s32 s32_div_u32_round_down(s32 dividend, u32 divisor, s32 *remainder) in s32_div_u32_round_down() argument
47 quotient = dividend / i_divisor; in s32_div_u32_round_down()
48 i_remainder = dividend % i_divisor; in s32_div_u32_round_down()
60 static inline s32 s32_div_u32_round_closest(s32 dividend, u32 divisor) in s32_div_u32_round_closest() argument
62 return s32_div_u32_round_down(dividend + divisor / 2, divisor, NULL); in s32_div_u32_round_closest()
/linux/include/vdso/
H A Dmath64.h6 __iter_div_u64_rem(u64 dividend, u32 divisor, u64 *remainder) in __iter_div_u64_rem() argument
10 while (dividend >= divisor) { in __iter_div_u64_rem()
13 asm("" : "+rm"(dividend)); in __iter_div_u64_rem()
15 dividend -= divisor; in __iter_div_u64_rem()
19 *remainder = dividend; in __iter_div_u64_rem()
/linux/arch/xtensa/lib/
H A Dudivsi3.S14 mov a6, a2 /* keep dividend in a6 */
15 do_nsau a5, a6, a2, a7 /* dividend_shift = nsau (dividend) */
42 addi a2, a2, 1 /* increment quotient if dividend >= divisor */
47 beqz a3, .Lerror /* if divisor == 1, return the dividend */
51 /* return dividend >= divisor */
H A Ddivsi3.S12 xor a7, a2, a3 /* sign = dividend ^ divisor */
13 do_abs a6, a2, a4 /* udividend = abs (dividend) */
56 bltu a6, a3, .Lreturn0 /* if dividend < divisor, return 0 */
H A Dmodsi3.S12 mov a7, a2 /* save original (signed) dividend */
13 do_abs a2, a2, a4 /* udividend = abs (dividend) */
44 neg a2, a2 /* if (dividend < 0), return -udividend */
H A Dumodsi3.S14 do_nsau a5, a2, a6, a7 /* dividend_shift = nsau (dividend) */
39 sub a2, a2, a3 /* subtract once more if dividend >= divisor */
/linux/arch/m68k/ifpsp060/src/
H A Dilsp.S75 # 0x8(sp) = hi(dividend) #
76 # 0xc(sp) = lo(dividend) #
138 mov.l 0xc(%a6), %d5 # get dividend hi
139 mov.l 0x10(%a6), %d6 # get dividend lo
152 # save the sign of the dividend
153 # make dividend unsigned if it's negative
155 tst.l %d5 # chk sign of hi(dividend)
156 slt NDIVIDEND(%a6) # save sign of dividend
160 negx.l %d6 # complement signed dividend
164 # - is (dividend == 0) ?
[all …]
/linux/drivers/acpi/acpica/
H A Dutmath.c242 * PARAMETERS: dividend - 64-bit dividend
256 acpi_ut_short_divide(u64 dividend, in acpi_ut_short_divide() argument
272 dividend_ovl.full = dividend; in acpi_ut_short_divide()
300 * PARAMETERS: in_dividend - Dividend
315 union uint64_overlay dividend; in acpi_ut_divide() local
335 dividend.full = in_dividend; in acpi_ut_divide()
347 ACPI_DIV_64_BY_32(0, dividend.part.hi, divisor.part.lo, in acpi_ut_divide()
350 ACPI_DIV_64_BY_32(partial1, dividend.part.lo, divisor.part.lo, in acpi_ut_divide()
360 normalized_dividend = dividend; in acpi_ut_divide()
392 if (partial3.part.lo >= dividend.part.hi) { in acpi_ut_divide()
[all …]
/linux/arch/m68k/lib/
H A Dudivsi3.S92 movel sp@(8), d0 /* d0 = dividend */
102 movew sp@(10), d2 /* get low dividend + high rest */
109 lsrl IMM (1), d0 /* shift dividend */
117 greater than the dividend, the tentative quotient was too large. */
127 cmpl sp@(8), d1 /* compare the sum with the dividend */
128 jls L6 /* if sum > dividend, quotient was too large */
/linux/drivers/clk/sophgo/
H A Dclk-cv18xx-pll.c203 u64 dividend = parent_rate * div_sel; in fpll_calc_rate() local
207 dividend <<= PLL_SYN_FACTOR_DOT_POS - 1; in fpll_calc_rate()
208 rate = div64_u64_rem(dividend, factor, &dividend); in fpll_calc_rate()
211 dividend <<= 1; in fpll_calc_rate()
215 rate += DIV64_U64_ROUND_CLOSEST(dividend, factor); in fpll_calc_rate()
/linux/lib/crypto/mpi/
H A Dmpi-mod.c10 int mpi_mod(MPI rem, MPI dividend, MPI divisor) in mpi_mod() argument
12 return mpi_fdiv_r(rem, dividend, divisor); in mpi_mod()
/linux/drivers/net/ethernet/amd/xgbe/
H A Dxgbe-hwtstamp.c324 u64 dividend; in xgbe_init_ptp() local
384 dividend = XGBE_V2_PTP_ACT_CLK_FREQ; in xgbe_init_ptp()
386 dividend = XGBE_PTP_ACT_CLK_FREQ; in xgbe_init_ptp()
388 dividend = (u64)(dividend << 32); in xgbe_init_ptp()
389 pdata->tstamp_addend = div_u64(dividend, pdata->ptpclk_rate); in xgbe_init_ptp()
/linux/arch/x86/include/asm/
H A Ddiv64.h16 * - modifies the 64-bit dividend _in_place_
43 static inline u64 div_u64_rem(u64 dividend, u32 divisor, u32 *remainder) in div_u64_rem() argument
48 } d = { dividend }; in div_u64_rem()
/linux/drivers/clk/versatile/
H A Dicst.c29 u64 dividend = p->ref * 2 * (u64)(vco.v + 8); in icst_hz() local
32 do_div(dividend, divisor); in icst_hz()
33 return (unsigned long)dividend; in icst_hz()
/linux/lib/zstd/common/
H A Dzstd_deps.h60 * U64 ZSTD_div64(U64 dividend, U32 divisor)
68 static uint64_t ZSTD_div64(uint64_t dividend, uint32_t divisor) { in ZSTD_div64() argument
69 return div_u64(dividend, divisor); in ZSTD_div64()
/linux/tools/testing/selftests/bpf/progs/
H A Dbpf_cc_cubic.c42 static __u64 div64_u64(__u64 dividend, __u64 divisor) in div64_u64() argument
44 return dividend / divisor; in div64_u64()
90 __u64 dividend = in tcp_cwnd_reduction() local
92 sndcnt = (__u32)div64_u64(dividend, (__u64)tp->prior_cwnd) - tp->prr_out; in tcp_cwnd_reduction()
/linux/arch/x86/math-emu/
H A Dreg_u_div.S110 /* testl $0x80000000, SIGH(%esi) // Dividend */
122 movl SIGH(%esi),%edx /* Dividend */
123 movl SIGL(%esi),%eax /* Dividend */
181 /* Save extended dividend in local register */
206 /* The dividend is greater or equal, would cause overflow */
215 /* At this point, we have a dividend < divisor, with a record of
/linux/arch/microblaze/lib/
H A Ddivsi3.S6 * Input : Dividend in Reg r5
65 /* restore values of csrs and that of r3 and the divisor and the dividend */
H A Dudivsi3.S7 * Dividend in Reg r6
77 /* restore values of csrs and that of r3 and the divisor and the dividend */

1234