aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwargio <[email protected]>2022-09-17 16:22:54 +0200
committerwargio <[email protected]>2022-10-03 11:24:18 +0200
commitcf5d59cd4357d06f3e9c64f6ea652d5378ba5c35 (patch)
tree0c38e004cb2e05a28579d9a6905204885aa81f8c
parent7e15c5314ea0ca34c52fd39583b1aa7c07eac1ae (diff)
Support portable build without intrinsics
-rw-r--r--.github/workflows/ci.yml14
-rw-r--r--c/blake3_dispatch.c2
-rw-r--r--c/blake3_impl.h1
3 files changed, 15 insertions, 2 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index d7d754f..6b2bf71 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -233,3 +233,17 @@ jobs:
- name: build b3sum
run: cargo build --target aarch64-apple-darwin
working-directory: ./b3sum
+
+ build_tinycc:
+ name: build with the Tiny C Compiler
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v1
+ - name: install TCC
+ run: apt-get install -y tcc
+ - name: compile
+ run: >
+ tcc -shared -O3 -o libblake3.so \
+ -DBLAKE3_NO_SSE2 -DBLAKE3_NO_SSE41 -DBLAKE3_NO_AVX2 -DBLAKE3_NO_AVX512 \
+ blake3.c blake3_dispatch.c blake3_portable.c
+ working-directory: ./c \ No newline at end of file
diff --git a/c/blake3_dispatch.c b/c/blake3_dispatch.c
index 95213db..0f348ef 100644
--- a/c/blake3_dispatch.c
+++ b/c/blake3_dispatch.c
@@ -10,7 +10,7 @@
#elif defined(__GNUC__)
#include <immintrin.h>
#else
-#error "Unimplemented!"
+#undef IS_X86 /* Unimplemented! */
#endif
#endif
diff --git a/c/blake3_impl.h b/c/blake3_impl.h
index cc5672f..46c8fd8 100644
--- a/c/blake3_impl.h
+++ b/c/blake3_impl.h
@@ -46,7 +46,6 @@ enum blake3_flags {
#if defined(_MSC_VER)
#include <intrin.h>
#endif
-#include <immintrin.h>
#endif
#if !defined(BLAKE3_USE_NEON)