summaryrefslogtreecommitdiff
path: root/test/interp/simd-unary.txt
diff options
context:
space:
mode:
Diffstat (limited to 'test/interp/simd-unary.txt')
-rw-r--r--test/interp/simd-unary.txt31
1 files changed, 31 insertions, 0 deletions
diff --git a/test/interp/simd-unary.txt b/test/interp/simd-unary.txt
index 4fde157e..decbe8b9 100644
--- a/test/interp/simd-unary.txt
+++ b/test/interp/simd-unary.txt
@@ -116,6 +116,34 @@
(func (export "f64x2_neg_1") (result v128)
v128.const i32 0x00000000 0xc0934a00 0x00000000 0x3ff00000
f64x2.neg)
+
+ ;; f32x4 abs
+ ;; 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]
+ ;; expect is: [ 0.0, NaN, 1234.5, 1.0]
+ (func (export "f32x4_abs_0") (result v128)
+ v128.const i32 0x80000000 0xffc00000 0x449a5000 0xbf800000
+ f32x4.abs)
+
+ ;; f64x2 abs
+ ;; 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], [ 1234.5, 1.0]
+ (func (export "f64x2_abs_0") (result v128)
+ v128.const i32 0x00000000 0x80000000 0x00000000 0xfff80000
+ f64x2.abs)
+ (func (export "f64x2_abs_1") (result v128)
+ v128.const i32 0x00000000 0xc0934a00 0x00000000 0x3ff00000
+ f64x2.abs)
+
)
(;; STDOUT ;;;
i8x16_neg_0() => v128:0x000000ff 0x000000fe 0x000000fd 0x000000fc
@@ -142,4 +170,7 @@ i64x2_all_true_1() => i32:0
f32x4_neg_0() => v128:0x00000000 0x7fc00000 0xc49a5000 0x3f800000
f64x2_neg_0() => v128:0x00000000 0x80000000 0x00000000 0x7ff80000
f64x2_neg_1() => v128:0x00000000 0x40934a00 0x00000000 0xbff00000
+f32x4_abs_0() => v128:0x00000000 0x7fc00000 0x449a5000 0x3f800000
+f64x2_abs_0() => v128:0x00000000 0x00000000 0x00000000 0x7ff80000
+f64x2_abs_1() => v128:0x00000000 0x40934a00 0x00000000 0x3ff00000
;;; STDOUT ;;)