From b79e59882d8eb682602a332a7322b6314220ec1c Mon Sep 17 00:00:00 2001 From: bjorn3 Date: Fri, 27 Aug 2021 18:28:33 +0200 Subject: [PATCH] Fix tests --- .../runtests/fmin-max-pseudo-vector.clif | 36 +++++++++++++++++++ .../filetests/runtests/fmin-max-pseudo.clif | 33 +---------------- 2 files changed, 37 insertions(+), 32 deletions(-) create mode 100644 cranelift/filetests/filetests/runtests/fmin-max-pseudo-vector.clif diff --git a/cranelift/filetests/filetests/runtests/fmin-max-pseudo-vector.clif b/cranelift/filetests/filetests/runtests/fmin-max-pseudo-vector.clif new file mode 100644 index 0000000000..5bd7b07ada --- /dev/null +++ b/cranelift/filetests/filetests/runtests/fmin-max-pseudo-vector.clif @@ -0,0 +1,36 @@ +test run +; target s390x TODO: Not yet implemented on s390x +set enable_simd +target aarch64 +target x86_64 machinst skylake + +function %fmin_pseudo_f32x4(f32x4, f32x4) -> f32x4 { +block0(v0:f32x4, v1:f32x4): + v2 = fmin_pseudo v0, v1 + return v2 +} +; run: %fmin_pseudo_f32x4([0x1.0 NaN 0x0.1 -0x0.0], [0x2.0 0x2.0 NaN 0x0.0]) == [0x1.0 NaN 0x0.1 -0x0.0] + +function %fmax_pseudo_f32x4(f32x4, f32x4) -> f32x4 { +block0(v0:f32x4, v1:f32x4): + v2 = fmax_pseudo v0, v1 + return v2 +} +; run: %fmax_pseudo_f32x4([0x1.0 NaN 0x0.1 -0x0.0], [0x2.0 0x2.0 NaN 0x0.0]) == [0x2.0 NaN 0x0.1 -0x0.0] + +function %fmin_pseudo_f64x2(f64x2, f64x2) -> f64x2 { +block0(v0:f64x2, v1:f64x2): + v2 = fmin_pseudo v0, v1 + return v2 +} +; run: %fmin_pseudo_f64x2([0x1.0 NaN], [0x2.0 0x2.0]) == [0x1.0 NaN] +; run: %fmin_pseudo_f64x2([0x0.1 -0x0.0], [NaN 0x0.0]) == [0x0.1 -0x0.0] + +function %fmax_pseudo_f64x2(f64x2, f64x2) -> f64x2 { +block0(v0:f64x2, v1:f64x2): + v2 = fmax_pseudo v0, v1 + return v2 +} +; run: %fmax_pseudo_f64x2([0x1.0 NaN], [0x2.0 0x2.0]) == [0x2.0 NaN] +; run: %fmax_pseudo_f64x2([0x0.1 -0x0.0], [NaN 0x0.0]) == [0x0.1 -0x0.0] + diff --git a/cranelift/filetests/filetests/runtests/fmin-max-pseudo.clif b/cranelift/filetests/filetests/runtests/fmin-max-pseudo.clif index 15a716298e..a1273f9063 100644 --- a/cranelift/filetests/filetests/runtests/fmin-max-pseudo.clif +++ b/cranelift/filetests/filetests/runtests/fmin-max-pseudo.clif @@ -1,5 +1,6 @@ test run ; target s390x TODO: Not yet implemented on s390x +; target aarch64 TODO: Not yet implemented on aarch64 set enable_simd target x86_64 machinst skylake @@ -47,35 +48,3 @@ block0(v0:f64, v1:f64): ; run: %fmax_pseudo_f64(0x0.0, 0x0.0) == 0x0.0 ; run: %fmax_pseudo_f64(-0x0.0, 0x0.0) == -0x0.0 -target aarch64 ; TODO scalar fmin_pseudo and fmax_pseudo are unimplemented for AArch64 - -function %fmin_pseudo_f32x4(f32x4, f32x4) -> f32x4 { -block0(v0:f32x4, v1:f32x4): - v2 = fmin_pseudo v0, v1 - return v2 -} -; run: %fmin_pseudo_f32x4([0x1.0 NaN 0x0.1 -0x0.0], [0x2.0 0x2.0 NaN 0x0.0]) == [0x1.0 NaN 0x0.1 -0x0.0] - -function %fmax_pseudo_f32x4(f32x4, f32x4) -> f32x4 { -block0(v0:f32x4, v1:f32x4): - v2 = fmax_pseudo v0, v1 - return v2 -} -; run: %fmax_pseudo_f32x4([0x1.0 NaN 0x0.1 -0x0.0], [0x2.0 0x2.0 NaN 0x0.0]) == [0x2.0 NaN 0x0.1 -0x0.0] - -function %fmin_pseudo_f64x2(f64x2, f64x2) -> f64x2 { -block0(v0:f64x2, v1:f64x2): - v2 = fmin_pseudo v0, v1 - return v2 -} -; run: %fmin_pseudo_f64x2([0x1.0 NaN], [0x2.0 0x2.0]) == [0x1.0 NaN] -; run: %fmin_pseudo_f64x2([0x0.1 -0x0.0], [NaN 0x0.0]) == [0x0.1 -0x0.0] - -function %fmax_pseudo_f64x2(f64x2, f64x2) -> f64x2 { -block0(v0:f64x2, v1:f64x2): - v2 = fmax_pseudo v0, v1 - return v2 -} -; run: %fmax_pseudo_f64x2([0x1.0 NaN], [0x2.0 0x2.0]) == [0x2.0 NaN] -; run: %fmax_pseudo_f64x2([0x0.1 -0x0.0], [NaN 0x0.0]) == [0x0.1 -0x0.0] -