diff options
Diffstat (limited to 'src/wasm/wasm.cpp')
-rw-r--r-- | src/wasm/wasm.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/wasm/wasm.cpp b/src/wasm/wasm.cpp index f8439ea96..58510cc8f 100644 --- a/src/wasm/wasm.cpp +++ b/src/wasm/wasm.cpp @@ -159,6 +159,8 @@ const char* getExpressionName(Expression* curr) { return "simd_ternary"; case Expression::Id::SIMDShiftId: return "simd_shift"; + case Expression::Id::SIMDLoadId: + return "simd_load"; case Expression::Id::MemoryInitId: return "memory_init"; case Expression::Id::DataDropId: @@ -626,6 +628,28 @@ void SIMDShift::finalize() { } } +void SIMDLoad::finalize() { + assert(ptr); + type = v128; + if (ptr->type == unreachable) { + type = unreachable; + } +} + +Index SIMDLoad::getMemBytes() { + switch (op) { + case LoadSplatVec8x16: + return 1; + case LoadSplatVec16x8: + return 2; + case LoadSplatVec32x4: + return 4; + case LoadSplatVec64x2: + return 8; + } + WASM_UNREACHABLE(); +} + Const* Const::set(Literal value_) { value = value_; type = value.type; |