Supports functions with multiple results (multi-value) (#446)

Signed-off-by: Adrian Cole <adrian@tetrate.io>
Signed-off-by: Takeshi Yoneda <takeshi@tetrate.io>
This commit is contained in:
Crypt Keeper
2022-04-13 09:22:39 +08:00
committed by GitHub
parent 927914ffb0
commit c3ff16d596
68 changed files with 5555 additions and 1155 deletions

View File

@@ -248,6 +248,16 @@ type Memory interface {
Write(offset uint32, v []byte) bool
}
// EncodeI32 encodes the input as a ValueTypeI32.
func EncodeI32(input int32) uint64 {
return uint64(uint32(input))
}
// EncodeI64 encodes the input as a ValueTypeI64.
func EncodeI64(input int64) uint64 {
return uint64(input)
}
// EncodeF32 encodes the input as a ValueTypeF32.
// See DecodeF32
func EncodeF32(input float32) uint64 {