summaryrefslogtreecommitdiff
path: root/test/interp
diff options
context:
space:
mode:
authorlizhengxing <unixhaha@gmail.com>2018-03-06 23:21:54 -0800
committerBen Smith <binjimin@gmail.com>2018-03-06 23:21:54 -0800
commit27cbf3e99338d877d9d460de392a559b3b6238b0 (patch)
tree2751248679c608e7afb3d64d7f3d8a81362b6321 /test/interp
parentb449997b18c4bf44aa9f954d4419b9ada4017d15 (diff)
downloadwabt-27cbf3e99338d877d9d460de392a559b3b6238b0.tar.gz
wabt-27cbf3e99338d877d9d460de392a559b3b6238b0.tar.bz2
wabt-27cbf3e99338d877d9d460de392a559b3b6238b0.zip
SIMD Integer to floating point conversion implementation. (#795)
Including: f32x4.convert_s/i32x4 f32x4.convert_u/i32x4 f64x2.convert_s/i64x2 f64x2.convert_u/i64x2
Diffstat (limited to 'test/interp')
-rw-r--r--test/interp/simd-unary.txt41
1 files changed, 41 insertions, 0 deletions
diff --git a/test/interp/simd-unary.txt b/test/interp/simd-unary.txt
index c268969d..7eb1354d 100644
--- a/test/interp/simd-unary.txt
+++ b/test/interp/simd-unary.txt
@@ -169,6 +169,43 @@
(func (export "f64x2_sqrt_1") (result v128)
v128.const i32 0x00000000 0x40100000 0x00000000 0x40220000
f64x2.sqrt)
+
+ ;; f32x4 convert_s/i32x4
+ ;; For Floating num:
+ ;; 1.0 = 0x3f800000 -1.0 = 0xbf800000 3.0 = 0x40400000
+ ;; test is: [ 1, -1, 0, 3]
+ ;; expect is: [ 1.0, -1.0, 0.0, 3.0]
+ (func (export "f32x4_convert_s/i32x4_0") (result v128)
+ v128.const i32 0x00000001 0xffffffff 0x00000000 0x00000003
+ f32x4.convert_s/i32x4)
+
+ ;; f32x4 convert_u/i32x4
+ ;; For Floating num:
+ ;; 1.0 = 0x3f800000 0.0 = 0x00000000 3.0 = 0x40400000
+ ;; 2.0 = 0x40000000
+ ;; test is: [ 1, 2, 0, 3]
+ ;; expect is: [ 1.0, 2.0, 0.0, 3.0]
+ (func (export "f32x4_convert_u/i32x4_0") (result v128)
+ v128.const i32 0x00000001 0x00000002 0x00000000 0x00000003
+ f32x4.convert_u/i32x4)
+
+ ;; f64x2 convert_s/i64x2
+ ;; For Double num:
+ ;; 1.0 = 0x3ff0000000000000 -3.0 = 0xc008000000000000
+ ;; test is: [ 1, -3]
+ ;; expect is: [ 1.0, -3.0]
+ (func (export "f64x2_convert_s/i64x2_0") (result v128)
+ v128.const i32 0x00000001 0x00000000 0xfffffffd 0xffffffff
+ f64x2.convert_s/i64x2)
+
+ ;; f64x2 convert_u/i64x2
+ ;; For Double num:
+ ;; 1.0 = 0x3ff0000000000000 3.0 = 0x4008000000000000
+ ;; test is: [ 1, 3]
+ ;; expect is: [ 1.0, 3.0]
+ (func (export "f64x2_convert_u/i64x2_0") (result v128)
+ v128.const i32 0x00000001 0x00000000 0x00000003 0x00000000
+ f64x2.convert_u/i64x2)
)
(;; STDOUT ;;;
i8x16_neg_0() => v128:0x000000ff 0x000000fe 0x000000fd 0x000000fc
@@ -201,4 +238,8 @@ f64x2_abs_1() => v128:0x00000000 0x40934a00 0x00000000 0x3ff00000
f32x4_sqrt_0() => v128:0xffc00000 0xffc00000 0x40000000 0x40400000
f64x2_sqrt_0() => v128:0x00000000 0xfff80000 0x00000000 0xfff80000
f64x2_sqrt_1() => v128:0x00000000 0x40000000 0x00000000 0x40080000
+f32x4_convert_s/i32x4_0() => v128:0x3f800000 0xbf800000 0x00000000 0x40400000
+f32x4_convert_u/i32x4_0() => v128:0x3f800000 0x40000000 0x00000000 0x40400000
+f64x2_convert_s/i64x2_0() => v128:0x00000000 0x3ff00000 0x00000000 0xc0080000
+f64x2_convert_u/i64x2_0() => v128:0x00000000 0x3ff00000 0x00000000 0x40080000
;;; STDOUT ;;)