summaryrefslogtreecommitdiff
path: root/src/template/wasm2c_simd.declarations.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/template/wasm2c_simd.declarations.c')
-rw-r--r--src/template/wasm2c_simd.declarations.c43
1 files changed, 23 insertions, 20 deletions
diff --git a/src/template/wasm2c_simd.declarations.c b/src/template/wasm2c_simd.declarations.c
index 0e2c9511..39eb4578 100644
--- a/src/template/wasm2c_simd.declarations.c
+++ b/src/template/wasm2c_simd.declarations.c
@@ -7,33 +7,36 @@
#endif
// TODO: equivalent constraint for ARM and other architectures
-#define DEFINE_SIMD_LOAD_FUNC(name, func, t) \
- static inline v128 name(wasm_rt_memory_t* mem, u64 addr) { \
- MEMCHECK(mem, addr, t); \
- v128 result = func(MEM_ADDR(mem, addr, sizeof(t))); \
- SIMD_FORCE_READ(result); \
- return result; \
- }
+#define DEFINE_SIMD_LOAD_FUNC(name, func, t) \
+ static inline v128 name##_unchecked(wasm_rt_memory_t* mem, u64 addr) { \
+ v128 result = func(MEM_ADDR(mem, addr, sizeof(t))); \
+ SIMD_FORCE_READ(result); \
+ return result; \
+ } \
+ DEF_MEM_CHECKS0(name, _, t, return, v128);
#define DEFINE_SIMD_LOAD_LANE(name, func, t, lane) \
- static inline v128 name(wasm_rt_memory_t* mem, u64 addr, v128 vec) { \
- MEMCHECK(mem, addr, t); \
+ static inline v128 name##_unchecked(wasm_rt_memory_t* mem, u64 addr, \
+ v128 vec) { \
v128 result = func(MEM_ADDR(mem, addr, sizeof(t)), vec, lane); \
SIMD_FORCE_READ(result); \
return result; \
- }
+ } \
+ DEF_MEM_CHECKS1(name, _, t, return, v128, v128);
-#define DEFINE_SIMD_STORE(name, t) \
- static inline void name(wasm_rt_memory_t* mem, u64 addr, v128 value) { \
- MEMCHECK(mem, addr, t); \
- simde_wasm_v128_store(MEM_ADDR(mem, addr, sizeof(t)), value); \
- }
+#define DEFINE_SIMD_STORE(name, t) \
+ static inline void name##_unchecked(wasm_rt_memory_t* mem, u64 addr, \
+ v128 value) { \
+ simde_wasm_v128_store(MEM_ADDR(mem, addr, sizeof(t)), value); \
+ } \
+ DEF_MEM_CHECKS1(name, _, t, , void, v128);
-#define DEFINE_SIMD_STORE_LANE(name, func, t, lane) \
- static inline void name(wasm_rt_memory_t* mem, u64 addr, v128 value) { \
- MEMCHECK(mem, addr, t); \
- func(MEM_ADDR(mem, addr, sizeof(t)), value, lane); \
- }
+#define DEFINE_SIMD_STORE_LANE(name, func, t, lane) \
+ static inline void name##_unchecked(wasm_rt_memory_t* mem, u64 addr, \
+ v128 value) { \
+ func(MEM_ADDR(mem, addr, sizeof(t)), value, lane); \
+ } \
+ DEF_MEM_CHECKS1(name, _, t, , void, v128);
// clang-format off
#if WABT_BIG_ENDIAN