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.
72 lines
1.7 KiB
Plaintext
72 lines
1.7 KiB
Plaintext
test safepoint
|
|
set enable_safepoints=true
|
|
target x86_64 legacy
|
|
|
|
function %test(i32, r64, r64) -> r64 {
|
|
block0(v0: i32, v1:r64, v2:r64):
|
|
jump block1(v0)
|
|
block1(v3: i32):
|
|
v4 = irsub_imm v3, 1
|
|
jump block2(v4)
|
|
block2(v5: i32):
|
|
resumable_trap interrupt
|
|
brz v5, block1(v5)
|
|
jump block3
|
|
block3:
|
|
v6 = null.r64
|
|
v7 = is_null v6
|
|
brnz v7, block2(v0)
|
|
jump block4
|
|
block4:
|
|
brnz v0, block5
|
|
jump block6
|
|
block5:
|
|
return v1
|
|
block6:
|
|
return v2
|
|
}
|
|
|
|
; sameln: function %test(i32 [%rdi], r64 [%rsi], r64 [%rdx]) -> r64 [%rax] fast {
|
|
; nextln: block0(v0: i32 [%rdi], v1: r64 [%rsi], v2: r64 [%rdx]):
|
|
; nextln: v10 = copy v0
|
|
; nextln: jump block1(v10)
|
|
; nextln:
|
|
; nextln: block7:
|
|
; nextln: regmove.i32 v5, %rcx -> %rax
|
|
; nextln: jump block1(v5)
|
|
; nextln:
|
|
; nextln: block1(v3: i32 [%rax]):
|
|
; nextln: v8 = iconst.i32 1
|
|
; nextln: v4 = isub v8, v3
|
|
; nextln: jump block2(v4)
|
|
; nextln:
|
|
; nextln: block8:
|
|
; nextln: v9 = copy.i32 v0
|
|
; nextln: regmove v9, %rax -> %rcx
|
|
; nextln: jump block2(v9)
|
|
; nextln:
|
|
; nextln: block2(v5: i32 [%rcx]):
|
|
; nextln: safepoint v1, v2
|
|
; nextln: resumable_trap interrupt
|
|
; nextln: brz v5, block7
|
|
; nextln: jump block3
|
|
; nextln:
|
|
; nextln: block3:
|
|
; nextln: v6 = null.r64
|
|
; nextln: v7 = is_null v6
|
|
; nextln: brnz v7, block8
|
|
; nextln: jump block4
|
|
; nextln:
|
|
; nextln: block4:
|
|
; nextln: brnz.i32 v0, block5
|
|
; nextln: jump block6
|
|
; nextln:
|
|
; nextln: block5:
|
|
; nextln: regmove.r64 v1, %rsi -> %rax
|
|
; nextln: return v1
|
|
; nextln:
|
|
; nextln: block6:
|
|
; nextln: regmove.r64 v2, %rdx -> %rax
|
|
; nextln: return v2
|
|
; nextln: }
|