/linux-6.12.1/include/linux/ |
D | math64.h | 17 * @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-6.12.1/arch/arm/lib/ |
D | lib1funcs.S | 40 .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 …]
|
D | div64.S | 5 * 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-6.12.1/lib/math/ |
D | div64.c | 68 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 …]
|
D | test_div64.c | 163 #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 …]
|
/linux-6.12.1/drivers/gpu/drm/amd/display/dc/spl/ |
D | spl_os_types.h | 23 static inline uint64_t spl_div_u64_rem(uint64_t dividend, uint32_t divisor, uint32_t *remainder) in spl_div_u64_rem() argument 25 return div_u64_rem(dividend, divisor, remainder); in spl_div_u64_rem() 28 static inline uint64_t spl_div_u64(uint64_t dividend, uint32_t divisor) in spl_div_u64() argument 30 return div_u64(dividend, divisor); in spl_div_u64() 33 static inline uint64_t spl_div64_u64(uint64_t dividend, uint64_t divisor) in spl_div64_u64() argument 35 return div64_u64(dividend, divisor); in spl_div64_u64() 38 static inline uint64_t spl_div64_u64_rem(uint64_t dividend, uint64_t divisor, uint64_t *remainder) in spl_div64_u64_rem() argument 40 return div64_u64_rem(dividend, divisor, remainder); in spl_div64_u64_rem() 43 static inline int64_t spl_div64_s64(int64_t dividend, int64_t divisor) in spl_div64_s64() argument 45 return div64_s64(dividend, divisor); in spl_div64_s64()
|
/linux-6.12.1/arch/powerpc/lib/ |
D | div64.S | 4 * 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-6.12.1/drivers/net/wireless/realtek/rtw89/ |
D | util.h | 37 /* The result of negative dividend and positive divisor is undefined, but it 43 static inline s32 s32_div_u32_round_down(s32 dividend, u32 divisor, s32 *remainder) in s32_div_u32_round_down() argument 49 quotient = dividend / i_divisor; in s32_div_u32_round_down() 50 i_remainder = dividend % i_divisor; in s32_div_u32_round_down() 62 static inline s32 s32_div_u32_round_closest(s32 dividend, u32 divisor) in s32_div_u32_round_closest() argument 64 return s32_div_u32_round_down(dividend + divisor / 2, divisor, NULL); in s32_div_u32_round_closest()
|
/linux-6.12.1/arch/powerpc/boot/ |
D | div64.S | 4 * 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-6.12.1/include/vdso/ |
D | math64.h | 6 __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-6.12.1/arch/xtensa/lib/ |
D | udivsi3.S | 14 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 */
|
D | divsi3.S | 12 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 */
|
D | modsi3.S | 12 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 */
|
D | umodsi3.S | 14 do_nsau a5, a2, a6, a7 /* dividend_shift = nsau (dividend) */ 39 sub a2, a2, a3 /* subtract once more if dividend >= divisor */
|
/linux-6.12.1/arch/m68k/ifpsp060/src/ |
D | ilsp.S | 75 # 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-6.12.1/drivers/acpi/acpica/ |
D | utmath.c | 242 * 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-6.12.1/drivers/thermal/ |
D | gov_fair_share.c | 81 u64 dividend; in fair_share_throttle() local 87 dividend = trip_level; in fair_share_throttle() 88 dividend *= cdev->max_state; in fair_share_throttle() 91 dividend *= instance->weight; in fair_share_throttle() 96 instance->target = div_u64(dividend, divisor); in fair_share_throttle()
|
/linux-6.12.1/arch/m68k/lib/ |
D | udivsi3.S | 92 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-6.12.1/drivers/pwm/ |
D | pwm-gpio.c | 43 u64 dividend; in pwm_gpio_round() local 49 dividend = dest->period; in pwm_gpio_round() 50 remainder = do_div(dividend, hrtimer_resolution); in pwm_gpio_round() 53 dividend = dest->duty_cycle; in pwm_gpio_round() 54 remainder = do_div(dividend, hrtimer_resolution); in pwm_gpio_round()
|
/linux-6.12.1/drivers/clk/sophgo/ |
D | clk-cv18xx-pll.c | 203 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, ÷nd); in fpll_calc_rate() 211 dividend <<= 1; in fpll_calc_rate() 215 rate += DIV64_U64_ROUND_CLOSEST(dividend, factor); in fpll_calc_rate()
|
/linux-6.12.1/lib/crypto/mpi/ |
D | mpi-mod.c | 10 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-6.12.1/lib/zstd/common/ |
D | zstd_deps.h | 60 * 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-6.12.1/drivers/clk/versatile/ |
D | icst.c | 29 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-6.12.1/arch/x86/include/asm/ |
D | div64.h | 16 * - 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-6.12.1/tools/testing/selftests/bpf/progs/ |
D | bpf_cc_cubic.c | 42 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()
|