Trying to keep track of all the remaining correctness issues in the new arm64 backend, found when running Spidermonkey test cases. I'll update this list as I find and understand more issues.
cc @julian-seward1 @cfallin
anyref / reftypes integration. This is a large item that will require additional support in regalloc.rs too.emit_all_ones_funcaddrs setting (by putting all ones in unpatched code locations when this setting is set to true) => https://github.com/bytecodealliance/wasmtime/pull/1538avoid_div_traps setting is set to true. => #1585cc @bnjbvr
This issue or pull request has been labeled: "cranelift"
Thus the following users have been cc'd because of the following labels:
To subscribe or unsubscribe from this label, edit the .github/subscribe-to-label.json configuration file.
I'm working on a patch for the DIV by 0 and overflow issue.
I'll take care of float-to-int conversions edge cases. edit: done in https://github.com/bytecodealliance/wasmtime/pull/1578
I can take the trapif / ifcmp issue -- it's sort of a gnarly corner of isel. Also happy to fix rotate_left and the saturating conversions.
I'm now looking at rotations. There are a few tricks we can steal from Spidermonkey's implementation... done => https://github.com/bytecodealliance/wasmtime/pull/1584
Re trapif, investigation shows that a heap with explicit bounds checks will generate ifadd_cout to compute base+offset, then check for overflow with trapif if the carry flag is set. I'm happy to let others figure the right fix for this (this would require implementing ifadd_cout too, or lowering heap accesses with explicit bounds checks to something entirely different). Here's a test case extracted from Spidermonkey test suite.
function u0:0(i32, i64 vmctx) baldrdash_system_v {
gv0 = vmctx
gv1 = load.i64 notrap aligned gv0
gv2 = load.i32 notrap aligned gv0+8
heap0 = dynamic gv1, min 0x0001_0000, bound gv2, offset_guard 0xfff8, index_type i32
block0(v0: i32, v1: i64):
@0025 v4 = load.i32 notrap aligned v1+8
@0025 v5 = iconst.i32 0x7fff_ffe1
@0025 v6, v7 = iadd_ifcout v0, v5
@0025 trapif ult v7, heap_oob
@0025 v8 = icmp ugt v6, v4
@0025 brz v8, block3
@0025 jump block2
block2:
@0025 trap heap_oob
block3:
@0025 v9 = uextend.i64 v0
@0025 v10 = get_pinned_reg.i64
@0025 v2 = iadd v10, v9
@0025 v3 = sload8.i32 v2+0x7fff_ffff
@002d jump block1
block1:
@002d fallthrough_return
}
Confirmed that as of last Friday, Spidermonkey can run all the main tests, and only have the two remaining issues. I'll open up follow-up issues instead for both remaining items, because reftypes require a bunch of work in regalloc too, and heaps with explicit bounds checks is lower priority on arm64.
RESOLVED FIXED o/
Most helpful comment
Confirmed that as of last Friday, Spidermonkey can run all the main tests, and only have the two remaining issues. I'll open up follow-up issues instead for both remaining items, because reftypes require a bunch of work in regalloc too, and heaps with explicit bounds checks is lower priority on arm64.
RESOLVED FIXED o/