summaryrefslogtreecommitdiff
path: root/test/interp
diff options
context:
space:
mode:
authorlizhengxing <unixhaha@gmail.com>2018-03-02 11:28:07 -0800
committerBen Smith <binjimin@gmail.com>2018-03-02 11:28:07 -0800
commit2c591c592b5e1480e4d69093dd051348c1ec5f0e (patch)
treec36a697d7abd75ff1b9785a69c2b318d4cbe95e2 /test/interp
parent5978d7bfddb5b7c52906005f9a4a092e9a3a1ad1 (diff)
downloadwabt-2c591c592b5e1480e4d69093dd051348c1ec5f0e.tar.gz
wabt-2c591c592b5e1480e4d69093dd051348c1ec5f0e.tar.bz2
wabt-2c591c592b5e1480e4d69093dd051348c1ec5f0e.zip
SIMD Floating-point min and max implementation. (#784)
Including: f32x4.min, f64x2.min, f32x4.max, f64x2.max
Diffstat (limited to 'test/interp')
-rw-r--r--test/interp/simd-binary.txt60
1 files changed, 60 insertions, 0 deletions
diff --git a/test/interp/simd-binary.txt b/test/interp/simd-binary.txt
index fb8ccf7b..eea33ccd 100644
--- a/test/interp/simd-binary.txt
+++ b/test/interp/simd-binary.txt
@@ -168,6 +168,62 @@
v128.const i32 0x00ff0001 0x00040002 0x44000003 0x00000004
v128.const i32 0x00020001 0x00fe0002 0x00000003 0x55000004
v128.xor)
+
+ ;; f32x4 min
+ ;; For Floating num:
+ ;; +0.0 = 0x00000000, -0.0 = 0x80000000
+ ;; 0xffc00000 is a NaN, 0x7fc00000 is a NaN.
+ ;; 1234.5 = 0x449a5000, 1.0 = 0x3f800000
+ ;; -1234.5 = 0xc49a5000, -1.0 = 0xbf800000
+ ;; test is: [-0.0, NaN, 1234.5, -1.0]
+ ;; [ 0.0, 1.0, 1234.5, 1.0]
+ ;; expect is: [-0.0, NaN, 1234.5, -1.0]
+ (func (export "f32x4_min_0") (result v128)
+ v128.const i32 0x80000000 0xffc00000 0x449a5000 0xbf800000
+ v128.const i32 0x00000000 0x3f800000 0x449a5000 0x3f800000
+ f32x4.min)
+
+ ;; f64x2 min
+ ;; For Double num:
+ ;; +0.0 = 0x0000000000000000, -0.0 = 0x8000000000000000
+ ;; 0xfff8000000000000 is a NaN, 0x7ff8000000000000 is a NaN.
+ ;; 1234.5 = 0x40934a0000000000, 1.0 = 0x3ff0000000000000
+ ;; -1234.5 = 0xc0934a0000000000, -1.0 = 0xbff0000000000000
+ ;; tests are: [ 0.0, NaN]
+ ;; [-1234.5, 1.0]
+ ;; expects are: [-1234.5, NaN]
+ (func (export "f64x2_min_0") (result v128)
+ v128.const i32 0x00000000 0x00000000 0x00000000 0xfff80000
+ v128.const i32 0x00000000 0xc0934a00 0x00000000 0x3ff00000
+ f64x2.min)
+
+ ;; f32x4 max
+ ;; For Floating num:
+ ;; +0.0 = 0x00000000, -0.0 = 0x80000000
+ ;; 0xffc00000 is a NaN, 0x7fc00000 is a NaN.
+ ;; 1234.5 = 0x449a5000, 1.0 = 0x3f800000
+ ;; -1234.5 = 0xc49a5000, -1.0 = 0xbf800000
+ ;; test is: [-0.0, NaN, 1234.5, -1.0]
+ ;; [ 0.0, 1.0, 1234.5, 1.0]
+ ;; expect is: [ 0.0, NaN, 1234.5, 1.0]
+ (func (export "f32x4_max_0") (result v128)
+ v128.const i32 0x80000000 0xffc00000 0x449a5000 0xbf800000
+ v128.const i32 0x00000000 0x3f800000 0x449a5000 0x3f800000
+ f32x4.max)
+
+ ;; f64x2 max
+ ;; For Double num:
+ ;; +0.0 = 0x0000000000000000, -0.0 = 0x8000000000000000
+ ;; 0xfff8000000000000 is a NaN, 0x7ff8000000000000 is a NaN.
+ ;; 1234.5 = 0x40934a0000000000, 1.0 = 0x3ff0000000000000
+ ;; -1234.5 = 0xc0934a0000000000, -1.0 = 0xbff0000000000000
+ ;; tests are: [ 0.0, NaN]
+ ;; [-1234.5, 1.0]
+ ;; expects are: [ 0.0, NaN]
+ (func (export "f64x2_max_0") (result v128)
+ v128.const i32 0x00000000 0x00000000 0x00000000 0xfff80000
+ v128.const i32 0x00000000 0xc0934a00 0x00000000 0x3ff00000
+ f64x2.max)
)
(;; STDOUT ;;;
@@ -204,4 +260,8 @@ i16x8_sub_saturate_unsigned_0() => v128:0x00fdfffe 0x0000fffd 0x00000000 0x00000
v128_and_0() => v128:0x00020001 0x00040002 0x00000003 0x00000004
v128_or_0() => v128:0x00ff0001 0x00fe0002 0x44000003 0x55000004
v128_xor_0() => v128:0x00fd0000 0x00fa0000 0x44000000 0x55000000
+f32x4_min_0() => v128:0x80000000 0xffc00000 0x449a5000 0xbf800000
+f64x2_min_0() => v128:0x00000000 0xc0934a00 0x00000000 0xfff80000
+f32x4_max_0() => v128:0x00000000 0xffc00000 0x449a5000 0x3f800000
+f64x2_max_0() => v128:0x00000000 0x00000000 0x00000000 0xfff80000
;;; STDOUT ;;)