| /Linux-v6.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-v6.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-v6.1/lib/math/ |
| D | div64.c | 11 * 64bit result and 32bit remainder. 67 * div_s64_rem - signed 64bit divide with 64bit divisor and remainder 70 * @remainder: 64bit remainder 73 s64 div_s64_rem(s64 dividend, s32 divisor, s32 *remainder) in div_s64_rem() argument 78 quotient = div_u64_rem(-dividend, abs(divisor), (u32 *)remainder); in div_s64_rem() 79 *remainder = -*remainder; in div_s64_rem() 83 quotient = div_u64_rem(dividend, abs(divisor), (u32 *)remainder); in div_s64_rem() 93 * div64_u64_rem - unsigned 64bit divide with 64bit divisor and remainder 96 * @remainder: 64bit remainder 99 * But this operation, which includes math for calculating the remainder, [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-v6.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-v6.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-v6.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-v6.1/drivers/gpu/drm/amd/display/dc/dml/calcs/ |
| D | bw_fixed.c | 64 uint64_t remainder; in bw_frc_to_fixed() local 73 res_value = div64_u64_rem(arg1_value, arg2_value, &remainder); in bw_frc_to_fixed() 82 remainder <<= 1; in bw_frc_to_fixed() 86 if (remainder >= arg2_value) { in bw_frc_to_fixed() 88 remainder -= arg2_value; in bw_frc_to_fixed() 95 uint64_t summand = (remainder << 1) >= arg2_value; in bw_frc_to_fixed()
|
| /Linux-v6.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-v6.1/lib/mpi/ |
| D | mpi-div.c | 25 /* We need the original value of the divisor after the remainder has been in mpi_fdiv_r() 97 /* Ensure space is enough for quotient and remainder. in mpi_tdiv_qr() 98 * We need space for an extra limb in the remainder, because it's in mpi_tdiv_qr() 157 } else /* Put quotient at top of remainder. */ in mpi_tdiv_qr() 179 * significant word. Move the shifted numerator in the remainder in mpi_tdiv_qr() 190 * temporary space if it overlaps with the quotient or remainder. in mpi_tdiv_qr() 200 /* Move the numerator to the remainder. */ in mpi_tdiv_qr()
|
| /Linux-v6.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-v6.1/drivers/gpu/drm/amd/display/dc/basics/ |
| 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()
|
| D | conversion.c | 106 uint32_t remainder = 0; in find_gcd() local 108 remainder = a % b; in find_gcd() 110 b = remainder; in find_gcd()
|
| /Linux-v6.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-v6.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-v6.1/drivers/net/wireless/realtek/rtw89/ |
| D | util.h | 23 static inline s32 s32_div_u32_round_down(s32 dividend, u32 divisor, s32 *remainder) in s32_div_u32_round_down() argument 37 if (remainder) in s32_div_u32_round_down() 38 *remainder = i_remainder; in s32_div_u32_round_down()
|
| /Linux-v6.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-v6.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-v6.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-v6.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()
|
| D | spi-qup.c | 264 u32 remainder, words_per_block, num_words; in spi_qup_read() local 267 remainder = DIV_ROUND_UP(spi_qup_len(controller) - controller->rx_bytes, in spi_qup_read() 276 if (!remainder) in spi_qup_read() 280 num_words = (remainder > words_per_block) ? in spi_qup_read() 281 words_per_block : remainder; in spi_qup_read() 293 remainder -= num_words; in spi_qup_read() 300 } while (remainder); in spi_qup_read() 309 if (!remainder) { in spi_qup_read() 351 u32 remainder, words_per_block, num_words; in spi_qup_write() local 353 remainder = DIV_ROUND_UP(spi_qup_len(controller) - controller->tx_bytes, in spi_qup_write() [all …]
|
| /Linux-v6.1/include/vdso/ |
| D | math64.h | 6 __iter_div_u64_rem(u64 dividend, u32 divisor, u64 *remainder) in __iter_div_u64_rem() argument 19 *remainder = dividend; in __iter_div_u64_rem()
|
| /Linux-v6.1/drivers/gpu/drm/sun4i/ |
| D | sun8i_vi_layer.c | 130 int mask, remainder; in sun8i_vi_layer_update_coord() local 133 remainder = (state->src.x1 >> 16) & mask; in sun8i_vi_layer_update_coord() 134 src_w = (src_w + remainder) & ~mask; in sun8i_vi_layer_update_coord() 135 hphase += remainder << 16; in sun8i_vi_layer_update_coord() 139 int mask, remainder; in sun8i_vi_layer_update_coord() local 142 remainder = (state->src.y1 >> 16) & mask; in sun8i_vi_layer_update_coord() 143 src_h = (src_h + remainder) & ~mask; in sun8i_vi_layer_update_coord() 144 vphase += remainder << 16; in sun8i_vi_layer_update_coord()
|
| /Linux-v6.1/drivers/mmc/core/ |
| D | sdio_io.c | 279 * pad the remainder properly. in sdio_align_size() 294 * Fix up the size of the remainder (if any) in sdio_align_size() 318 unsigned remainder = size; in sdio_io_rw_ext_helper() local 331 while (remainder >= func->cur_blksize) { in sdio_io_rw_ext_helper() 334 blocks = remainder / func->cur_blksize; in sdio_io_rw_ext_helper() 345 remainder -= size; in sdio_io_rw_ext_helper() 352 /* Write the remainder using byte mode. */ in sdio_io_rw_ext_helper() 353 while (remainder > 0) { in sdio_io_rw_ext_helper() 354 size = min(remainder, sdio_max_byte_size(func)); in sdio_io_rw_ext_helper() 362 remainder -= size; in sdio_io_rw_ext_helper()
|