/*
 * Compiled several times with different -DXXH_VECTOR=<n> -DVARIANT=<name>,
 * so each object file carries one XXH3 code path of xxHash v0.8.3:
 *   0 = XXH_SCALAR, 1 = XXH_SSE2, 2 = XXH_AVX2 (needs -mavx2).
 */
#define XXH_INLINE_ALL
#include "xxhash.h"

#define CAT2(a, b) a##b
#define CAT(a, b) CAT2(a, b)

const int CAT(xxh3_vector_, VARIANT) = XXH_VECTOR;

uint64_t CAT(xxh3_64_, VARIANT)(const void *p, size_t n)
{
    return XXH3_64bits(p, n);
}

#ifdef XXH_EXTRA
uint64_t xxh64_0(const void *p, size_t n) { return XXH64(p, n, 0); }

uint64_t xxh3_64_seed(const void *p, size_t n, uint64_t seed)
{
    return XXH3_64bits_withSeed(p, n, seed);
}

void xxh3_128(const void *p, size_t n, uint64_t out[2])
{
    XXH128_hash_t h = XXH3_128bits(p, n);
    out[0] = h.low64;
    out[1] = h.high64;
}
#endif
