Home
last modified time | relevance | path

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

12345678910>>...31

/openbmc/linux/arch/arm/lib/
H A 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 …]
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.
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
/openbmc/u-boot/arch/arm/lib/
H A Dlib1funcs.S26 .macro ARM_DIV_BODY dividend, divisor, result, curbit
30 clz \curbit, \divisor
34 mov \divisor, \divisor, lsl \result
40 @ Initially shift the divisor left 3 bits if possible,
44 tst \divisor, #0xe0000000
45 moveq \divisor, \divisor, lsl #3
49 @ Unless the divisor is very big, shift it up in multiples of
51 @ division loop. Continue shifting until the divisor is
53 1: cmp \divisor, #0x10000000
54 cmplo \divisor, \dividend
[all …]
H A Ddiv64.S5 * Optimized computation of 64-bit dividend / 32-bit divisor
31 * __do_div64: perform a division with 64-bit dividend and 32-bit divisor.
38 * r4 = divisor (preserved)
53 bls 9f @ divisor is 0 or 1
55 beq 8f @ divisor is power of 2
62 @ Align divisor with upper part of dividend.
63 @ The aligned divisor is stored in yl preserving the original.
105 @ divisor for comparisons, considering the carry-out bit as well.
142 @ divisor at this point since divisor can not be smaller than 3 here.
150 8: @ Division by a power of 2: determine what that divisor order is
/openbmc/linux/include/linux/
H A 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 …]
/openbmc/u-boot/lib/
H A Ddiv64.c64 s64 div_s64_rem(s64 dividend, s32 divisor, s32 *remainder) in div_s64_rem() argument
69 quotient = div_u64_rem(-dividend, abs(divisor), (u32 *)remainder); in div_s64_rem()
71 if (divisor > 0) in div_s64_rem()
74 quotient = div_u64_rem(dividend, abs(divisor), (u32 *)remainder); in div_s64_rem()
75 if (divisor < 0) in div_s64_rem()
84 * div64_u64_rem - unsigned 64bit divide with 64bit divisor and remainder
86 * @divisor: 64bit divisor
95 u64 div64_u64_rem(u64 dividend, u64 divisor, u64 *remainder) in div64_u64_rem() argument
97 u32 high = divisor >> 32; in div64_u64_rem()
102 quot = div_u64_rem(dividend, divisor, &rem32); in div64_u64_rem()
[all …]
/openbmc/u-boot/include/linux/
H A Dmath64.h14 * div_u64_rem - unsigned 64bit divide with 32bit divisor with remainder
19 static inline u64 div_u64_rem(u64 dividend, u32 divisor, u32 *remainder) in div_u64_rem() argument
21 *remainder = dividend % divisor; in div_u64_rem()
22 return dividend / divisor; in div_u64_rem()
26 * div_s64_rem - signed 64bit divide with 32bit divisor with remainder
28 static inline s64 div_s64_rem(s64 dividend, s32 divisor, s32 *remainder) in div_s64_rem() argument
30 *remainder = dividend % divisor; in div_s64_rem()
31 return dividend / divisor; in div_s64_rem()
35 * div64_u64_rem - unsigned 64bit divide with 64bit divisor and remainder
37 static inline u64 div64_u64_rem(u64 dividend, u64 divisor, u64 *remainder) in div64_u64_rem() argument
[all …]
/openbmc/qemu/util/
H A Dhost-utils.c95 uint64_t divu128(uint64_t *plow, uint64_t *phigh, uint64_t divisor) in divu128() argument
102 if (divisor == 0 || dhi == 0) { in divu128()
103 *plow = dlo / divisor; in divu128()
105 return dlo % divisor; in divu128()
107 sh = clz64(divisor); in divu128()
109 if (dhi < divisor) { in divu128()
111 /* normalize the divisor, shifting the dividend accordingly */ in divu128()
112 divisor <<= sh; in divu128()
118 *plow = udiv_qrnnd(&rem, dhi, dlo, divisor); in divu128()
121 /* normalize the divisor, shifting the dividend accordingly */ in divu128()
[all …]
/openbmc/linux/tools/testing/selftests/bpf/progs/
H A Dverifier_sdiv.c11 __description("SDIV32, non-zero imm divisor, check 1")
23 __description("SDIV32, non-zero imm divisor, check 2")
35 __description("SDIV32, non-zero imm divisor, check 3")
47 __description("SDIV32, non-zero imm divisor, check 4")
59 __description("SDIV32, non-zero imm divisor, check 5")
71 __description("SDIV32, non-zero imm divisor, check 6")
83 __description("SDIV32, non-zero imm divisor, check 7")
95 __description("SDIV32, non-zero imm divisor, check 8")
107 __description("SDIV32, non-zero reg divisor, check 1")
120 __description("SDIV32, non-zero reg divisor, check 2")
[all …]
/openbmc/linux/lib/math/
H A Ddiv64.c67 s64 div_s64_rem(s64 dividend, s32 divisor, s32 *remainder) in div_s64_rem() argument
72 quotient = div_u64_rem(-dividend, abs(divisor), (u32 *)remainder); in div_s64_rem()
74 if (divisor > 0) in div_s64_rem()
77 quotient = div_u64_rem(dividend, abs(divisor), (u32 *)remainder); in div_s64_rem()
78 if (divisor < 0) in div_s64_rem()
87 * div64_u64_rem - unsigned 64bit divide with 64bit divisor and remainder
89 * @divisor: 64bit divisor
98 u64 div64_u64_rem(u64 dividend, u64 divisor, u64 *remainder) in div64_u64_rem() argument
100 u32 high = divisor >> 32; in div64_u64_rem()
105 quot = div_u64_rem(dividend, divisor, &rem32); in div64_u64_rem()
[all …]
/openbmc/linux/arch/m68k/include/asm/
H A 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 …]
/openbmc/linux/arch/alpha/lib/
H A 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 …]
H A 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 …]
/openbmc/linux/lib/crypto/mpi/
H A 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
22 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()
31 divisor = temp_divisor; in mpi_fdiv_r()
34 mpi_tdiv_r(rem, dividend, divisor); in mpi_fdiv_r()
37 mpi_add(rem, rem, divisor); in mpi_fdiv_r()
43 void mpi_fdiv_q(MPI quot, MPI dividend, MPI divisor) in mpi_fdiv_q() argument
[all …]
/openbmc/linux/Documentation/devicetree/bindings/clock/ti/
H A Ddivider.txt8 the register is one less than the actual divisor value. E.g:
10 register value actual divisor value
17 ti,index-starts-at-one - valid divisor values start at 1, not the default
19 register value actual divisor value
24 ti,index-power-of-two - valid divisor values are powers of two. E.g:
25 register value actual divisor value
34 Which will map the resulting values to a divisor table by their index:
35 register value actual divisor value
38 2 <invalid divisor, skipped>
65 - ti,min-div : min divisor for dividing the input clock rate, only
[all …]
/openbmc/linux/drivers/cpufreq/
H A 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 …]
/openbmc/u-boot/arch/arm/mach-uniphier/debug-uart/
H A Ddebug-uart.c32 unsigned int divisor; in _debug_uart_init() local
37 divisor = uniphier_ld4_debug_uart_init(); in _debug_uart_init()
42 divisor = uniphier_pro4_debug_uart_init(); in _debug_uart_init()
47 divisor = uniphier_sld8_debug_uart_init(); in _debug_uart_init()
52 divisor = uniphier_pro5_debug_uart_init(); in _debug_uart_init()
57 divisor = uniphier_pxs2_debug_uart_init(); in _debug_uart_init()
62 divisor = uniphier_ld6b_debug_uart_init(); in _debug_uart_init()
68 divisor = uniphier_ld20_debug_uart_init(); in _debug_uart_init()
77 writel(divisor, base + UNIPHIER_UART_LDR); in _debug_uart_init()
/openbmc/linux/tools/testing/selftests/tc-testing/tc-tests/filters/
H A 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 …]
/openbmc/linux/drivers/acpi/acpica/
H A 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 …]
/openbmc/linux/drivers/iio/common/hid-sensors/
H A 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 …]
/openbmc/linux/drivers/net/wireless/realtek/rtw89/
H A Dutil.h35 /* The result of negative dividend and positive divisor is undefined, but it
38 * Note: the maximum value of divisor is 0x7FFF_FFFF, because we cast it to
41 static inline s32 s32_div_u32_round_down(s32 dividend, u32 divisor, s32 *remainder) in s32_div_u32_round_down() argument
43 s32 i_divisor = (s32)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()
/openbmc/linux/drivers/clk/
H A 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 …]
/openbmc/linux/arch/powerpc/lib/
H A 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,
/openbmc/linux/Documentation/devicetree/bindings/clock/
H A 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>;
/openbmc/linux/include/linux/comedi/
H A Dcomedi_8254.h67 * @divisor: divisor for single counter
68 * @divisor1: divisor loaded into first cascaded counter
69 * @divisor2: divisor loaded into second cascaded counter
70 * #next_div: next divisor for single counter
71 * @next_div1: next divisor to use for first cascaded counter
72 * @next_div2: next divisor to use for second cascaded counter
84 unsigned int divisor; member

12345678910>>...31