aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/ci.yml16
-rw-r--r--c/Makefile11
2 files changed, 27 insertions, 0 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 599da51..8d1fbaf 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -100,6 +100,7 @@ jobs:
steps:
- uses: actions/checkout@v1
+ # Test the intrinsics-based implementations.
- run: make test
working-directory: ./c
- run: make clean && rm blake3_sse41.c
@@ -114,3 +115,18 @@ jobs:
working-directory: ./c
- run: BLAKE3_NO_SSE41=1 BLAKE3_NO_AVX2=1 BLAKE3_NO_AVX512=1 make test
working-directory: ./c
+ # Test the assembly implementations.
+ - run: make test_asm
+ working-directory: ./c
+ - run: make clean && rm blake3-sse41-x86_64-unix.S
+ working-directory: ./c
+ - run: BLAKE3_NO_SSE41=1 make test_asm
+ working-directory: ./c
+ - run: make clean && rm blake3-avx2-x86_64-unix.S
+ working-directory: ./c
+ - run: BLAKE3_NO_SSE41=1 BLAKE3_NO_AVX2=1 make test_asm
+ working-directory: ./c
+ - run: make clean && rm blake3-avx512-x86_64-unix.S
+ working-directory: ./c
+ - run: BLAKE3_NO_SSE41=1 BLAKE3_NO_AVX2=1 BLAKE3_NO_AVX512=1 make test_asm
+ working-directory: ./c
diff --git a/c/Makefile b/c/Makefile
index 37273b0..5cf77e4 100644
--- a/c/Makefile
+++ b/c/Makefile
@@ -2,24 +2,28 @@ NAME=blake3
CC=gcc
CFLAGS=-O3 -Wall -Wextra -std=c11 -pedantic
TARGETS=
+ASM_TARGETS=
EXTRAFLAGS=
ifdef BLAKE3_NO_SSE41
EXTRAFLAGS += -DBLAKE3_NO_SSE41
else
TARGETS += blake3_sse41.o
+ASM_TARGETS += blake3-sse41-x86_64-unix.S
endif
ifdef BLAKE3_NO_AVX2
EXTRAFLAGS += -DBLAKE3_NO_AVX2
else
TARGETS += blake3_avx2.o
+ASM_TARGETS += blake3-avx2-x86_64-unix.S
endif
ifdef BLAKE3_NO_AVX512
EXTRAFLAGS += -DBLAKE3_NO_AVX512
else
TARGETS += blake3_avx512.o
+ASM_TARGETS += blake3-avx512-x86_64-unix.S
endif
ifdef BLAKE3_USE_NEON
@@ -46,5 +50,12 @@ test: CFLAGS += -DBLAKE3_TESTING -fsanitize=address,undefined
test: all
./test.py
+asm: blake3.c blake3_dispatch.c blake3_portable.c main.c $(ASM_TARGETS)
+ $(CC) $(CFLAGS) $(EXTRAFLAGS) $^ -o $(NAME)
+
+test_asm: CFLAGS += -DBLAKE3_TESTING -fsanitize=address,undefined
+test_asm: asm
+ ./test.py
+
clean:
rm -f $(NAME) *.o