diff options
| author | Dan Gohman <sunfish@mozilla.com> | 2016-01-27 22:25:49 -0800 |
|---|---|---|
| committer | Dan Gohman <sunfish@mozilla.com> | 2016-01-27 22:25:49 -0800 |
| commit | 9ece6120d34d0f5bf58e0a2dd2a3360cfbff92c4 (patch) | |
| tree | 5195247850dd84a1657d2faf07b44729b7a6d3eb /AstSemantics.md | |
| parent | fb835be063c65cb279021a8d059f43431694ab71 (diff) | |
| parent | e9eeffca1efc2c17f8d00264a70ae628d16cc30e (diff) | |
| download | nanowasm-design-9ece6120d34d0f5bf58e0a2dd2a3360cfbff92c4.tar.gz | |
Merge pull request #489 from WebAssembly/select-operand-order
Reorder select's operands to put the condition last.
Diffstat (limited to 'AstSemantics.md')
| -rw-r--r-- | AstSemantics.md | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/AstSemantics.md b/AstSemantics.md index 5ef7af2..f0f3290 100644 --- a/AstSemantics.md +++ b/AstSemantics.md @@ -251,8 +251,6 @@ a value and may appear as children of other expressions. ### Branches and nesting The `br` and `br_if` constructs express low-level branching. -Branches that exit a `block`, `loop`, or `tableswitch` may take a subexpression -that yields a value for the exited construct. Branches may only reference labels defined by an outer *enclosing construct*. This means that, for example, references to a `block`'s label can only occur within the `block`'s body. @@ -265,6 +263,10 @@ further see the parallel, note that a `br` to a `block`'s label is functionally equivalent to a labeled `break` in high-level languages in that a `br` simply breaks out of a `block`. +Branches that exit a `block`, `loop`, or `tableswitch` may take a subexpression +that yields a value for the exited construct. If present, it is the first operand +before any others. + ### Yielding values from control constructs The `nop`, `if`, `br`, `br_if`, `case`, and `return` constructs do not yield values. @@ -561,10 +563,9 @@ outside the range which rounds to an integer in range) traps. ## Type-parameterized operators. - * `select`: a ternary operator with a boolean (i32) condition and two - additional operands, which must have the same type as each other. `select` - returns the the first of these two operands if the condition operand is - non-zero, or the second otherwise. + * `select`: a ternary operator with two operands, which have the same type as + each other, plus a boolean (i32) condition. `select` returns the first + operand if the condition operand is non-zero, or the second otherwise. ## Feature test |
