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:
Trevor Elliott
2023-01-04 11:52:00 -08:00
committed by GitHub
parent d1920f5a2d
commit b2d5afdf83
7 changed files with 202 additions and 113 deletions

View 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