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.
111 lines
4.5 KiB
Plaintext
111 lines
4.5 KiB
Plaintext
test interpret
|
|
test run
|
|
set enable_simd
|
|
target aarch64
|
|
target x86_64
|
|
target x86_64 has_avx
|
|
target s390x
|
|
target riscv64
|
|
|
|
function %fcopysign_f32(f32, f32) -> f32 {
|
|
block0(v0: f32, v1: f32):
|
|
v2 = fcopysign v0, v1
|
|
return v2
|
|
}
|
|
; run: %fcopysign_f32(0x9.0, 0x9.0) == 0x9.0
|
|
; run: %fcopysign_f32(-0x9.0, 0x9.0) == 0x9.0
|
|
; run: %fcopysign_f32(0x9.0, -0x9.0) == -0x9.0
|
|
; run: %fcopysign_f32(-0x9.0, -0x9.0) == -0x9.0
|
|
; run: %fcopysign_f32(0x0.0, -0x0.0) == -0x0.0
|
|
; run: %fcopysign_f32(-0x0.0, 0x0.0) == 0x0.0
|
|
|
|
; F32 Inf
|
|
; run: %fcopysign_f32(Inf, Inf) == Inf
|
|
; run: %fcopysign_f32(-Inf, Inf) == Inf
|
|
; run: %fcopysign_f32(Inf, -Inf) == -Inf
|
|
; run: %fcopysign_f32(-Inf, -Inf) == -Inf
|
|
|
|
; F32 Epsilon / Max / Min Positive
|
|
; run: %fcopysign_f32(0x1.000000p-23, -0x0.0) == -0x1.000000p-23
|
|
; run: %fcopysign_f32(-0x1.000000p-23, 0x0.0) == 0x1.000000p-23
|
|
; run: %fcopysign_f32(0x1.fffffep127, -0x0.0) == -0x1.fffffep127
|
|
; run: %fcopysign_f32(-0x1.fffffep127, 0x0.0) == 0x1.fffffep127
|
|
; run: %fcopysign_f32(0x1.000000p-126, -0x0.0) == -0x1.000000p-126
|
|
; run: %fcopysign_f32(-0x1.000000p-126, 0x0.0) == 0x1.000000p-126
|
|
|
|
; F32 Subnormals
|
|
; run: %fcopysign_f32(0x0.800000p-126, -0x0.0) == -0x0.800000p-126
|
|
; run: %fcopysign_f32(-0x0.800000p-126, 0x0.0) == 0x0.800000p-126
|
|
; run: %fcopysign_f32(0x0.000002p-126, -0x0.0) == -0x0.000002p-126
|
|
; run: %fcopysign_f32(-0x0.000002p-126, 0x0.0) == 0x0.000002p-126
|
|
|
|
; F32 NaN's
|
|
; Unlike with other operations fcopysign is guaranteed to only affect the sign bit
|
|
; run: %fcopysign_f32(0x0.0, -NaN) == -0x0.0
|
|
; run: %fcopysign_f32(0x3.0, +sNaN:0x1) == 0x3.0
|
|
; run: %fcopysign_f32(Inf, -NaN) == -Inf
|
|
; run: %fcopysign_f32(+NaN, -NaN) == -NaN
|
|
; run: %fcopysign_f32(-NaN, +NaN) == +NaN
|
|
; run: %fcopysign_f32(+NaN:0x0, -NaN) == -NaN:0x0
|
|
; run: %fcopysign_f32(+NaN:0x1, -NaN) == -NaN:0x1
|
|
; run: %fcopysign_f32(+NaN:0x300001, -NaN) == -NaN:0x300001
|
|
; run: %fcopysign_f32(-NaN:0x0, +NaN) == +NaN:0x0
|
|
; run: %fcopysign_f32(-NaN:0x1, +NaN) == +NaN:0x1
|
|
; run: %fcopysign_f32(-NaN:0x300001, +NaN) == +NaN:0x300001
|
|
; run: %fcopysign_f32(+sNaN:0x1, -NaN) == -sNaN:0x1
|
|
; run: %fcopysign_f32(-sNaN:0x1, +NaN) == +sNaN:0x1
|
|
; run: %fcopysign_f32(+sNaN:0x200001, -NaN) == -sNaN:0x200001
|
|
; run: %fcopysign_f32(-sNaN:0x200001, +NaN) == +sNaN:0x200001
|
|
|
|
|
|
|
|
function %fcopysign_f64(f64, f64) -> f64 {
|
|
block0(v0: f64, v1: f64):
|
|
v2 = fcopysign v0, v1
|
|
return v2
|
|
}
|
|
; run: %fcopysign_f64(0x9.0, 0x9.0) == 0x9.0
|
|
; run: %fcopysign_f64(-0x9.0, 0x9.0) == 0x9.0
|
|
; run: %fcopysign_f64(0x9.0, -0x9.0) == -0x9.0
|
|
; run: %fcopysign_f64(-0x9.0, -0x9.0) == -0x9.0
|
|
; run: %fcopysign_f64(0x0.0, -0x0.0) == -0x0.0
|
|
; run: %fcopysign_f64(-0x0.0, 0x0.0) == 0x0.0
|
|
|
|
; F64 Inf
|
|
; run: %fcopysign_f64(Inf, Inf) == Inf
|
|
; run: %fcopysign_f64(-Inf, Inf) == Inf
|
|
; run: %fcopysign_f64(Inf, -Inf) == -Inf
|
|
; run: %fcopysign_f64(-Inf, -Inf) == -Inf
|
|
|
|
; F64 Epsilon / Max / Min Positive
|
|
; run: %fcopysign_f64(0x1.0000000000000p-52, -0x0.0) == -0x1.0000000000000p-52
|
|
; run: %fcopysign_f64(-0x1.0000000000000p-52, 0x0.0) == 0x1.0000000000000p-52
|
|
; run: %fcopysign_f64(0x1.fffffffffffffp1023, -0x0.0) == -0x1.fffffffffffffp1023
|
|
; run: %fcopysign_f64(-0x1.fffffffffffffp1023, 0x0.0) == 0x1.fffffffffffffp1023
|
|
; run: %fcopysign_f64(0x1.0000000000000p-1022, -0x0.0) == -0x1.0000000000000p-1022
|
|
; run: %fcopysign_f64(-0x1.0000000000000p-1022, 0x0.0) == 0x1.0000000000000p-1022
|
|
|
|
; F64 Subnormals
|
|
; run: %fcopysign_f64(0x0.8000000000000p-1022, -0x0.0) == -0x0.8000000000000p-1022
|
|
; run: %fcopysign_f64(-0x0.8000000000000p-1022, 0x0.0) == 0x0.8000000000000p-1022
|
|
; run: %fcopysign_f64(0x0.0000000000001p-1022, -0x0.0) == -0x0.0000000000001p-1022
|
|
; run: %fcopysign_f64(-0x0.0000000000001p-1022, 0x0.0) == 0x0.0000000000001p-1022
|
|
|
|
; F64 NaN's
|
|
; Unlike with other operations fcopysign is guaranteed to only affect the sign bit
|
|
; run: %fcopysign_f64(0x0.0, -NaN) == -0x0.0
|
|
; run: %fcopysign_f64(0x3.0, +sNaN:0x1) == 0x3.0
|
|
; run: %fcopysign_f64(Inf, -NaN) == -Inf
|
|
; run: %fcopysign_f64(+NaN, -NaN) == -NaN
|
|
; run: %fcopysign_f64(-NaN, +NaN) == +NaN
|
|
; run: %fcopysign_f64(+NaN:0x0, -NaN) == -NaN:0x0
|
|
; run: %fcopysign_f64(+NaN:0x1, -NaN) == -NaN:0x1
|
|
; run: %fcopysign_f64(+NaN:0x4000000000001, -NaN) == -NaN:0x4000000000001
|
|
; run: %fcopysign_f64(-NaN:0x0, +NaN) == +NaN:0x0
|
|
; run: %fcopysign_f64(-NaN:0x1, +NaN) == +NaN:0x1
|
|
; run: %fcopysign_f64(-NaN:0x4000000000001, +NaN) == +NaN:0x4000000000001
|
|
; run: %fcopysign_f64(+sNaN:0x1, -NaN) == -sNaN:0x1
|
|
; run: %fcopysign_f64(-sNaN:0x1, +NaN) == +sNaN:0x1
|
|
; run: %fcopysign_f64(+sNaN:0x4000000000001, -NaN) == -sNaN:0x4000000000001
|
|
; run: %fcopysign_f64(-sNaN:0x4000000000001, +NaN) == +sNaN:0x4000000000001
|