Lines Matching +full:48 +full:- +full:bit
2 // Accelerated CRC-T10DIF using arm64 NEON and Crypto Extensions instructions
5 // Copyright (C) 2019-2024 Google LLC
17 // Implement fast CRC-T10DIF computation with SSE and PCLMULQDQ instructions
65 // /white-papers/fast-crc-computation-generic-polynomials-pclmulqdq-paper.pdf
72 .arch armv8-a+crypto
96 * Pairwise long polynomial multiplication of two 16-bit values
100 * by two 64-bit values
119 * 6 (w0*x6 ^ w1*x5) << 48 ^ | (y0*z6 ^ y1*z5) << 48 ^
128 * and after performing 8x8->16 bit long polynomial multiplication of
130 * we obtain the following four vectors of 16-bit elements:
141 * 80-bit results.
143 * (*) NOTE: the 16x64 bit polynomial multiply below is not equivalent
144 * to the 64x64 bit one above, but XOR'ing the outputs together will
217 // the bit order match the polynomial coefficient order.
252 // While >= 128 data bytes remain (not counting v0-v7), fold the 128
253 // bytes v0-v7 into them, storing the result back into v0-v7.
263 // Now fold the 112 bytes in v0-v6 into the 16 bytes in v7.
282 adds len, len, #(128-16)
312 ldr q0, [buf, #-16]
316 // v1 = high order part of second chunk: v7 left-shifted by 'len' bytes.
322 // v3 = first chunk: v7 right-shifted by '16-len' bytes.
327 // Convert to 8-bit masks: 'len' 0x00 bytes, then '16-len' 0xff bytes.
330 // v2 = second chunk: 'len' bytes from v0 (low-order bytes),
331 // then '16-len' bytes from v1 (high-order bytes).
355 // Load the fold-across-16-bytes constants.
402 // Reduce the 128-bit value M(x), stored in v7, to the final 16-bit CRC.
406 // Load 'x^48 * (x^48 mod G(x))' and 'x^48 * (x^80 mod G(x))'.
410 // x^64. This produces a 128-bit value congruent to x^64 * M(x) and
411 // whose low 48 bits are 0.
413 pmull2 v7.1q, v7.2d, fold_consts.2d // high bits * x^48 * (x^80 mod G(x))
416 // Fold the high 32 bits into the low 96 bits. This produces a 96-bit
417 // value congruent to x^64 * M(x) and whose low 48 bits are 0.
420 pmull v1.1q, v1.1d, fold_consts.1d // high 32 bits * x^48 * (x^48 mod G(x))
423 // Load G(x) and floor(x^48 / G(x)).
427 pmull2 v1.1q, v0.2d, fold_consts.2d // high 32 bits * floor(x^48 / G(x))
430 ushr v0.2d, v0.2d, #48
456 .quad 0x1368000000000000 // x^48 * (x^48 mod G(x))
457 .quad 0x2d56000000000000 // x^48 * (x^80 mod G(x))
460 .quad 0x00000001f65a57f8 // floor(x^48 / G(x))
462 // For 1 <= len <= 15, the 16-byte vector beginning at &byteshift_table[16 -
464 // ..., 0x80} XOR the index vector to shift right by '16 - len' bytes.