#include <config.h>
+#include "cksum.h"
+
#include <stdio.h>
#include <sys/types.h>
-#include <stdint.h>
#include <x86intrin.h>
#include "system.h"
/* Number of bytes to read at once. */
#define BUFLEN (1 << 16)
-extern uint_fast32_t const crctab[8][256];
-
-extern bool
-cksum_avx2 (FILE *fp, uint_fast32_t *crc_out, uintmax_t *length_out);
-
bool
cksum_avx2 (FILE *fp, uint_fast32_t *crc_out, uintmax_t *length_out)
{
#include <config.h>
-#include <stdio.h>
+#include "cksum.h"
+
#include <sys/types.h>
-#include <stdint.h>
#include <x86intrin.h>
#include "system.h"
/* Number of bytes to read at once. */
#define BUFLEN (1 << 16)
-extern uint_fast32_t const crctab[8][256];
-
-extern bool
-cksum_avx512 (FILE *fp, uint_fast32_t *crc_out, uintmax_t *length_out);
-
bool
cksum_avx512 (FILE *fp, uint_fast32_t *crc_out, uintmax_t *length_out)
{
#include <config.h>
+#include "cksum.h"
+
#include <stdio.h>
#include <sys/types.h>
-#include <stdint.h>
#include <x86intrin.h>
#include "system.h"
/* Number of bytes to read at once. */
#define BUFLEN (1 << 16)
-extern uint_fast32_t const crctab[8][256];
-
-extern bool
-cksum_pclmul (FILE *fp, uint_fast32_t *crc_out, uintmax_t *length_out);
-
/* Calculate CRC32 using PCLMULQDQ CPU instruction found in x86/x64 CPUs */
bool
#include <config.h>
+#include "cksum.h"
+
#include <stdio.h>
#include <sys/types.h>
-#include <stdint.h>
#include <arm_neon.h>
#include "system.h"
/* Number of bytes to read at once. */
#define BUFLEN (1 << 16)
-extern uint_fast32_t const crctab[8][256];
-
-extern bool
-cksum_vmull (FILE *fp, uint_fast32_t *crc_out, uintmax_t *length_out);
-
static uint64x2_t
bswap_neon (uint64x2_t in)
{
data = bswap_neon (data);
/* XOR in initial CRC value (for us 0 so no effect), or CRC value
calculated for previous BUFLEN buffer from fread */
-
uint64_t wcrc = crc;
xor_crc = vcombine_u64 (vcreate_u64 (0), vcreate_u64 (wcrc << 32));
crc = 0;