This PR switches the default backend on x86, for both the `cranelift-codegen` crate and for Wasmtime, to the new (`MachInst`-style, `VCode`-based) backend that has been under development and testing for some time now. The old backend is still available by default in builds with the `old-x86-backend` feature, or by requesting `BackendVariant::Legacy` from the appropriate APIs. As part of that switch, it adds some more runtime-configurable plumbing to the testing infrastructure so that tests can be run using the appropriate backend. `clif-util test` is now capable of parsing a backend selector option from filetests and instantiating the correct backend. CI has been updated so that the old x86 backend continues to run its tests, just as we used to run the new x64 backend separately. At some point, we will remove the old x86 backend entirely, once we are satisfied that the new backend has not caused any unforeseen issues and we do not need to revert.
62 lines
1.9 KiB
Plaintext
62 lines
1.9 KiB
Plaintext
test legalizer
|
|
target x86_64 legacy haswell
|
|
|
|
;; Test that we don't reuse `sret` stack slots for multiple calls. We could do
|
|
;; this one day, but it would require some care to ensure that we don't have
|
|
;; subsequent calls overwrite the results of previous calls.
|
|
|
|
function %foo() -> i32, f32 {
|
|
; check: ss0 = sret_slot 20
|
|
; nextln: ss1 = sret_slot 20
|
|
|
|
fn0 = %f() -> i32, i32, i32, i32, i32
|
|
fn1 = %g() -> f32, f32, f32, f32, f32
|
|
; check: sig0 = (i64 sret [%rdi]) -> i64 sret [%rax] fast
|
|
; nextln: sig1 = (i64 sret [%rdi]) -> i64 sret [%rax] fast
|
|
; nextln: fn0 = %f sig0
|
|
; nextln: fn1 = %g sig1
|
|
|
|
block0:
|
|
v0, v1, v2, v3, v4 = call fn0()
|
|
; check: v18 = stack_addr.i64 ss0
|
|
; nextln: v25 = func_addr.i64 fn0
|
|
; nextln: v19 = call_indirect sig0, v25(v18)
|
|
; nextln: v20 = load.i32 notrap aligned v19
|
|
; nextln: v0 -> v20
|
|
; nextln: v21 = load.i32 notrap aligned v19+4
|
|
; nextln: v1 -> v21
|
|
; nextln: v22 = load.i32 notrap aligned v19+8
|
|
; nextln: v2 -> v22
|
|
; nextln: v23 = load.i32 notrap aligned v19+12
|
|
; nextln: v3 -> v23
|
|
; nextln: v24 = load.i32 notrap aligned v19+16
|
|
; nextln: v4 -> v24
|
|
|
|
v5, v6, v7, v8, v9 = call fn1()
|
|
; check: v26 = stack_addr.i64 ss1
|
|
; nextln: v33 = func_addr.i64 fn1
|
|
; nextln: v27 = call_indirect sig1, v33(v26)
|
|
; nextln: v28 = load.f32 notrap aligned v27
|
|
; nextln: v5 -> v28
|
|
; nextln: v29 = load.f32 notrap aligned v27+4
|
|
; nextln: v6 -> v29
|
|
; nextln: v30 = load.f32 notrap aligned v27+8
|
|
; nextln: v7 -> v30
|
|
; nextln: v31 = load.f32 notrap aligned v27+12
|
|
; nextln: v8 -> v31
|
|
; nextln: v32 = load.f32 notrap aligned v27+16
|
|
; nextln: v9 -> v32
|
|
|
|
v10 = iadd v0, v1
|
|
v11 = iadd v2, v3
|
|
v12 = iadd v10, v11
|
|
v13 = iadd v12, v4
|
|
|
|
v14 = fadd v5, v6
|
|
v15 = fadd v7, v8
|
|
v16 = fadd v14, v15
|
|
v17 = fadd v16, v9
|
|
|
|
return v13, v17
|
|
}
|