Reference types introduces a typed select operation. It has identical execution semantics so no codegen change is needed.
20 lines
341 B
Plaintext
20 lines
341 B
Plaintext
(module
|
|
(func $untyped-select (result i32)
|
|
i32.const 42
|
|
i32.const 24
|
|
i32.const 1
|
|
select)
|
|
|
|
(func $typed-select-1 (result anyref)
|
|
ref.null
|
|
ref.null
|
|
i32.const 1
|
|
select (result anyref))
|
|
|
|
(func $typed-select-2 (param anyref) (result anyref)
|
|
ref.null
|
|
local.get 0
|
|
i32.const 1
|
|
select (result anyref))
|
|
)
|