Lines Matching +full:64 +full:- +full:bit

1 /* SPDX-License-Identifier: GPL-2.0 */
3 * Hardware-accelerated CRC-32 variants for Linux on z Systems
6 * computing of CRC-32 checksums.
8 * This CRC-32 implementation algorithm processes the most-significant
9 * bit first (BE).
16 #include <asm/nospec-insn.h>
17 #include <asm/vx-insn.h>
19 /* Vector register range containing CRC-32 constants */
31 * The CRC-32 constant block contains reduction constants to fold and
34 * For the CRC-32 variants, the constants are precomputed according to
37 * R1 = x4*128+64 mod P(x)
39 * R3 = x128+64 mod P(x)
44 * Barret reduction constant, u, is defined as floor(x**64 / P(x)).
55 * CRC-32 (IEEE 802.3 Ethernet, ...) polynomials:
76 * The CRC-32 function(s) use these calling conventions:
83 * %r4: Length of the buffer, must be 64 bytes or greater.
87 * %r5: CRC-32 constant pool base pointer.
92 * V9..V14: CRC-32 constants.
95 /* Load CRC-32 constants */
103 /* Load a 64-byte data chunk and XOR with CRC */
104 VLM %v1,%v4,0,%r3 /* 64-bytes into V1..V4 */
106 aghi %r3,64 /* BUF = BUF + 64 */
107 aghi %r4,-64 /* LEN = LEN - 64 */
110 cghi %r4,64
114 /* Load the next 64-byte data chunk into V5 to V8 */
130 aghi %r3,64 /* BUF = BUF + 64 */
131 aghi %r4,-64 /* LEN = LEN - 64 */
133 cghi %r4,64
137 /* Fold V1 to V4 into a single 128-bit value in V1 */
142 /* Check whether to continue with 64-bit folding */
153 aghi %r4,-16
161 * The R5 constant is used to fold a 128-bit value into an 96-bit value
162 * that is XORed with the next 96-bit input data chunk. To use a single
163 * VGFMG instruction, multiply the rightmost 64-bit with x^32 (1<<32) to
164 * form an intermediate 96-bit value (with appended zeros) which is then
170 * Further reduce the remaining 96-bit value to a 64-bit value using a
173 * doubleword with R6. The result is a 64-bit value and is subject to
179 * The input values to the Barret reduction are the degree-63 polynomial
180 * in V1 (R(x)), degree-32 generator polynomial, and the reduction