-
Notifications
You must be signed in to change notification settings - Fork 839
Closed
Description
Example:
(module
(memory 0 0)
(func $f1 (param $i1 i32) (result i32)
(i32.select
(i32.lt_s
(get_local $i1)
(i32.const 0)
)
(i32.sub
(i32.const 0)
(get_local $i1)
)
(get_local $i1)
)
(i32.const 0))
)
sexp-wasm emits the select operator arguments in the wast order.
0000010: 05 ; OPCODE_SELECT
0000011: 4f ; OPCODE_I32_LT_S
0000012: 0e ; OPCODE_GET_LOCAL
0000013: 00 ; remapped local index
0000014: 09 ; OPCODE_I8_CONST
0000015: 00 ; u8 literal
0000016: 41 ; OPCODE_I32_SUB
0000017: 09 ; OPCODE_I8_CONST
0000018: 00 ; u8 literal
0000019: 0e ; OPCODE_GET_LOCAL
000001a: 00 ; remapped local index
000001b: 0e ; OPCODE_GET_LOCAL
000001c: 00 ; remapped local index
000001d: 09 ; OPCODE_I8_CONST
000001e: 00 ; u8 literal
Interestingly wasm-as emits them in the opposite order, that is the i32.sub first then the i32.lt_s.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels