summaryrefslogtreecommitdiff
path: root/test/spec
diff options
context:
space:
mode:
Diffstat (limited to 'test/spec')
-rw-r--r--test/spec/f16.wast56
1 files changed, 56 insertions, 0 deletions
diff --git a/test/spec/f16.wast b/test/spec/f16.wast
index ef32b2ab5..360464e15 100644
--- a/test/spec/f16.wast
+++ b/test/spec/f16.wast
@@ -11,6 +11,12 @@
(func (export "f16x8.extract_lane_last") (param $0 v128) (result f32) (f16x8.extract_lane 7 (local.get $0)))
(func (export "f16x8.replace_lane_first") (param $0 v128) (param $1 f32) (result v128) (f16x8.replace_lane 0 (local.get $0) (local.get $1)))
(func (export "f16x8.replace_lane_last") (param $0 v128) (param $1 f32) (result v128) (f16x8.replace_lane 7 (local.get $0) (local.get $1)))
+ (func (export "f16x8.eq") (param $0 v128) (param $1 v128) (result v128) (f16x8.eq (local.get $0) (local.get $1)))
+ (func (export "f16x8.ne") (param $0 v128) (param $1 v128) (result v128) (f16x8.ne (local.get $0) (local.get $1)))
+ (func (export "f16x8.lt") (param $0 v128) (param $1 v128) (result v128) (f16x8.lt (local.get $0) (local.get $1)))
+ (func (export "f16x8.gt") (param $0 v128) (param $1 v128) (result v128) (f16x8.gt (local.get $0) (local.get $1)))
+ (func (export "f16x8.le") (param $0 v128) (param $1 v128) (result v128) (f16x8.le (local.get $0) (local.get $1)))
+ (func (export "f16x8.ge") (param $0 v128) (param $1 v128) (result v128) (f16x8.ge (local.get $0) (local.get $1)))
)
(assert_return (invoke "f32.load_f16") (f32.const 42.0))
@@ -25,3 +31,53 @@
(assert_return (invoke "f16x8.extract_lane_last" (v128.const i16x8 0 0 0 0 0 0 0 0xc500)) (f32.const -5))
(assert_return (invoke "f16x8.replace_lane_first" (v128.const i64x2 0 0) (f32.const 100.5)) (v128.const i16x8 0x5648 0 0 0 0 0 0 0))
(assert_return (invoke "f16x8.replace_lane_last" (v128.const i64x2 0 0) (f32.const 100.5)) (v128.const i16x8 0 0 0 0 0 0 0 0x5648))
+
+;; comparisons
+(assert_return (invoke "f16x8.eq"
+ ;; 0 -1 1 nan inf nan inf nan
+ ;; 0 0 -1 nan inf 0 -inf inf
+ (v128.const i16x8 0 0xbc00 0x3c00 0x7e00 0x7c00 0x7e00 0x7c00 0x7e00)
+ (v128.const i16x8 0 0 0xbc00 0x7e00 0x7c00 0 0xfc00 0x7c00)
+ )
+ (v128.const i16x8 -1 0 0 0 -1 0 0 0)
+)
+(assert_return (invoke "f16x8.ne"
+ ;; 0 -1 1 nan inf nan inf nan
+ ;; 0 0 -1 nan inf 0 -inf inf
+ (v128.const i16x8 0 0xbc00 0x3c00 0x7e00 0x7c00 0x7e00 0x7c00 0x7e00)
+ (v128.const i16x8 0 0 0xbc00 0x7e00 0x7c00 0 0xfc00 0x7c00)
+ )
+ (v128.const i16x8 0 -1 -1 -1 0 -1 -1 -1)
+)
+(assert_return (invoke "f16x8.lt"
+ ;; 0 -1 1 nan inf nan inf nan
+ ;; 0 0 -1 nan inf 0 -inf inf
+ (v128.const i16x8 0 0xbc00 0x3c00 0x7e00 0x7c00 0x7e00 0x7c00 0x7e00)
+ (v128.const i16x8 0 0 0xbc00 0x7e00 0x7c00 0 0xfc00 0x7c00)
+ )
+ (v128.const i16x8 0 -1 0 0 0 0 0 0)
+)
+(assert_return (invoke "f16x8.gt"
+ ;; 0 -1 1 nan inf nan inf nan
+ ;; 0 0 -1 nan inf 0 -inf inf
+ (v128.const i16x8 0 0xbc00 0x3c00 0x7e00 0x7c00 0x7e00 0x7c00 0x7e00)
+ (v128.const i16x8 0 0 0xbc00 0x7e00 0x7c00 0 0xfc00 0x7c00)
+ )
+ (v128.const i16x8 0 0 -1 0 0 0 -1 0)
+)
+(assert_return (invoke "f16x8.le"
+ ;; 0 -1 1 nan inf nan inf nan
+ ;; 0 0 -1 nan inf 0 -inf inf
+ (v128.const i16x8 0 0xbc00 0x3c00 0x7e00 0x7c00 0x7e00 0x7c00 0x7e00)
+ (v128.const i16x8 0 0 0xbc00 0x7e00 0x7c00 0 0xfc00 0x7c00)
+ )
+ (v128.const i16x8 -1 -1 0 0 -1 0 0 0)
+)
+(assert_return (invoke "f16x8.ge"
+ ;; 0 -1 1 nan inf nan inf nan
+ ;; 0 0 -1 nan inf 0 -inf inf
+ (v128.const i16x8 0 0xbc00 0x3c00 0x7e00 0x7c00 0x7e00 0x7c00 0x7e00)
+ (v128.const i16x8 0 0 0xbc00 0x7e00 0x7c00 0 0xfc00 0x7c00)
+ )
+ (v128.const i16x8 -1 0 -1 0 -1 0 -1 0)
+)