[ewasm] Add i32.select/i64.select

This commit is contained in:
Alex Beregszaszi
2020-11-30 11:58:33 +00:00
parent a5a560e163
commit 9640cfd77e
4 changed files with 21 additions and 0 deletions
+2
View File
@@ -156,6 +156,8 @@ Opcode constOpcodeFor(ValueType _type)
}
static map<string, uint8_t> const builtins = {
{"i32.select", 0x1b},
{"i64.select", 0x1b},
{"i32.load", 0x28},
{"i64.load", 0x29},
{"i32.load8_s", 0x2c},
+4
View File
@@ -120,6 +120,10 @@ WasmDialect::WasmDialect()
addFunction("i32.drop", {i32}, {});
addFunction("i64.drop", {i64}, {});
// Select is also overloaded.
addFunction("i32.select", {i32, i32, i32}, {i32});
addFunction("i64.select", {i64, i64, i32}, {i64});
addFunction("nop", {}, {});
addFunction("unreachable", {}, {}, false);
m_functions["unreachable"_yulstring].sideEffects.storage = SideEffects::None;