Skip to content

Commit 28ab7b4

Browse files
committed
wasm: __wasm_fp16__ is required for Float16 with emscripten or wasi
Fixes: #1187
1 parent fc0adc0 commit 28ab7b4

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

simde/simde-f16.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ SIMDE_BEGIN_DECLS_
6868
#if !defined(SIMDE_FLOAT16_API)
6969
#if defined(__ARM_FP16_FORMAT_IEEE) && (defined(SIMDE_ARM_NEON_FP16) || defined(__ARM_FP16_ARGS))
7070
#define SIMDE_FLOAT16_API SIMDE_FLOAT16_API_FP16
71-
#elif !defined(__EMSCRIPTEN__) && !(defined(__clang__) && defined(SIMDE_ARCH_POWER)) && \
71+
#elif !((defined(__EMSCRIPTEN__) || defined(__wasi__)) && !defined(__wasm_fp16__)) && \
72+
!(defined(__clang__) && defined(SIMDE_ARCH_POWER)) && \
7273
!(defined(HEDLEY_MSVC_VERSION) && defined(__clang__)) && \
7374
!(defined(SIMDE_ARCH_MIPS) && defined(__clang__)) && \
7475
!(defined(SIMDE_ARCH_ZARCH) && defined(__clang__)) && \

test/x86/avx.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
#endif
2828
#include <simde/x86/avx.h>
2929
#include <test/x86/test-avx.h>
30-
#if !defined(HEDLEY_MSVC_VERSION)
30+
#if !defined(HEDLEY_MSVC_VERSION) && !defined(__wasi__)
3131
#include <sys/mman.h>
3232
#endif
3333

@@ -9853,7 +9853,7 @@ test_simde_mm_maskload_pd (SIMDE_MUNIT_TEST_ARGS) {
98539853
return 0;
98549854
}
98559855

9856-
#if !defined(HEDLEY_MSVC_VERSION)
9856+
#if !defined(HEDLEY_MSVC_VERSION) && !defined(__wasi__)
98579857
static int
98589858
test_simde_mm_maskload_pd_no_illegal_memory_access (SIMDE_MUNIT_TEST_ARGS) {
98599859
// ref: https://github.com/simd-everywhere/simde/issues/998
@@ -9914,7 +9914,7 @@ test_simde_mm256_maskload_pd (SIMDE_MUNIT_TEST_ARGS) {
99149914
return 0;
99159915
}
99169916

9917-
#if !defined(HEDLEY_MSVC_VERSION)
9917+
#if !defined(HEDLEY_MSVC_VERSION) && !defined(__wasi__)
99189918
static int
99199919
test_simde_mm256_maskload_pd_no_illegal_memory_access (SIMDE_MUNIT_TEST_ARGS) {
99209920
// ref: https://github.com/simd-everywhere/simde/issues/998
@@ -9975,7 +9975,7 @@ test_simde_mm_maskload_ps (SIMDE_MUNIT_TEST_ARGS) {
99759975
return 0;
99769976
}
99779977

9978-
#if !defined(HEDLEY_MSVC_VERSION)
9978+
#if !defined(HEDLEY_MSVC_VERSION) && !defined(__wasi__)
99799979
static int
99809980
test_simde_mm_maskload_ps_no_illegal_memory_access (SIMDE_MUNIT_TEST_ARGS) {
99819981
// ref: https://github.com/simd-everywhere/simde/issues/998
@@ -10053,7 +10053,7 @@ test_simde_mm256_maskload_ps (SIMDE_MUNIT_TEST_ARGS) {
1005310053
return 0;
1005410054
}
1005510055

10056-
#if !defined(HEDLEY_MSVC_VERSION)
10056+
#if !defined(HEDLEY_MSVC_VERSION) && !defined(__wasi__)
1005710057
static int
1005810058
test_simde_mm256_maskload_ps_no_illegal_memory_access (SIMDE_MUNIT_TEST_ARGS) {
1005910059
// ref: https://github.com/simd-everywhere/simde/issues/998
@@ -16645,7 +16645,7 @@ SIMDE_TEST_FUNC_LIST_BEGIN
1664516645
SIMDE_TEST_FUNC_LIST_ENTRY(mm_maskload_ps)
1664616646
SIMDE_TEST_FUNC_LIST_ENTRY(mm256_maskload_ps)
1664716647

16648-
#if !defined(HEDLEY_MSVC_VERSION)
16648+
#if !defined(HEDLEY_MSVC_VERSION) && !defined(__wasi__)
1664916649
SIMDE_TEST_FUNC_LIST_ENTRY(mm_maskload_pd_no_illegal_memory_access)
1665016650
SIMDE_TEST_FUNC_LIST_ENTRY(mm256_maskload_pd_no_illegal_memory_access)
1665116651
SIMDE_TEST_FUNC_LIST_ENTRY(mm_maskload_ps_no_illegal_memory_access)

0 commit comments

Comments
 (0)