riscv64: Implement fcmp in ISLE (#5512)
Rework the compilation of fcmp in the riscv64 backend to be in ISLE, removing the need for the dedicated Fcmp instruction. This change is motivated by #5500, which showed that the riscv64 backend was generating branch instructions in the middle of a basic block. We can't remove lower_br_fcmp quite yet as it's used in a few places in the emit module, but it's now no longer reachable from the ISLE lowerings. Fixes #5500
This commit is contained in:
29
cranelift/filetests/filetests/isa/riscv64/fcmp.clif
Normal file
29
cranelift/filetests/filetests/isa/riscv64/fcmp.clif
Normal file
@@ -0,0 +1,29 @@
|
||||
test compile precise-output
|
||||
target riscv64
|
||||
|
||||
;; See #5500 for more details about this test case.
|
||||
function %f0() {
|
||||
block0:
|
||||
v0 = f64const 0.0
|
||||
v1 = fcmp ult v0, v0
|
||||
brz v1, block1
|
||||
jump block1
|
||||
|
||||
block1:
|
||||
return
|
||||
}
|
||||
|
||||
; block0:
|
||||
; li t1,0
|
||||
; fmv.d.x ft1,t1
|
||||
; li a2,0
|
||||
; fmv.d.x ft5,a2
|
||||
; fle.d a5,ft5,ft1
|
||||
; bne a5,zero,taken(label1),not_taken(label2)
|
||||
; block1:
|
||||
; j label3
|
||||
; block2:
|
||||
; j label3
|
||||
; block3:
|
||||
; ret
|
||||
|
||||
Reference in New Issue
Block a user