/linux-6.12.1/Documentation/staging/ |
D | crc32.rst | 5 A CRC is a long-division remainder. You add the CRC to the message, 9 remainder computed on the message+CRC is 0. This latter approach 20 Like all division, the remainder is always smaller than the divisor. 36 and append it to the current remainder. Then you figure out the 37 appropriate multiple of the divisor to subtract to being the remainder 39 and to make the XOR cancel, it's just a copy of bit 32 of the remainder. 43 the polynomial from the remainder and we're back to where we started, 49 multiple = remainder & 0x80000000 ? CRCPOLY : 0; 50 remainder = (remainder << 1 | next_input_bit()) ^ multiple; 53 Notice how, to get at bit 32 of the shifted remainder, we look [all …]
|
/linux-6.12.1/include/linux/ |
D | math64.h | 16 * div_u64_rem - unsigned 64bit divide with 32bit divisor with remainder 19 * @remainder: pointer to unsigned 32bit remainder 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() 33 * div_s64_rem - signed 64bit divide with 32bit divisor with remainder 36 * @remainder: pointer to signed 32bit remainder 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() [all …]
|
/linux-6.12.1/lib/math/ |
D | div64.c | 11 * 64bit result and 32bit remainder. 68 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() 74 *remainder = -*remainder; in div_s64_rem() 78 quotient = div_u64_rem(dividend, abs(divisor), (u32 *)remainder); in div_s64_rem() 88 * div64_u64_rem - unsigned 64bit divide with 64bit divisor and remainder 91 * @remainder: 64bit remainder 94 * But this operation, which includes math for calculating the remainder, 99 u64 div64_u64_rem(u64 dividend, u64 divisor, u64 *remainder) in div64_u64_rem() argument 107 *remainder = rem32; in div64_u64_rem() [all …]
|
D | test_div64.c | 57 u32 remainder; member 152 static inline bool test_div64_verify(u64 quotient, u32 remainder, int i, int j) in test_div64_verify() argument 155 remainder == test_div64_results[i][j].remainder); in test_div64_verify() 166 u32 remainder; \ 169 remainder = do_div(quotient, divisor); \ 170 if (!test_div64_verify(quotient, remainder, i, j)) { \ 172 dividend, divisor, quotient, remainder); \ 175 test_div64_results[i][j].remainder); \
|
/linux-6.12.1/drivers/acpi/acpica/ |
D | utmath.c | 245 * out_remainder - Pointer to where the remainder is returned 251 * 32-bit remainder. 275 * The quotient is 64 bits, the remainder is always 32 bits, in acpi_ut_short_divide() 303 * out_remainder - Pointer to where the remainder is returned 318 union uint64_overlay remainder; in acpi_ut_divide() local 341 remainder.part.hi = 0; in acpi_ut_divide() 344 * The quotient is 64 bits, the remainder is always 32 bits, in acpi_ut_divide() 351 quotient.part.lo, remainder.part.lo); in acpi_ut_divide() 382 * adjustment. The 64-bit remainder must be generated. in acpi_ut_divide() 388 remainder.part.hi = partial3.part.lo; in acpi_ut_divide() [all …]
|
/linux-6.12.1/arch/nios2/kernel/ |
D | insnemu.S | 223 * remainder dividend:quotient 227 * remainder >= divisor? no 00000000 0101011:0 229 * remainder >= divisor? no 00000000 101011:00 231 * remainder >= divisor? no 00000001 01011:000 233 * remainder >= divisor? no 00000010 1011:0000 235 * remainder >= divisor? no 00000101 011:00000 237 * remainder >= divisor? yes 00001010 11:000001 238 * remainder -= divisor - 00000111 242 * remainder >= divisor? yes 00000111 1:0000011 243 * remainder -= divisor - 00000111 [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() 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()
|
D | spl_fixpt31_32.c | 23 * *remainder = dividend % divisor 28 unsigned long long *remainder) in complete_integer_division_u64() argument 34 result = spl_div64_u64_rem(dividend, divisor, remainder); in complete_integer_division_u64() 59 unsigned long long remainder; in spl_fixpt_from_fraction() local 64 arg1_value, arg2_value, &remainder); in spl_fixpt_from_fraction() 73 remainder <<= 1; in spl_fixpt_from_fraction() 77 if (remainder >= arg2_value) { in spl_fixpt_from_fraction() 79 remainder -= arg2_value; in spl_fixpt_from_fraction() 86 unsigned long long summand = (remainder << 1) >= arg2_value; in spl_fixpt_from_fraction()
|
/linux-6.12.1/arch/powerpc/math-emu/ |
D | udivmodti4.c | 27 /* Remainder in n0. */ in _fp_udivmodti4() 39 /* Remainder in n0. */ in _fp_udivmodti4() 66 /* Remainder in n0 >> bm. */ in _fp_udivmodti4() 109 /* Remainder in n0 >> bm. */ in _fp_udivmodti4() 125 /* Remainder in n1n0. */ in _fp_udivmodti4() 182 /* Remainder in (n1n0 - m1m0) >> bm. */ in _fp_udivmodti4()
|
/linux-6.12.1/drivers/gpu/drm/amd/display/dc/basics/ |
D | bw_fixed.c | 65 uint64_t remainder; in bw_frc_to_fixed() local 74 res_value = div64_u64_rem(arg1_value, arg2_value, &remainder); in bw_frc_to_fixed() 83 remainder <<= 1; in bw_frc_to_fixed() 87 if (remainder >= arg2_value) { in bw_frc_to_fixed() 89 remainder -= arg2_value; in bw_frc_to_fixed() 96 uint64_t summand = (remainder << 1) >= arg2_value; in bw_frc_to_fixed()
|
D | fixpt31_32.c | 45 * *remainder = dividend % divisor 50 unsigned long long *remainder) in complete_integer_division_u64() argument 56 result = div64_u64_rem(dividend, divisor, remainder); in complete_integer_division_u64() 81 unsigned long long remainder; in dc_fixpt_from_fraction() local 86 arg1_value, arg2_value, &remainder); in dc_fixpt_from_fraction() 95 remainder <<= 1; in dc_fixpt_from_fraction() 99 if (remainder >= arg2_value) { in dc_fixpt_from_fraction() 101 remainder -= arg2_value; in dc_fixpt_from_fraction() 108 unsigned long long summand = (remainder << 1) >= arg2_value; in dc_fixpt_from_fraction()
|
/linux-6.12.1/drivers/clk/at91/ |
D | clk-pll.c | 175 unsigned long remainder; in clk_pll_get_best_div_mul() local 186 remainder = tmprate - rate; in clk_pll_get_best_div_mul() 188 remainder = rate - tmprate; in clk_pll_get_best_div_mul() 191 * Compare the remainder with the best remainder found until in clk_pll_get_best_div_mul() 193 * current remainder is smaller than the best one. in clk_pll_get_best_div_mul() 195 if (remainder < bestremainder) { in clk_pll_get_best_div_mul() 196 bestremainder = remainder; in clk_pll_get_best_div_mul() 206 if (!remainder) in clk_pll_get_best_div_mul()
|
/linux-6.12.1/lib/crypto/mpi/ |
D | mpi-div.c | 25 /* We need the original value of the divisor after the remainder has been in mpi_fdiv_r() 76 /* Ensure space is enough for quotient and remainder. in mpi_tdiv_qr() 77 * We need space for an extra limb in the remainder, because it's in mpi_tdiv_qr() 143 } else /* Put quotient at top of remainder. */ in mpi_tdiv_qr() 167 * significant word. Move the shifted numerator in the remainder in mpi_tdiv_qr() 178 * temporary space if it overlaps with the quotient or remainder. in mpi_tdiv_qr() 190 /* Move the numerator to the remainder. */ in mpi_tdiv_qr()
|
/linux-6.12.1/drivers/gpu/drm/amd/display/dc/dml/ |
D | dml_inline_defs.h | 129 unsigned int remainder; in dml_round_to_multiple() local 134 remainder = num % multiple; in dml_round_to_multiple() 136 if (remainder == 0) in dml_round_to_multiple() 140 return (num + multiple - remainder); in dml_round_to_multiple() 142 return (num - remainder); in dml_round_to_multiple()
|
/linux-6.12.1/arch/parisc/math-emu/ |
D | sfrem.c | 15 * Single Precision Floating-point Remainder 34 * Single Precision Floating-point Remainder 204 * Do iterative subtract until remainder is less than operand 2. in sgl_frem() 212 * Do last subtract, then determine which way to round if remainder in sgl_frem() 220 /* division is exact, remainder is zero */ in sgl_frem() 237 /* check for remainder being exactly 1/2 of opnd2 */ in sgl_frem()
|
D | dfrem.c | 15 * Double Precision Floating-point Remainder 34 * Double Precision Floating-point Remainder 208 * Do iterative subtract until remainder is less than operand 2. in dbl_frem() 217 * Do last subtract, then determine which way to round if remainder in dbl_frem() 225 /* division is exact, remainder is zero */ in dbl_frem() 243 /* check for remainder being exactly 1/2 of opnd2 */ in dbl_frem()
|
/linux-6.12.1/arch/x86/include/asm/ |
D | div64.h | 12 * two values (the quotient and the remainder), but 17 * - returns the 32-bit remainder 43 static inline u64 div_u64_rem(u64 dividend, u32 divisor, u32 *remainder) in div_u64_rem() argument 57 asm ("divl %2" : "=a" (d.v32[0]), "=d" (*remainder) : in div_u64_rem()
|
/linux-6.12.1/net/sunrpc/ |
D | socklib.c | 269 unsigned int remainder = rmsize + xdr->len - base; in xprt_sock_sendmsg() local 283 remainder -= len; in xprt_sock_sendmsg() 284 if (remainder == 0) in xprt_sock_sendmsg() 291 if (remainder == 0 || err != len) in xprt_sock_sendmsg() 302 remainder -= len; in xprt_sock_sendmsg() 303 if (remainder == 0) in xprt_sock_sendmsg() 306 if (remainder == 0 || err != len) in xprt_sock_sendmsg()
|
/linux-6.12.1/drivers/pwm/ |
D | pwm-gpio.c | 44 u32 remainder; in pwm_gpio_round() local 50 remainder = do_div(dividend, hrtimer_resolution); in pwm_gpio_round() 51 dest->period -= remainder; in pwm_gpio_round() 54 remainder = do_div(dividend, hrtimer_resolution); in pwm_gpio_round() 55 dest->duty_cycle -= remainder; in pwm_gpio_round()
|
/linux-6.12.1/include/asm-generic/ |
D | div64.h | 17 * uint32_t remainder = n % base; 19 * return remainder; 32 * do_div - returns 2 values: calculate remainder and update new dividend 37 * ``uint32_t remainder = n % base;`` 40 * Return: (uint32_t)remainder 231 /* the remainder can be computed with 32-bit regs */ \
|
/linux-6.12.1/drivers/pci/ |
D | doe.c | 149 size_t length, remainder; in pci_doe_send_req() local 187 remainder = task->request_pl_sz % sizeof(__le32); in pci_doe_send_req() 188 if (remainder) { in pci_doe_send_req() 190 memcpy(&val, &task->request_pl[i], remainder); in pci_doe_send_req() 214 size_t length, payload_length, remainder, received; in pci_doe_recv_resp() local 247 remainder = task->response_pl_sz % sizeof(__le32); in pci_doe_recv_resp() 249 /* remainder signifies number of data bytes in last payload dword */ in pci_doe_recv_resp() 250 if (!remainder) in pci_doe_recv_resp() 251 remainder = sizeof(__le32); in pci_doe_recv_resp() 256 remainder = sizeof(__le32); in pci_doe_recv_resp() [all …]
|
/linux-6.12.1/drivers/net/wireless/realtek/rtw89/ |
D | util.h | 43 static inline s32 s32_div_u32_round_down(s32 dividend, u32 divisor, s32 *remainder) in s32_div_u32_round_down() argument 57 if (remainder) in s32_div_u32_round_down() 58 *remainder = i_remainder; in s32_div_u32_round_down()
|
/linux-6.12.1/arch/powerpc/lib/ |
D | div64.S | 8 * On exit, r3 contains the remainder. 49 mullw r10,r0,r4 # and get the remainder 54 mr r3,r6 # return the remainder in r3
|
/linux-6.12.1/drivers/gpu/drm/sun4i/ |
D | sun8i_vi_layer.c | 81 int mask, remainder; in sun8i_vi_layer_update_coord() local 84 remainder = (state->src.x1 >> 16) & mask; in sun8i_vi_layer_update_coord() 85 src_w = (src_w + remainder) & ~mask; in sun8i_vi_layer_update_coord() 86 hphase += remainder << 16; in sun8i_vi_layer_update_coord() 90 int mask, remainder; in sun8i_vi_layer_update_coord() local 93 remainder = (state->src.y1 >> 16) & mask; in sun8i_vi_layer_update_coord() 94 src_h = (src_h + remainder) & ~mask; in sun8i_vi_layer_update_coord() 95 vphase += remainder << 16; in sun8i_vi_layer_update_coord()
|
/linux-6.12.1/drivers/spi/ |
D | spi-slave-mt27xx.c | 167 int reg_val, cnt, remainder, ret; in mtk_spi_slave_fifo_transfer() local 183 remainder = xfer->len % 4; in mtk_spi_slave_fifo_transfer() 184 if (xfer->tx_buf && remainder > 0) { in mtk_spi_slave_fifo_transfer() 186 memcpy(®_val, xfer->tx_buf + cnt * 4, remainder); in mtk_spi_slave_fifo_transfer() 332 u32 int_status, reg_val, cnt, remainder; in mtk_spi_slave_interrupt() local 363 remainder = trans->len % 4; in mtk_spi_slave_interrupt() 364 if (trans->rx_buf && remainder > 0) { in mtk_spi_slave_interrupt() 367 ®_val, remainder); in mtk_spi_slave_interrupt()
|