Files
wasmtime/cranelift/filetests/filetests/isa/x64/ifcmp-sp.clif
Chris Fallin 5e96a447f0 Add back the ifcmp_sp CLIF opcode.
This opcode was removed as part of the old-backend cleanup in #3446.
While this opcode will definitely go away eventually, it is
unfortunately still used today in Lucet (as we just discovered while
working to upgrade Lucet's pinned Cranelift version). Lucet is
deprecated and slated to eventually be completely sunset in favor of
Wasmtime; but until that happens, we need to keep this opcode.
2021-11-01 13:34:31 -07:00

32 lines
531 B
Plaintext

test compile
target x86_64
function %f(i64) -> i32 {
block0(v0: i64):
v1 = ifcmp_sp v0
brif ugt v1, block1
jump block2
block1:
v2 = iconst.i32 0
return v2
block2:
v3 = iconst.i32 1
return v3
}
; check: pushq %rbp
; nextln: movq %rsp, %rbp
; nextln: cmpq %rsp, %rdi
; nextln: jnbe label1; j label2
; check: xorl %eax, %eax
; nextln: movq %rbp, %rsp
; nextln: popq %rbp
; nextln: ret
; check: movl $$1, %eax
; nextln: movq %rbp, %rsp
; nextln: popq %rbp
; nextln: ret