From d613e7258bca459a59cdb7b4fb8a7cb041137377 Mon Sep 17 00:00:00 2001 From: enricotenuti Date: Wed, 7 Aug 2024 20:09:12 +0200 Subject: cube_neon ver1 --- test/104_cocsep_ttrep/cocsep_ttrep_tests.c | 2 +- test/test.h | 9 +++++++- test/test.sh | 33 ++++++++++++++++-------------- 3 files changed, 27 insertions(+), 17 deletions(-) (limited to 'test') diff --git a/test/104_cocsep_ttrep/cocsep_ttrep_tests.c b/test/104_cocsep_ttrep/cocsep_ttrep_tests.c index f0da151..f692ca8 100644 --- a/test/104_cocsep_ttrep/cocsep_ttrep_tests.c +++ b/test/104_cocsep_ttrep/cocsep_ttrep_tests.c @@ -29,7 +29,7 @@ void run(void) { l = coord_cocsep(c); if (k != l) printf("cocsep %" PRId64 " (%" PRId64 "): " - "%" PRId64 " ttrep %" PRIu8 + "%" PRId64 " ttrep %" PRIu32 " -> %" PRId64 "\n", i, l, j, tt, k); } } diff --git a/test/test.h b/test/test.h index d092244..1f4b2c3 100644 --- a/test/test.h +++ b/test/test.h @@ -7,9 +7,16 @@ #define STRLENMAX 10000 -#ifdef CUBE_AVX2 +#if defined(CUBE_AVX2) #include typedef __m256i cube_t; +#elif defined(CUBE_NEON) +#include +#include +typedef struct { + uint8x16_t corner; + uint8x16_t edge; +} cube_t; #else typedef struct { uint8_t corner[8]; diff --git a/test/test.sh b/test/test.sh index 33613b1..4325c91 100755 --- a/test/test.sh +++ b/test/test.sh @@ -11,21 +11,24 @@ for t in test/*; do if [ -n "$re" ] && [ -z "$(echo "$t" | grep "$re")" ]; then continue fi - if [ ! -d $t ]; then continue; fi - $CC -o $TESTBIN $t/*.c $CUBEOBJ || exit 1; - for cin in $t/*.in; do - c=$(echo "$cin" | sed 's/\.in//') - cout=$c.out - printf "$c: " - $TESTBIN < "$cin" > $TESTOUT 2> $TESTERR - if diff $cout $TESTOUT; then - printf "OK\n" - else - printf "Test failed! stderr:\n" - cat $TESTERR - exit 1 - fi - done + + # Verifica se $t รจ una directory e se il suo nome inizia con tre cifre + if [ -d "$t" ] && echo "$(basename "$t")" | grep -Eq '^[0-9]{3}'; then + $CC -o $TESTBIN $t/*.c $CUBEOBJ || exit 1 + for cin in $t/*.in; do + c=$(echo "$cin" | sed 's/\.in//') + cout=$c.out + printf "$c: " + $TESTBIN < "$cin" > $TESTOUT 2> $TESTERR + if diff $cout $TESTOUT; then + printf "OK\n" + else + printf "Test failed! stderr:\n" + cat $TESTERR + exit 1 + fi + done + fi done echo "All tests passed!" -- cgit v1.3