summaryrefslogtreecommitdiff
path: root/src/prebuilt/wasm2c_simd_source_declarations.cc
diff options
context:
space:
mode:
authorSoni L <EnderMoneyMod@gmail.com>2023-11-14 22:25:41 -0300
committerGitHub <noreply@github.com>2023-11-14 17:25:41 -0800
commit21e73b7e6eee4addbc84ae265ee2f5ca88178934 (patch)
treea6ea97dbf70a173e7f5667487ca0e4a64a8b97f5 /src/prebuilt/wasm2c_simd_source_declarations.cc
parenta0bc02eacae79763d35360673620ab38d527f68a (diff)
downloadwabt-21e73b7e6eee4addbc84ae265ee2f5ca88178934.tar.gz
wabt-21e73b7e6eee4addbc84ae265ee2f5ca88178934.tar.bz2
wabt-21e73b7e6eee4addbc84ae265ee2f5ca88178934.zip
wasm2c: Improve address abstraction for BE support (#2328)
Diffstat (limited to 'src/prebuilt/wasm2c_simd_source_declarations.cc')
-rw-r--r--src/prebuilt/wasm2c_simd_source_declarations.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/prebuilt/wasm2c_simd_source_declarations.cc b/src/prebuilt/wasm2c_simd_source_declarations.cc
index bbd10ee5..07425377 100644
--- a/src/prebuilt/wasm2c_simd_source_declarations.cc
+++ b/src/prebuilt/wasm2c_simd_source_declarations.cc
@@ -17,7 +17,7 @@ R"w2c_template( static inline v128 name(wasm_rt_memory_t* mem, u64 addr) { \
)w2c_template"
R"w2c_template( MEMCHECK(mem, addr, t); \
)w2c_template"
-R"w2c_template( v128 result = func((v128*)&mem->data[addr]); \
+R"w2c_template( v128 result = func(MEM_ADDR(mem, addr, sizeof(t))); \
)w2c_template"
R"w2c_template( SIMD_FORCE_READ(result); \
)w2c_template"
@@ -32,7 +32,7 @@ R"w2c_template( static inline v128 name(wasm_rt_memory_t* mem, u64 addr, v128 v
)w2c_template"
R"w2c_template( MEMCHECK(mem, addr, t); \
)w2c_template"
-R"w2c_template( v128 result = func((v128*)&mem->data[addr], vec, lane); \
+R"w2c_template( v128 result = func(MEM_ADDR(mem, addr, sizeof(t)), vec, lane); \
)w2c_template"
R"w2c_template( SIMD_FORCE_READ(result); \
)w2c_template"
@@ -47,7 +47,7 @@ R"w2c_template( static inline void name(wasm_rt_memory_t* mem, u64 addr, v128 v
)w2c_template"
R"w2c_template( MEMCHECK(mem, addr, t); \
)w2c_template"
-R"w2c_template( simde_wasm_v128_store((v128*)&mem->data[addr], value); \
+R"w2c_template( simde_wasm_v128_store(MEM_ADDR(mem, addr, sizeof(t)), value); \
)w2c_template"
R"w2c_template( }
)w2c_template"
@@ -58,7 +58,7 @@ R"w2c_template( static inline void name(wasm_rt_memory_t* mem, u64 addr, v128 v
)w2c_template"
R"w2c_template( MEMCHECK(mem, addr, t); \
)w2c_template"
-R"w2c_template( func((v128*)&mem->data[addr], value, lane); \
+R"w2c_template( func(MEM_ADDR(mem, addr, sizeof(t)), value, lane); \
)w2c_template"
R"w2c_template( }
)w2c_template"