Skip to content

Commit

Permalink
x64: add test for bytecodealliance#3744
Browse files Browse the repository at this point in the history
In bytecodealliance#3744, we identified that extra `mov` instructions were inserted in
between the `cmov` instructions that CLIF's `select` lowers to. The
switch to regalloc2 resolved this and this test checks that no
intervening `mov`s are inserted. Closes bytecodealliance#3744.
  • Loading branch information
abrown committed May 3, 2022
1 parent 2122337 commit 3a3097a
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions cranelift/filetests/filetests/isa/x64/select-issue-3744.clif
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
test compile
target x86_64

; Check that no intervening moves are inserted when lowering `select` (see
; https://github.com/bytecodealliance/wasmtime/issues/3744).
function %select_eq_f32(f32, f32) -> i32 {
block0(v0: f32, v1: f32):
v2 = fcmp eq v0, v1
v3 = iconst.i32 1
v4 = iconst.i32 0
v5 = select v2, v3, v4
; check: ucomiss %xmm0, %xmm1
; nextln: cmovnzl %r8d, %eax, %eax
; nextln: cmovpl %r8d, %eax, %eax
return v5
}

0 comments on commit 3a3097a

Please sign in to comment.