From fd8db871fc5d2a89b0e6aa2041695f5e6f655d00 Mon Sep 17 00:00:00 2001 From: titzer Date: Tue, 9 Feb 2016 10:26:33 +0100 Subject: Add definition of value_type. --- BinaryEncoding.md | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'BinaryEncoding.md') diff --git a/BinaryEncoding.md b/BinaryEncoding.md index 5e265ef..6150c86 100644 --- a/BinaryEncoding.md +++ b/BinaryEncoding.md @@ -43,6 +43,14 @@ A four-byte little endian unsigned integer. ### varuint32 A [LEB128](https://en.wikipedia.org/wiki/LEB128) variable-length integer, limited to uint32 values. +### value_type +A single-byte unsigned integer indicating a [value type](AstSemantics.md#types). These types are encoded as: +* `1` indicating type `i32` +* `2` indicating type `i64` +* `3` indicating type `f32` +* `4` indicating type `f64` + + # Definitions ### Pre-order encoding @@ -95,8 +103,8 @@ A module may contain at most one signatures section. | Field | Type | Description | | ----- | ----- | ----- | | param_count | `uint8` | the number of parameters to the function | -| return_type | `local_type?` | the return type of the function, with `0` indicating no return type | -| param_types | `local_type*` | the parameter types of the function, with
`1` indicating type `i32`
`2` indicating type `i64`
`3` indicating type `f32`
`4` indicating type `f64` | +| return_type | `value_type?` | the return type of the function, with `0` indicating no return type | +| param_types | `value_type*` | the parameter types of the function | ### Functions section The Functions section declares the functions in the module and must be preceded by a [Signatures](#signatures-section) section. A module may contain at most one functions section. -- cgit v1.2.3