Home
last modified time | relevance | path

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

12345678

/kernel/linux/linux-6.6/include/linux/
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 …]
/kernel/linux/linux-5.10/include/linux/
Dmath64.h16 * @dividend: unsigned 64bit dividend
20 * Return: sets ``*remainder``, then returns dividend / divisor
25 static inline u64 div_u64_rem(u64 dividend, u32 divisor, u32 *remainder) in div_u64_rem() argument
27 *remainder = dividend % divisor; in div_u64_rem()
28 return dividend / divisor; in div_u64_rem()
33 * @dividend: signed 64bit dividend
37 * Return: sets ``*remainder``, then returns dividend / divisor
39 static inline s64 div_s64_rem(s64 dividend, s32 divisor, s32 *remainder) in div_s64_rem() argument
41 *remainder = dividend % divisor; in div_s64_rem()
42 return dividend / divisor; in div_s64_rem()
[all …]
/kernel/linux/linux-6.6/arch/arm/lib/
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 …]
/kernel/linux/linux-5.10/arch/arm/lib/
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 …]
/kernel/linux/linux-5.10/lib/math/
Ddiv64.c66 * @dividend: 64bit dividend
71 s64 div_s64_rem(s64 dividend, s32 divisor, s32 *remainder) in div_s64_rem() argument
75 if (dividend < 0) { in div_s64_rem()
76 quotient = div_u64_rem(-dividend, abs(divisor), (u32 *)remainder); in div_s64_rem()
81 quotient = div_u64_rem(dividend, abs(divisor), (u32 *)remainder); in div_s64_rem()
92 * @dividend: 64bit dividend
102 u64 div64_u64_rem(u64 dividend, u64 divisor, u64 *remainder) in div64_u64_rem() argument
109 quot = div_u64_rem(dividend, divisor, &rem32); in div64_u64_rem()
113 quot = div_u64(dividend >> n, divisor >> n); in div64_u64_rem()
118 *remainder = dividend - quot * divisor; in div64_u64_rem()
[all …]
/kernel/linux/linux-6.6/lib/math/
Ddiv64.c67 s64 div_s64_rem(s64 dividend, s32 divisor, s32 *remainder) in div_s64_rem() argument
71 if (dividend < 0) { in div_s64_rem()
72 quotient = div_u64_rem(-dividend, abs(divisor), (u32 *)remainder); in div_s64_rem()
77 quotient = div_u64_rem(dividend, abs(divisor), (u32 *)remainder); in div_s64_rem()
88 * @dividend: 64bit dividend
98 u64 div64_u64_rem(u64 dividend, u64 divisor, u64 *remainder) in div64_u64_rem() argument
105 quot = div_u64_rem(dividend, divisor, &rem32); in div64_u64_rem()
109 quot = div_u64(dividend >> n, divisor >> n); in div64_u64_rem()
114 *remainder = dividend - quot * divisor; in div64_u64_rem()
128 * @dividend: 64bit dividend
[all …]
Dtest_div64.c163 #define test_div64_one(dividend, divisor, i, j) ({ \ argument
168 quotient = dividend; \
172 dividend, divisor, quotient, remainder); \
188 u64 dividend; in test_div64() local
192 dividend = test_div64_dividends[i]; in test_div64()
193 if (!test_div64_one(dividend, TEST_DIV64_DIVISOR_0, i, 0)) in test_div64()
195 if (!test_div64_one(dividend, TEST_DIV64_DIVISOR_1, i, 1)) in test_div64()
197 if (!test_div64_one(dividend, TEST_DIV64_DIVISOR_2, i, 2)) in test_div64()
199 if (!test_div64_one(dividend, TEST_DIV64_DIVISOR_3, i, 3)) in test_div64()
201 if (!test_div64_one(dividend, TEST_DIV64_DIVISOR_4, i, 4)) in test_div64()
[all …]
/kernel/uniproton/src/arch/cpu/armv7-m/cortex-m4/
Dprt_div64.c40 OS_SEC_TEXT void OsU64Div(U64 dividend, U64 divisor, U64 *quotient, U64 *remainder) in OsU64Div() argument
52 if (dividend < divisor) { in OsU64Div()
54 *remainder = dividend; in OsU64Div()
59 alignShift = OsleadingZeroCount(divisor) - OsleadingZeroCount(dividend); in OsU64Div()
61 tmpRemainder = dividend; in OsU64Div()
79 OS_SEC_TEXT U64 OsU64DivGetQuotient(U64 dividend, U64 divisor) in OsU64DivGetQuotient() argument
84 OsU64Div(dividend, divisor, &quotient, &remainder); in OsU64DivGetQuotient()
89 OS_SEC_TEXT U64 OsU64DivGetRemainder(U64 dividend, U64 divisor) in OsU64DivGetRemainder() argument
94 OsU64Div(dividend, divisor, &quotient, &remainder); in OsU64DivGetRemainder()
/kernel/linux/linux-6.6/arch/powerpc/lib/
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
/kernel/linux/linux-5.10/arch/powerpc/lib/
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
/kernel/linux/linux-6.6/include/vdso/
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()
/kernel/linux/linux-5.10/include/vdso/
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()
/kernel/linux/linux-6.6/drivers/net/wireless/realtek/rtw89/
Dutil.h17 /* The result of negative dividend and positive divisor is undefined, but it
23 static inline s32 s32_div_u32_round_down(s32 dividend, u32 divisor, s32 *remainder) in s32_div_u32_round_down() argument
29 quotient = dividend / i_divisor; in s32_div_u32_round_down()
30 i_remainder = dividend % i_divisor; in s32_div_u32_round_down()
42 static inline s32 s32_div_u32_round_closest(s32 dividend, u32 divisor) in s32_div_u32_round_closest() argument
44 return s32_div_u32_round_down(dividend + divisor / 2, divisor, NULL); in s32_div_u32_round_closest()
/kernel/linux/linux-5.10/arch/c6x/kernel/
Dc6x_ksyms.c15 extern int __c6xabi_divi(int dividend, int divisor);
18 extern unsigned __c6xabi_divu(unsigned dividend, unsigned divisor);
21 extern int __c6xabi_remi(int dividend, int divisor);
24 extern unsigned __c6xabi_remu(unsigned dividend, unsigned divisor);
27 extern int __c6xabi_divremi(int dividend, int divisor);
30 extern unsigned __c6xabi_divremu(unsigned dividend, unsigned divisor);
/kernel/linux/linux-6.6/arch/powerpc/boot/
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
/kernel/linux/linux-5.10/arch/powerpc/boot/
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
/kernel/linux/linux-6.6/lib/crypto/mpi/
Dmpi-div.c18 void mpi_fdiv_qr(MPI quot, MPI rem, MPI dividend, MPI divisor);
20 void mpi_fdiv_r(MPI rem, MPI dividend, MPI divisor) in mpi_fdiv_r() argument
34 mpi_tdiv_r(rem, dividend, divisor); in mpi_fdiv_r()
36 if (((divisor_sign?1:0) ^ (dividend->sign?1:0)) && rem->nlimbs) in mpi_fdiv_r()
43 void mpi_fdiv_q(MPI quot, MPI dividend, MPI divisor) in mpi_fdiv_q() argument
46 mpi_fdiv_qr(quot, tmp, dividend, divisor); in mpi_fdiv_q()
50 void mpi_fdiv_qr(MPI quot, MPI rem, MPI dividend, MPI divisor) in mpi_fdiv_qr() argument
60 mpi_tdiv_qr(quot, rem, dividend, divisor); in mpi_fdiv_qr()
62 if ((divisor_sign ^ dividend->sign) && rem->nlimbs) { in mpi_fdiv_qr()
/kernel/linux/linux-5.10/lib/mpi/
Dmpi-div.c18 void mpi_fdiv_qr(MPI quot, MPI rem, MPI dividend, MPI divisor);
20 void mpi_fdiv_r(MPI rem, MPI dividend, MPI divisor) in mpi_fdiv_r() argument
34 mpi_tdiv_r(rem, dividend, divisor); in mpi_fdiv_r()
36 if (((divisor_sign?1:0) ^ (dividend->sign?1:0)) && rem->nlimbs) in mpi_fdiv_r()
43 void mpi_fdiv_q(MPI quot, MPI dividend, MPI divisor) in mpi_fdiv_q() argument
46 mpi_fdiv_qr(quot, tmp, dividend, divisor); in mpi_fdiv_q()
50 void mpi_fdiv_qr(MPI quot, MPI rem, MPI dividend, MPI divisor) in mpi_fdiv_qr() argument
60 mpi_tdiv_qr(quot, rem, dividend, divisor); in mpi_fdiv_qr()
62 if ((divisor_sign ^ dividend->sign) && rem->nlimbs) { in mpi_fdiv_qr()
/kernel/linux/linux-6.6/arch/xtensa/lib/
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 */
/kernel/linux/linux-6.6/arch/m68k/ifpsp060/src/
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 …]
/kernel/linux/linux-5.10/arch/m68k/ifpsp060/src/
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 …]
/kernel/linux/linux-5.10/arch/h8300/lib/
Dudivsi3.S55 ;; er0 contains shifted dividend
58 ;; er3 contains dividend, later remainder
65 sub.w r2,e3 ; dividend - 65536 * er2
68 sub.l er2,er3 ; er3 = dividend - (AQ - 1) * divisor
/kernel/linux/linux-5.10/drivers/acpi/acpica/
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 …]
/kernel/linux/linux-6.6/drivers/acpi/acpica/
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 …]
/kernel/linux/linux-5.10/arch/m68k/lib/
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 */

12345678