Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added sanity_test_vectors.h check for ARM32 #929

Merged
merged 2 commits into from
Mar 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading