cranelift: Implement icmp for scalar types
Add `icmp` tests for all scalar types and condition codes. AArch64 (no)overflow tests are disabled because they are currently failing.
This commit is contained in:
53
cranelift/filetests/filetests/runtests/icmp-sge.clif
Normal file
53
cranelift/filetests/filetests/runtests/icmp-sge.clif
Normal file
@@ -0,0 +1,53 @@
|
||||
test interpret
|
||||
test run
|
||||
target aarch64
|
||||
target x86_64 machinst
|
||||
|
||||
|
||||
function %icmp_sge_i8(i8, i8) -> b1 {
|
||||
block0(v0: i8, v1: i8):
|
||||
v2 = icmp sge v0, v1
|
||||
return v2
|
||||
}
|
||||
; run: %icmp_sge_i8(0, 0) == true
|
||||
; run: %icmp_sge_i8(1, 0) == true
|
||||
; run: %icmp_sge_i8(-1, -1) == true
|
||||
; run: %icmp_sge_i8(0, 1) == false
|
||||
; run: %icmp_sge_i8(-5, -1) == false
|
||||
; run: %icmp_sge_i8(1, -1) == true
|
||||
|
||||
function %icmp_sge_i16(i16, i16) -> b1 {
|
||||
block0(v0: i16, v1: i16):
|
||||
v2 = icmp sge v0, v1
|
||||
return v2
|
||||
}
|
||||
; run: %icmp_sge_i16(0, 0) == true
|
||||
; run: %icmp_sge_i16(1, 0) == true
|
||||
; run: %icmp_sge_i16(-1, -1) == true
|
||||
; run: %icmp_sge_i16(0, 1) == false
|
||||
; run: %icmp_sge_i16(-5, -1) == false
|
||||
; run: %icmp_sge_i16(1, -1) == true
|
||||
|
||||
function %icmp_sge_i32(i32, i32) -> b1 {
|
||||
block0(v0: i32, v1: i32):
|
||||
v2 = icmp sge v0, v1
|
||||
return v2
|
||||
}
|
||||
; run: %icmp_sge_i32(0, 0) == true
|
||||
; run: %icmp_sge_i32(1, 0) == true
|
||||
; run: %icmp_sge_i32(-1, -1) == true
|
||||
; run: %icmp_sge_i32(0, 1) == false
|
||||
; run: %icmp_sge_i32(-5, -1) == false
|
||||
; run: %icmp_sge_i32(1, -1) == true
|
||||
|
||||
function %icmp_sge_i64(i64, i64) -> b1 {
|
||||
block0(v0: i64, v1: i64):
|
||||
v2 = icmp sge v0, v1
|
||||
return v2
|
||||
}
|
||||
; run: %icmp_sge_i64(0, 0) == true
|
||||
; run: %icmp_sge_i64(1, 0) == true
|
||||
; run: %icmp_sge_i64(-1, -1) == true
|
||||
; run: %icmp_sge_i64(0, 1) == false
|
||||
; run: %icmp_sge_i64(-5, -1) == false
|
||||
; run: %icmp_sge_i64(1, -1) == true
|
||||
Reference in New Issue
Block a user