implement v128.load[32|64]_zero

This commit is contained in:
Ilya Rezvov
2023-09-08 10:40:27 -06:00
parent d406776095
commit dad521025e
5 changed files with 25 additions and 1 deletions
+8
View File
@@ -895,6 +895,14 @@ eval budget store inst FunctionInstance { funcType, moduleInstance, code = Funct
makeLoadInstr @Word64 ctx offset 8 $ \rest val ->
let v = ByteArray.byteArrayFromListN 2 [val, val] in
Done ctx { stack = VV128 v : rest }
step ctx (V128Load32Zero MemArg { offset }) =
makeLoadInstr @Word32 ctx offset 4 $ \rest val ->
let v = ByteArray.byteArrayFromListN 4 $ val : [0, 0, 0] in
Done ctx { stack = VV128 v : rest }
step ctx (V128Load64Zero MemArg { offset }) =
makeLoadInstr @Word64 ctx offset 8 $ \rest val ->
let v = ByteArray.byteArrayFromListN 2 [val, 0] in
Done ctx { stack = VV128 v : rest }
step ctx (I32Load8U MemArg { offset }) =
makeLoadInstr @Word8 ctx offset 1 $ (\rest val -> Done ctx { stack = VI32 (fromIntegral val) : rest })
step ctx (I32Load8S MemArg { offset }) =