Files
wasmtime/cranelift/filetests/filetests/isa/aarch64/jumptable.clif
Trevor Elliott b077854b57 Generate SSA code from returns (#5172)
Modify return pseudo-instructions to have pairs of registers: virtual and real. This allows us to constrain the virtual registers to the real ones specified by the abi, instead of directly emitting moves to those real registers.
2022-11-08 16:00:49 -08:00

60 lines
964 B
Plaintext

test compile precise-output
set unwind_info=false
target aarch64
function %f(i32) -> i32 {
jt0 = jump_table [block1, block2, block3]
block0(v0: i32):
br_table v0, block4, jt0
block1:
v1 = iconst.i32 1
jump block5(v1)
block2:
v2 = iconst.i32 2
jump block5(v2)
block3:
v3 = iconst.i32 3
jump block5(v3)
block4:
v4 = iconst.i32 4
jump block5(v4)
block5(v5: i32):
v6 = iadd.i32 v0, v5
return v6
}
; block0:
; emit_island 44
; subs wzr, w0, #3
; b.hs label1 ; csel x15, xzr, x0, hs ; csdb ; adr x14, pc+16 ; ldrsw x15, [x14, x15, uxtw #2] ; add x14, x14, x15 ; br x14 ; jt_entries [Label(MachLabel(3)), Label(MachLabel(5)), Label(MachLabel(7))]
; block1:
; movz x5, #4
; b label2
; block2:
; b label9
; block3:
; movz x5, #1
; b label4
; block4:
; b label9
; block5:
; movz x5, #2
; b label6
; block6:
; b label9
; block7:
; movz x5, #3
; b label8
; block8:
; b label9
; block9:
; add w0, w0, w5
; ret