diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c9fdf6c..0565f5d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -877,7 +877,7 @@ jobs: run: | source ~/emsdk/emsdk_env.sh make features - make CIBUILD=true NOPLUGINS=true NOOPT=true STATIC_BUILD=true USE_GLES2=true -j $(nproc) + make CIBUILD=true NOPLUGINS=true NOOPT=true NOSIMD=true STATIC_BUILD=true USE_GLES2=true -j $(nproc) - name: Make wasm versioned and compress run: | VERSION=$(cat Makefile | awk 'sub("VERSION = ","")') diff --git a/deps/Makefile b/deps/Makefile index 8b4ec3f..b21e402 100644 --- a/deps/Makefile +++ b/deps/Makefile @@ -34,12 +34,12 @@ endif BASE_FLAGS += -I$(abspath ../include) BASE_FLAGS += -I$(abspath ../include/simd-compat) -ifeq ($(HAIKU)$(WASM),true) -BASE_FLAGS += -I$(abspath ../include/linux-compat) +ifneq (,$(findstring true,$(DEBUG)$(NOSIMD))) +BASE_FLAGS += -DCARDINAL_NOSIMD endif -ifeq ($(MOD_BUILD)$(WITH_LTO),true) -BASE_FLAGS += -ffat-lto-objects +ifeq ($(HAIKU)$(WASM),true) +BASE_FLAGS += -I$(abspath ../include/linux-compat) endif ifneq ($(SYSDEPS),true) diff --git a/docs/BUILDING.md b/docs/BUILDING.md index f059bab..13de9cc 100644 --- a/docs/BUILDING.md +++ b/docs/BUILDING.md @@ -23,6 +23,7 @@ Developer related options: * `DEBUG=true` build non-stripped debug binaries (terrible performance, only useful for developers) * `NOPLUGINS=true` build only the Cardinal Core plugins (not recommended, only useful for developers) +* `NOSIMD=true` build without SIMD (not recommended, only useful for developers) Packaging related options: diff --git a/include/simd-compat/emmintrin.h b/include/simd-compat/emmintrin.h index b349fb8..1ac1027 100644 --- a/include/simd-compat/emmintrin.h +++ b/include/simd-compat/emmintrin.h @@ -17,7 +17,7 @@ #pragma once -#if (defined(__i386__) || defined(__x86_64__) || defined(__EMSCRIPTEN__)) && !defined(CARDINAL_NOOPT) +#if (defined(__i386__) || defined(__x86_64__) || defined(__EMSCRIPTEN__)) && !defined(CARDINAL_NOSIMD) # include_next #else # define SIMDE_ENABLE_NATIVE_ALIASES diff --git a/include/simd-compat/immintrin.h b/include/simd-compat/immintrin.h index 1729310..3d18624 100644 --- a/include/simd-compat/immintrin.h +++ b/include/simd-compat/immintrin.h @@ -17,7 +17,7 @@ #pragma once -#if (defined(__i386__) || defined(__x86_64__) || defined(__EMSCRIPTEN__)) && !defined(CARDINAL_NOOPT) +#if (defined(__i386__) || defined(__x86_64__) || defined(__EMSCRIPTEN__)) && !defined(CARDINAL_NOSIMD) # include_next #else # define SIMDE_ENABLE_NATIVE_ALIASES diff --git a/include/simd-compat/mmintrin.h b/include/simd-compat/mmintrin.h index eab8d3b..7ee7529 100644 --- a/include/simd-compat/mmintrin.h +++ b/include/simd-compat/mmintrin.h @@ -17,9 +17,9 @@ #pragma once -#if (defined(__i386__) || defined(__x86_64__)) && !defined(CARDINAL_NOOPT) +#if (defined(__i386__) || defined(__x86_64__)) && !defined(CARDINAL_NOSIMD) # include_next -#elif defined(__EMSCRIPTEN__) && !defined(CARDINAL_NOOPT) +#elif defined(__EMSCRIPTEN__) && !defined(CARDINAL_NOSIMD) # include #else # define SIMDE_ENABLE_NATIVE_ALIASES diff --git a/include/simd-compat/pmmintrin.h b/include/simd-compat/pmmintrin.h index 2db8f17..3c35e0b 100644 --- a/include/simd-compat/pmmintrin.h +++ b/include/simd-compat/pmmintrin.h @@ -17,7 +17,7 @@ #pragma once -#if (defined(__i386__) || defined(__x86_64__)) && !defined(CARDINAL_NOOPT) +#if (defined(__i386__) || defined(__x86_64__)) && !defined(CARDINAL_NOSIMD) # include_next // bring in extra SSE3 support via simde @@ -40,7 +40,7 @@ # undef _WIN32_WAS_DEFINED # endif -#elif defined(__EMSCRIPTEN__) && !defined(CARDINAL_NOOPT) +#elif defined(__EMSCRIPTEN__) && !defined(CARDINAL_NOSIMD) # include_next static __inline__ __m64 __attribute__((__always_inline__, __nodebug__)) diff --git a/include/simd-compat/xmmintrin.h b/include/simd-compat/xmmintrin.h index 80536af..362a9da 100644 --- a/include/simd-compat/xmmintrin.h +++ b/include/simd-compat/xmmintrin.h @@ -17,7 +17,7 @@ #pragma once -#if (defined(__i386__) || defined(__x86_64__) || defined(__EMSCRIPTEN__)) && !defined(CARDINAL_NOOPT) +#if (defined(__i386__) || defined(__x86_64__) || defined(__EMSCRIPTEN__)) && !defined(CARDINAL_NOSIMD) # include_next #else # define SIMDE_ENABLE_NATIVE_ALIASES diff --git a/plugins/Makefile b/plugins/Makefile index 077f556..09bd940 100644 --- a/plugins/Makefile +++ b/plugins/Makefile @@ -1187,8 +1187,8 @@ ifeq ($(HEADLESS),true) BASE_FLAGS += -DHEADLESS endif -ifneq (,$(findstring true,$(DEBUG)$(NOOPT))) -BASE_FLAGS += -DCARDINAL_NOOPT +ifneq (,$(findstring true,$(DEBUG)$(NOSIMD))) +BASE_FLAGS += -DCARDINAL_NOSIMD endif ifeq ($(BSD)$(WASM),true) diff --git a/src/Makefile b/src/Makefile index 809e8cb..c0b8b3b 100644 --- a/src/Makefile +++ b/src/Makefile @@ -83,8 +83,8 @@ ifeq ($(HEADLESS),true) BASE_FLAGS += -DHEADLESS endif -ifneq (,$(findstring true,$(DEBUG)$(NOOPT))) -BASE_FLAGS += -DCARDINAL_NOOPT +ifneq (,$(findstring true,$(DEBUG)$(NOSIMD))) +BASE_FLAGS += -DCARDINAL_NOSIMD endif ifeq ($(BSD),true) diff --git a/src/Makefile.cardinal.mk b/src/Makefile.cardinal.mk index acfce24..9d857bf 100644 --- a/src/Makefile.cardinal.mk +++ b/src/Makefile.cardinal.mk @@ -298,8 +298,8 @@ ifeq ($(HEADLESS),true) BASE_FLAGS += -DHEADLESS endif -ifneq (,$(findstring true,$(DEBUG)$(NOOPT))) -BASE_FLAGS += -DCARDINAL_NOOPT +ifneq (,$(findstring true,$(DEBUG)$(NOSIMD))) +BASE_FLAGS += -DCARDINAL_NOSIMD endif ifeq ($(MOD_BUILD),true) diff --git a/src/emscripten/shell.html b/src/emscripten/shell.html index 8a372f8..d941f50 100644 --- a/src/emscripten/shell.html +++ b/src/emscripten/shell.html @@ -124,7 +124,7 @@ if (!WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,2,8,1,1,97,1,98,3,127,1,6,6,1,127,1,65,0,11,7,5,1,1,97,3,1]))) { wasmErrors.push('Importable/Exportable mutable globals unsupported'); } - if (!WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11]))) { + if (window.location.host !== "minicardinal.kx.studio" && !WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11]))) { wasmErrors.push('Fixed-Width SIMD unsupported'); } }