fix codegen riscv64 normalize_cmp_value. (#5873)

* fix issue5839

* add target.

* fix normalize_cmp_value.

* fix test failutre.

* fix test failure.

* fix parameter type.

* Update cranelift/codegen/src/isa/riscv64/inst.isle

Co-authored-by: Jamey Sharp <jamey@minilop.net>

* Update cranelift/codegen/src/isa/riscv64/lower.isle

Co-authored-by: Jamey Sharp <jamey@minilop.net>

* remove convert rule from IntCC to ExtendOp

---------

Co-authored-by: Jamey Sharp <jamey@minilop.net>
This commit is contained in:
yuyang
2023-03-01 07:00:23 +08:00
committed by GitHub
parent 0e9a48afd5
commit 32cfd60877
9 changed files with 109 additions and 66 deletions

View File

@@ -0,0 +1,20 @@
test interpret
test run
set opt_level=speed
target aarch64
target s390x
target x86_64
target riscv64
function %a(i8, i8) -> i32 {
block0(v0: i8, v1: i8):
v2 = icmp sle v0, v1
v3 = uextend.i32 v2
v4 = iconst.i32 0
v5 = iconst.i32 1
v6 = icmp.i32 eq v3, v4 ; v4 = 0
v7 = select v6, v5, v3 ; v5 = 1
return v7
}
; run: %a(20, -11) == 1