The tests for the SIMD floating-point maximum and minimum operations require particular care because the handling of the NaN values is non-deterministic and may vary between platforms. There is no way to match several NaN values in a test, so the solution is to extract the non-deterministic test cases into a separate file that is subsequently replicated for every backend under test, with adjustments made to the expected results. Copyright (c) 2021, Arm Limited.
41 lines
792 B
Plaintext
41 lines
792 B
Plaintext
test simple_preopt
|
|
target aarch64
|
|
target x86_64
|
|
|
|
;; Tests for sign-extending immediates.
|
|
|
|
function %sign_extend_signed_icmp(i8) -> b1 {
|
|
block0(v0: i8):
|
|
; 255 = -1 as u8
|
|
v1 = iconst.i8 255
|
|
v2 = icmp sge v0, v1
|
|
; check: v2 = icmp_imm sge v0, -1
|
|
return v2
|
|
}
|
|
|
|
function %do_not_sign_extend_unsigned_icmp(i8) -> b1 {
|
|
block0(v0: i8):
|
|
v1 = iconst.i8 255
|
|
v2 = icmp uge v0, v1
|
|
; check: v2 = icmp_imm uge v0, 255
|
|
return v2
|
|
}
|
|
|
|
function %sign_extend_sdiv(i8) -> i8 {
|
|
block0(v0: i8):
|
|
; 255 = -1 as u8
|
|
v1 = iconst.i8 255
|
|
v2 = sdiv v0, v1
|
|
; check: v2 = sdiv_imm v0, -1
|
|
return v2
|
|
}
|
|
|
|
function %sign_extend_srem(i8) -> i8 {
|
|
block0(v0: i8):
|
|
; 255 = -1 as u8
|
|
v1 = iconst.i8 255
|
|
v2 = srem v0, v1
|
|
; check: v2 = srem_imm v0, -1
|
|
return v2
|
|
}
|