This commit goes through the `runtests` folder of the `filetests` test suite and ensure that everything which uses simd or float-related instructions on x64 is executed with the baseline support for x86_64 in addition to adding in AVX support. Most of the instructions used have AVX equivalents so this should help test all of the equivalents in addition to the codegen filetests in the x64 folder.
91 lines
2.6 KiB
Plaintext
91 lines
2.6 KiB
Plaintext
test interpret
|
|
test run
|
|
set enable_simd
|
|
target x86_64
|
|
target x86_64 has_avx
|
|
target s390x
|
|
target aarch64
|
|
target riscv64
|
|
|
|
|
|
function %fdemote(f64) -> f32 {
|
|
block0(v0: f64):
|
|
v1 = fdemote.f32 v0
|
|
return v1
|
|
}
|
|
; run: %fdemote(0x0.0) == 0x0.0
|
|
; run: %fdemote(-0x0.0) == -0x0.0
|
|
; run: %fdemote(0x0.1) == 0x0.1
|
|
; run: %fdemote(0x0.2) == 0x0.2
|
|
; run: %fdemote(0x0.5) == 0x0.5
|
|
; run: %fdemote(-0x0.5) == -0x0.5
|
|
; run: %fdemote(0x3.2) == 0x3.2
|
|
; run: %fdemote(0x9.0) == 0x9.0
|
|
; run: %fdemote(-0x9.0) == -0x9.0
|
|
; run: %fdemote(0x1.1p10) == 0x1.100000p10
|
|
; run: %fdemote(-0x1.1p10) == -0x1.100000p10
|
|
; run: %fdemote(0x1.c555555555556p10) == 0x1.c55556p10
|
|
; run: %fdemote(-0x1.999999999999ap-2) == -0x1.99999ap-2
|
|
; run: %fdemote(0x1.c3c3c3c3c3c3cp-1) == 0x1.c3c3c4p-1
|
|
; run: %fdemote(0x1.c924924924925p-1) == 0x1.c92492p-1
|
|
; run: %fdemote(0x1.4cccccccccccdp0) == 0x1.4cccccp0
|
|
|
|
|
|
;; Inf
|
|
; run: %fdemote(Inf) == Inf
|
|
; run: %fdemote(-Inf) == -Inf
|
|
|
|
;; Epsilon / Max / Min Positive
|
|
; run: %fdemote(0x1.0000000000000p-52) == 0x1.0000000000000p-52
|
|
; run: %fdemote(-0x1.0000000000000p-52) == -0x1.0000000000000p-52
|
|
; run: %fdemote(0x1.fffffffffffffp1023) == +Inf
|
|
; run: %fdemote(-0x1.fffffffffffffp1023) == -Inf
|
|
; run: %fdemote(0x1.0000000000000p-1022) == 0x0.0
|
|
; run: %fdemote(-0x1.0000000000000p-1022) == -0x0.0
|
|
|
|
;; Subnormals
|
|
; run: %fdemote(0x0.8000000000000p-1022) == 0x0.0
|
|
; run: %fdemote(-0x0.8000000000000p-1022) == -0x0.0
|
|
; run: %fdemote(0x0.0000000000001p-1022) == 0x0.0
|
|
; run: %fdemote(-0x0.0000000000001p-1022) == -0x0.0
|
|
|
|
|
|
;; NaN's
|
|
; For NaN's this operation is specified as producing a value that is a NaN
|
|
function %fdemote_is_nan(f64) -> i8 {
|
|
block0(v0: f64):
|
|
v1 = fdemote.f32 v0
|
|
v2 = fcmp ne v1, v1
|
|
return v2
|
|
}
|
|
; run: %fdemote_is_nan(+NaN) == 1
|
|
; run: %fdemote_is_nan(-NaN) == 1
|
|
; run: %fdemote_is_nan(+NaN:0x0) == 1
|
|
; run: %fdemote_is_nan(+NaN:0x1) == 1
|
|
; run: %fdemote_is_nan(+NaN:0x4000000000001) == 1
|
|
; run: %fdemote_is_nan(-NaN:0x0) == 1
|
|
; run: %fdemote_is_nan(-NaN:0x1) == 1
|
|
; run: %fdemote_is_nan(-NaN:0x4000000000001) == 1
|
|
; run: %fdemote_is_nan(+sNaN:0x1) == 1
|
|
; run: %fdemote_is_nan(-sNaN:0x1) == 1
|
|
; run: %fdemote_is_nan(+sNaN:0x4000000000001) == 1
|
|
; run: %fdemote_is_nan(-sNaN:0x4000000000001) == 1
|
|
|
|
|
|
;; Tests a fdemote+load combo which some backends may optimize
|
|
function %fdemote_load(i64, f64) -> f32 {
|
|
ss0 = explicit_slot 16
|
|
|
|
block0(v1: i64, v2: f64):
|
|
v3 = stack_addr.i64 ss0
|
|
store.f64 v2, v3
|
|
v4 = load.f64 v3
|
|
v5 = fdemote.f32 v4
|
|
return v5
|
|
}
|
|
; run: %fdemote_load(0, 0x0.0) == 0x0.0
|
|
; run: %fdemote_load(1, 0x0.1) == 0x0.1
|
|
; run: %fdemote_load(2, 0x0.2) == 0x0.2
|
|
; run: %fdemote_load(3, 0x3.2) == 0x3.2
|
|
; run: %fdemote_load(0x8, 0x3.2) == 0x3.2
|