Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spell out the "literal" operators. #380

Merged
merged 4 commits into from
Oct 2, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions AstSemantics.md
Original file line number Diff line number Diff line change
Expand Up @@ -346,10 +346,16 @@ function that returns multiple values will likely have to be a statement that
specifies multiple local variables to which to assign the corresponding return
values.

## Literals
## Constants

Each local type allows literal values directly in the AST. See the
[binary encoding section](BinaryEncoding.md#constant-pool).
These opcodes have an immediate operand of their associated type which is
produced as their result value. All possible values of all types are
supported (including NaN values of all possible bit patterns).

* `i32.const`: produce the value of an i32 immediate
* `i64.const`: produce the value of an i64 immediate
* `f32.const`: produce the value of an f32 immediate
* `f64.const`: produce the value of an f64 immediate

## Expressions with control flow

Expand Down