Merge remote-tracking branch 'origin/develop' into breaking

This commit is contained in:
chriseth
2020-12-01 10:50:13 +01:00
81 changed files with 1740 additions and 775 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;
+3 -3
View File
@@ -90,9 +90,9 @@ function mul_64x64_128(x, y) -> hi, lo {
// value split into four 64 bit values.
function mul_128x128_256(x1, x2, y1, y2) -> r1, r2, r3, r4 {
let ah, al := mul_64x64_128(x1, y1)
let bh, bl := mul_64x64_128(x1, y2)
let ch, cl := mul_64x64_128(x2, y1)
let dh, dl := mul_64x64_128(x2, y2)
let bh, bl := mul_64x64_128(x1, y2)
let ch, cl := mul_64x64_128(x2, y1)
let dh, dl := mul_64x64_128(x2, y2)
r4 := dl
let carry1, carry2
let t1, t2
+13 -14
View File
@@ -35,24 +35,23 @@ function iszero512(x1, x2, x3, x4, x5, x6, x7, x8) -> r:i32 {
}
function eq(x1, x2, x3, x4, y1, y2, y3, y4) -> r1, r2, r3, r4 {
if i64.eq(x1, y1) {
if i64.eq(x2, y2) {
if i64.eq(x3, y3) {
if i64.eq(x4, y4) {
r4 := 1
}
}
}
}
r4 := i64.extend_i32_u(
i32.and(
i64.eq(x1, y1),
i32.and(
i64.eq(x2, y2),
i32.and(
i64.eq(x3, y3),
i64.eq(x4, y4)
)
)
)
)
}
// returns 0 if a == b, -1 if a < b and 1 if a > b
function cmp(a, b) -> r:i32 {
switch i64.lt_u(a, b)
case 1:i32 { r := 0xffffffff:i32 }
default {
r := i64.ne(a, b)
}
r := i32.select(0xffffffff:i32, i64.ne(a, b), i64.lt_u(a, b))
}
function lt_320x320_64(x1, x2, x3, x4, x5, y1, y2, y3, y4, y5) -> z:i32 {