Home
last modified time | relevance | path

Searched full:divisor (Results 1 – 25 of 613) sorted by relevance

12345678910>>...25

/linux-6.12.1/arch/arm/lib/
Dlib1funcs.S40 .macro ARM_DIV_BODY dividend, divisor, result, curbit
44 clz \curbit, \divisor
48 mov \divisor, \divisor, lsl \result
54 @ Initially shift the divisor left 3 bits if possible,
58 tst \divisor, #0xe0000000
59 moveq \divisor, \divisor, lsl #3
63 @ Unless the divisor is very big, shift it up in multiples of
65 @ division loop. Continue shifting until the divisor is
67 1: cmp \divisor, #0x10000000
68 cmplo \divisor, \dividend
[all …]
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.
36 * r4 = divisor (preserved)
50 bls 9f @ divisor is 0 or 1
52 beq 8f @ divisor is power of 2
59 @ Align divisor with upper part of dividend.
60 @ The aligned divisor is stored in yl preserving the original.
102 @ divisor for comparisons, considering the carry-out bit as well.
139 @ divisor at this point since divisor can not be smaller than 3 here.
147 8: @ Division by a power of 2: determine what that divisor order is
/linux-6.12.1/include/linux/
Dmath64.h16 * div_u64_rem - unsigned 64bit divide with 32bit divisor with remainder
18 * @divisor: unsigned 32bit divisor
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()
33 * div_s64_rem - signed 64bit divide with 32bit divisor with remainder
35 * @divisor: signed 32bit divisor
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
[all …]
Dmath.h81 * Divide positive or negative dividend by positive or negative divisor
84 * dividends if the divisor variable type is unsigned.
86 #define DIV_ROUND_CLOSEST(x, divisor)( \ argument
89 typeof(divisor) __d = divisor; \
91 ((typeof(divisor))-1) > 0 || \
98 * Same as above but for u64 dividends. divisor must be a 32-bit
101 #define DIV_ROUND_CLOSEST_ULL(x, divisor)( \ argument
103 typeof(divisor) __d = divisor; \
/linux-6.12.1/lib/math/
Ddiv64.c68 s64 div_s64_rem(s64 dividend, s32 divisor, s32 *remainder) in div_s64_rem() argument
73 quotient = div_u64_rem(-dividend, abs(divisor), (u32 *)remainder); in div_s64_rem()
75 if (divisor > 0) in div_s64_rem()
78 quotient = div_u64_rem(dividend, abs(divisor), (u32 *)remainder); in div_s64_rem()
79 if (divisor < 0) in div_s64_rem()
88 * div64_u64_rem - unsigned 64bit divide with 64bit divisor and remainder
90 * @divisor: 64bit divisor
99 u64 div64_u64_rem(u64 dividend, u64 divisor, u64 *remainder) in div64_u64_rem() argument
101 u32 high = divisor >> 32; in div64_u64_rem()
106 quot = div_u64_rem(dividend, divisor, &rem32); in div64_u64_rem()
[all …]
/linux-6.12.1/arch/m68k/include/asm/
Dmcfpit.h25 #define MCFPIT_PCSR_CLK1 0x0000 /* System clock divisor */
26 #define MCFPIT_PCSR_CLK2 0x0100 /* System clock divisor */
27 #define MCFPIT_PCSR_CLK4 0x0200 /* System clock divisor */
28 #define MCFPIT_PCSR_CLK8 0x0300 /* System clock divisor */
29 #define MCFPIT_PCSR_CLK16 0x0400 /* System clock divisor */
30 #define MCFPIT_PCSR_CLK32 0x0500 /* System clock divisor */
31 #define MCFPIT_PCSR_CLK64 0x0600 /* System clock divisor */
32 #define MCFPIT_PCSR_CLK128 0x0700 /* System clock divisor */
33 #define MCFPIT_PCSR_CLK256 0x0800 /* System clock divisor */
34 #define MCFPIT_PCSR_CLK512 0x0900 /* System clock divisor */
[all …]
/linux-6.12.1/tools/testing/selftests/bpf/progs/
Dverifier_sdiv.c15 __description("SDIV32, non-zero imm divisor, check 1")
27 __description("SDIV32, non-zero imm divisor, check 2")
39 __description("SDIV32, non-zero imm divisor, check 3")
51 __description("SDIV32, non-zero imm divisor, check 4")
63 __description("SDIV32, non-zero imm divisor, check 5")
75 __description("SDIV32, non-zero imm divisor, check 6")
87 __description("SDIV32, non-zero imm divisor, check 7")
99 __description("SDIV32, non-zero imm divisor, check 8")
111 __description("SDIV32, non-zero reg divisor, check 1")
124 __description("SDIV32, non-zero reg divisor, check 2")
[all …]
/linux-6.12.1/arch/alpha/lib/
Ddivide.S29 * the divisor is small is handled better by the DEC algorithm
38 * $1 - shifted divisor
43 * $25 - divisor
56 #define divisor $1 macro
104 bis $25,$25,divisor
109 LONGIFY(divisor)
114 beq divisor, 9f /* div by zero */
118 * shift divisor left, using 3-bit shifts for
125 1: cmpult divisor,modulus,compare
126 s8addq divisor,$31,divisor
[all …]
Dev6-divide.S29 * the divisor is small is handled better by the DEC algorithm
38 * $1 - shifted divisor
43 * $25 - divisor
66 #define divisor $1 macro
114 bis $25,$25,divisor # E :
120 LONGIFY(divisor) # E : U L L U
127 beq divisor, 9f /* div by zero */
137 * shift divisor left, using 3-bit shifts for
144 1: cmpult divisor,modulus,compare # E :
145 s8addq divisor,$31,divisor # E :
[all …]
/linux-6.12.1/drivers/gpu/drm/amd/display/dc/spl/
Dspl_os_types.h23 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/drivers/cpufreq/
Dsparc-us2e-cpufreq.c86 unsigned long old_divisor, unsigned long divisor) in frob_mem_refresh() argument
91 refr_count /= (MCTRL0_REFR_CLKS_P_CNT * divisor * 1000000000UL); in frob_mem_refresh()
118 unsigned long old_divisor, unsigned long divisor) in us2e_transition() argument
123 if (old_divisor == 2 && divisor == 1) { in us2e_transition()
126 frob_mem_refresh(0, clock_tick, old_divisor, divisor); in us2e_transition()
127 } else if (old_divisor == 1 && divisor == 2) { in us2e_transition()
128 frob_mem_refresh(1, clock_tick, old_divisor, divisor); in us2e_transition()
131 } else if (old_divisor == 1 && divisor > 2) { in us2e_transition()
135 2, divisor); in us2e_transition()
136 } else if (old_divisor > 2 && divisor == 1) { in us2e_transition()
[all …]
/linux-6.12.1/Documentation/devicetree/bindings/clock/ti/
Ddivider.txt6 the register is one less than the actual divisor value. E.g:
8 register value actual divisor value
15 ti,index-starts-at-one - valid divisor values start at 1, not the default
17 register value actual divisor value
22 ti,index-power-of-two - valid divisor values are powers of two. E.g:
23 register value actual divisor value
32 Which will map the resulting values to a divisor table by their index:
33 register value actual divisor value
36 2 <invalid divisor, skipped>
63 - ti,min-div : min divisor for dividing the input clock rate, only
[all …]
/linux-6.12.1/tools/testing/selftests/tc-testing/tc-tests/filters/
Du32.json18 …"matchPattern": "filter protocol ip pref 1 u32 chain (0[ ]+$|0 fh 800: ht divisor 1|0 fh 800::800 …
63 …"matchPattern": "filter protocol ip pref 1 u32 chain (0[ ]+$|0 fh 800: ht divisor 1|0 fh 800::800 …
82 "cmdUnderTest": "$TC filter add dev $DEV1 ingress prio 99 handle 42: u32 divisor 256",
85 "matchPattern": "pref 99 u32 chain (0[ ]+$|0 fh 42: ht divisor 256|0 fh 800: ht divisor 1)",
104 "cmdUnderTest": "$TC filter replace dev $DEV1 ingress prio 99 handle 42:42 u32 divisor 256",
125 "$TC filter add dev $DEV1 ingress prio 99 handle 42: u32 divisor 256"
127 "cmdUnderTest": "$TC filter replace dev $DEV1 ingress prio 99 handle 42:42 u32 divisor 128",
130 "matchPattern": "pref 99 u32 chain (0[ ]+$|0 fh 42: ht divisor 256|0 fh 800: ht divisor 1)",
148 "$TC filter add dev $DEV1 ingress prio 99 handle 43: u32 divisor 256"
153 …"matchPattern": "filter protocol ip pref 98 u32 chain (0[ ]+$|0 fh 801: ht divisor 1|0 fh 801::800…
[all …]
/linux-6.12.1/drivers/acpi/acpica/
Dutmath.c243 * divisor - 32-bit divisor
257 u32 divisor, u64 *out_quotient, u32 *out_remainder) in acpi_ut_short_divide() argument
265 /* Always check for a zero divisor */ in acpi_ut_short_divide()
267 if (divisor == 0) { in acpi_ut_short_divide()
278 ACPI_DIV_64_BY_32(0, dividend_ovl.part.hi, divisor, in acpi_ut_short_divide()
281 ACPI_DIV_64_BY_32(remainder32, dividend_ovl.part.lo, divisor, in acpi_ut_short_divide()
301 * in_divisor - Divisor
316 union uint64_overlay divisor; in acpi_ut_divide() local
327 /* Always check for a zero divisor */ in acpi_ut_divide()
334 divisor.full = in_divisor; in acpi_ut_divide()
[all …]
/linux-6.12.1/drivers/iio/common/hid-sensors/
Dhid-sensor-attributes.c71 static void simple_div(int dividend, int divisor, int *whole, in simple_div() argument
78 if (divisor == 0) { in simple_div()
82 *whole = dividend/divisor; in simple_div()
83 rem = dividend % divisor; in simple_div()
85 while (rem <= divisor) { in simple_div()
89 *micro_frac = (rem / divisor) * int_pow(10, 6 - exp); in simple_div()
95 int divisor = int_pow(10, exp); in split_micro_fraction() local
97 *val1 = no / divisor; in split_micro_fraction()
98 *val2 = no % divisor * int_pow(10, 6 - exp); in split_micro_fraction()
133 int divisor; in convert_to_vtf_format() local
[all …]
/linux-6.12.1/drivers/clk/
Dclk-vt8500.c124 /* div == 0 is actually the highest divisor */ in vt8500_dclk_recalc_rate()
135 u32 divisor; in vt8500_dclk_round_rate() local
140 divisor = *prate / rate; in vt8500_dclk_round_rate()
142 /* If prate / rate would be decimal, incr the divisor */ in vt8500_dclk_round_rate()
143 if (rate * divisor < *prate) in vt8500_dclk_round_rate()
144 divisor++; in vt8500_dclk_round_rate()
147 * If this is a request for SDMMC we have to adjust the divisor in vt8500_dclk_round_rate()
150 if ((cdev->div_mask == 0x3F) && (divisor > 31)) { in vt8500_dclk_round_rate()
151 divisor = 64 * ((divisor / 64) + 1); in vt8500_dclk_round_rate()
154 return *prate / divisor; in vt8500_dclk_round_rate()
[all …]
/linux-6.12.1/drivers/net/wireless/realtek/rtw89/
Dutil.h37 /* The result of negative dividend and positive divisor is undefined, but it
40 * Note: the maximum value of divisor is 0x7FFF_FFFF, because we cast it to
43 static inline s32 s32_div_u32_round_down(s32 dividend, u32 divisor, s32 *remainder) in s32_div_u32_round_down() argument
45 s32 i_divisor = (s32)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/lib/
Ddiv64.S7 * the 64-bit quotient, and r4 contains the divisor.
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
31 srw r10,r10,r0 # the divisor right the same amount,
41 mulhwu r9,r11,r4 # multiply the estimate by the divisor,
42 subfc r6,r10,r6 # take the product from the divisor,
/linux-6.12.1/Documentation/devicetree/bindings/clock/
Dvt8500.txt41 Divisor device clocks:
44 - divisor-reg : shall be the register offset from PMC base for the divisor
47 - divisor-mask : shall be the mask for the divisor register. Defaults to 0x1f
70 divisor-reg = <0x328>;
71 divisor-mask = <0x3f>;
/linux-6.12.1/tools/testing/selftests/tc-testing/tc-tests/qdiscs/
Dsfq.json17 … "matchPattern": "qdisc sfq 1: root refcnt [0-9]+ limit 127p quantum.*depth 127 divisor 1024",
59 "matchPattern": "depth 127 divisor 1024 perturb 10sec",
80 … "matchPattern": "qdisc sfq 1: root refcnt [0-9]+ limit 127p quantum 9000b depth 127 divisor 1024",
88 "name": "Create SFQ with divisor setting",
98 "cmdUnderTest": "$TC qdisc add dev $DUMMY handle 1: root sfq divisor 512",
101 … "matchPattern": "qdisc sfq 1: root refcnt [0-9]+ limit 127p quantum 1514b depth 127 divisor 512",
143 … "matchPattern": "qdisc sfq 1: root refcnt [0-9]+ limit 127p quantum 1514b depth 64 divisor 1024",
164 …ttern": "qdisc sfq 1: root refcnt [0-9]+ limit 127p quantum 1514b depth 127 headdrop divisor 1024",
185 …sc sfq 1: root refcnt [0-9]+ limit 127p quantum 1514b depth 127 headdrop divisor 1024 ewma 6 min 8…
/linux-6.12.1/arch/xtensa/lib/
Dudivsi3.S12 bltui a3, 2, .Lle_one /* check if the divisor <= 1 */
16 do_nsau a4, a3, a2, a7 /* divisor_shift = nsau (divisor) */
21 sll a3, a3 /* divisor <<= count */
42 addi a2, a2, 1 /* increment quotient if dividend >= divisor */
47 beqz a3, .Lerror /* if divisor == 1, return the dividend */
51 /* return dividend >= divisor */
/linux-6.12.1/include/linux/comedi/
Dcomedi_8254.h83 * @divisor: divisor for single counter
84 * @divisor1: divisor loaded into first cascaded counter
85 * @divisor2: divisor loaded into second cascaded counter
86 * #next_div: next divisor for single counter
87 * @next_div1: next divisor to use for first cascaded counter
88 * @next_div2: next divisor to use for second cascaded counter
100 unsigned int divisor; member
/linux-6.12.1/arch/sh/lib/
Dudivsi3_i4i-Os.S12 udiv small divisor: 55 cycles
13 udiv large divisor: 52 cycles
14 sdiv small divisor, positive result: 59 cycles
15 sdiv large divisor, positive result: 56 cycles
16 sdiv small divisor, negative result: 65 cycles (*)
17 sdiv large divisor, negative result: 62 cycles (*)
/linux-6.12.1/arch/x86/kernel/
Dearly_printk.c94 #define DLL 0 /* Divisor Latch Low */
95 #define DLH 1 /* Divisor latch High */
130 static __init void early_serial_hw_init(unsigned divisor) in early_serial_hw_init() argument
141 serial_out(early_serial_base, DLL, divisor & 0xff); in early_serial_hw_init()
142 serial_out(early_serial_base, DLH, (divisor >> 8) & 0xff); in early_serial_hw_init()
150 unsigned divisor; in early_serial_init() local
183 /* Convert from baud to divisor value */ in early_serial_init()
184 divisor = 115200 / baud; in early_serial_init()
191 early_serial_hw_init(divisor); in early_serial_init()
219 unsigned divisor; in early_pci_serial_init() local
[all …]
/linux-6.12.1/lib/crypto/mpi/
Dmpi-div.c19 int mpi_fdiv_r(MPI rem, MPI dividend, MPI divisor) in mpi_fdiv_r() argument
21 int divisor_sign = divisor->sign; in mpi_fdiv_r()
25 /* We need the original value of the divisor after the remainder has been in mpi_fdiv_r()
29 if (rem == divisor) { in mpi_fdiv_r()
30 temp_divisor = mpi_copy(divisor); in mpi_fdiv_r()
33 divisor = temp_divisor; in mpi_fdiv_r()
36 err = mpi_tdiv_r(rem, dividend, divisor); in mpi_fdiv_r()
41 err = mpi_add(rem, rem, divisor); in mpi_fdiv_r()
113 /* Optimize division by a single-limb divisor. */ in mpi_tdiv_qr()

12345678910>>...25