Skip to content

Commit

Permalink
Merge pull request #929 from Cyan4973/sanity_vector
Browse files Browse the repository at this point in the history
added sanity_test_vectors.h check for ARM32
  • Loading branch information
Cyan4973 authored Mar 22, 2024
2 parents 38fa891 + 4b5573c commit d28b0bf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,8 @@ jobs:
run: |
CPPFLAGS="-DXXH_VECTOR=XXH_SCALAR" LDFLAGS="-static" CC=$XCC RUN_ENV=$XEMU make clean check
CPPFLAGS="-DXXH_VECTOR=XXH_NEON" CFLAGS="-O3 -march=armv7-a -fPIC -mfloat-abi=softfp -mfpu=neon-vfpv4" LDFLAGS="-static" CC=$XCC RUN_ENV=$XEMU make clean check
make -C tests clean
CPPFLAGS="-DXXH_VECTOR=XXH_SCALAR" LDFLAGS="-static" CC=$XCC RUN_ENV=$XEMU make -C tests sanity_test_vectors.h test_sanity
- name: AARCH64 (XXH_VECTOR=[ scalar, NEON, SVE ])
if: ${{ startsWith(matrix.name, 'AARCH64') }}
Expand Down
12 changes: 6 additions & 6 deletions tests/sanity_test_vectors_generator.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,11 @@ static void fprintf_XSUM_testdata32_t(FILE* fp, XSUM_testdata32_t const v) {
}

static void fprintf_XSUM_testdata64_t(FILE* fp, XSUM_testdata64_t const v) {
fprintf(fp, "{ %4d, 0x%016zXULL, 0x%016zXULL },", v.len, v.seed, v.Nresult);
fprintf(fp, "{ %4d, 0x%016llXULL, 0x%016llXULL },", v.len, v.seed, v.Nresult);
}

static void fprintf_XSUM_testdata128_t(FILE* fp, XSUM_testdata128_t const v) {
fprintf(fp, "{ %4d, 0x%016zXULL, { 0x%016zXULL, 0x%016zXULL } },",
fprintf(fp, "{ %4d, 0x%016llXULL, { 0x%016llXULL, 0x%016llXULL } },",
v.len, v.seed, v.Nresult.low64, v.Nresult.high64);
}

Expand Down Expand Up @@ -208,7 +208,7 @@ static void generate_sanity_test_vectors_xxh32(FILE* fp, size_t maxLen) {

size_t index = 0;
for(size_t len = 0; len < maxLen; ++len) {
static const size_t seeds[] = { 0, PRIME32 };
static const uint64_t seeds[] = { 0, PRIME32 };
for(size_t iSeed = 0; iSeed < sizeof(seeds)/sizeof(seeds[0]); ++iSeed) {
size_t const seed = seeds[iSeed];
XSUM_testdata32_t const v = tvgen_XXH32(sanityBuffer, len, seed);
Expand All @@ -234,7 +234,7 @@ static void generate_sanity_test_vectors_xxh64(FILE* fp, size_t maxLen) {

size_t index = 0;
for(size_t len = 0; len < maxLen; ++len) {
static const size_t seeds[] = { 0, PRIME32 };
static const uint64_t seeds[] = { 0, PRIME32 };
for(size_t iSeed = 0; iSeed < sizeof(seeds)/sizeof(seeds[0]); ++iSeed) {
size_t const seed = seeds[iSeed];
XSUM_testdata64_t const v = tvgen_XXH64(sanityBuffer, len, seed);
Expand All @@ -260,7 +260,7 @@ static void generate_sanity_test_vectors_xxh3(FILE* fp, size_t maxLen) {

size_t index = 0;
for(size_t len = 0; len < maxLen; ++len) {
static const size_t seeds[] = { 0, PRIME64 };
static const uint64_t seeds[] = { 0, PRIME64 };
for(size_t iSeed = 0; iSeed < sizeof(seeds)/sizeof(seeds[0]); ++iSeed) {
size_t const seed = seeds[iSeed];
XSUM_testdata64_t const v = tvgen_XXH3_64bits_withSeed(sanityBuffer, len, seed);
Expand Down Expand Up @@ -312,7 +312,7 @@ static void generate_sanity_test_vectors_xxh128(FILE* fp, size_t maxLen) {

size_t index = 0;
for(size_t len = 0; len < maxLen; ++len) {
static const size_t seeds[] = { 0, PRIME32, PRIME64 };
static const uint64_t seeds[] = { 0, PRIME32, PRIME64 };
for(size_t iSeed = 0; iSeed < sizeof(seeds)/sizeof(seeds[0]); ++iSeed) {
XSUM_U64 const seed = seeds[iSeed];
XSUM_testdata128_t const v = tvgen_XXH3_128bits_withSeed(sanityBuffer, len, seed);
Expand Down

0 comments on commit d28b0bf

Please sign in to comment.