...

Text file src/github.com/tetratelabs/wazero/internal/integration_test/spectest/v2/testdata/simd_f64x2_rounding.wast

Documentation: github.com/tetratelabs/wazero/internal/integration_test/spectest/v2/testdata

     1;; Tests for f64x2 [ceil, floor, trunc, nearest] operations on major boundary values and all special values.
     2
     3
     4(module
     5  (func (export "f64x2.ceil") (param v128) (result v128) (f64x2.ceil (local.get 0)))
     6  (func (export "f64x2.floor") (param v128) (result v128) (f64x2.floor (local.get 0)))
     7  (func (export "f64x2.trunc") (param v128) (result v128) (f64x2.trunc (local.get 0)))
     8  (func (export "f64x2.nearest") (param v128) (result v128) (f64x2.nearest (local.get 0)))
     9)
    10
    11(assert_return (invoke "f64x2.ceil" (v128.const f64x2 0x0p+0 0x0p+0))
    12                                    (v128.const f64x2 0x0.0p+0 0x0.0p+0))
    13(assert_return (invoke "f64x2.ceil" (v128.const f64x2 -0x0p+0 -0x0p+0))
    14                                    (v128.const f64x2 -0x0.0p+0 -0x0.0p+0))
    15(assert_return (invoke "f64x2.ceil" (v128.const f64x2 0x1p-1022 0x1p-1022))
    16                                    (v128.const f64x2 0x1.0000000000000p+0 0x1.0000000000000p+0))
    17(assert_return (invoke "f64x2.ceil" (v128.const f64x2 -0x1p-1022 -0x1p-1022))
    18                                    (v128.const f64x2 -0x0.0p+0 -0x0.0p+0))
    19(assert_return (invoke "f64x2.ceil" (v128.const f64x2 0x1p-1 0x1p-1))
    20                                    (v128.const f64x2 0x1.0000000000000p+0 0x1.0000000000000p+0))
    21(assert_return (invoke "f64x2.ceil" (v128.const f64x2 -0x1p-1 -0x1p-1))
    22                                    (v128.const f64x2 -0x0.0p+0 -0x0.0p+0))
    23(assert_return (invoke "f64x2.ceil" (v128.const f64x2 0x1p+0 0x1p+0))
    24                                    (v128.const f64x2 0x1.0000000000000p+0 0x1.0000000000000p+0))
    25(assert_return (invoke "f64x2.ceil" (v128.const f64x2 -0x1p+0 -0x1p+0))
    26                                    (v128.const f64x2 -0x1.0000000000000p+0 -0x1.0000000000000p+0))
    27(assert_return (invoke "f64x2.ceil" (v128.const f64x2 0x1.921fb54442d18p+2 0x1.921fb54442d18p+2))
    28                                    (v128.const f64x2 0x1.c000000000000p+2 0x1.c000000000000p+2))
    29(assert_return (invoke "f64x2.ceil" (v128.const f64x2 -0x1.921fb54442d18p+2 -0x1.921fb54442d18p+2))
    30                                    (v128.const f64x2 -0x1.8000000000000p+2 -0x1.8000000000000p+2))
    31(assert_return (invoke "f64x2.ceil" (v128.const f64x2 0x1.fffffffffffffp+1023 0x1.fffffffffffffp+1023))
    32                                    (v128.const f64x2 0x1.fffffffffffffp+1023 0x1.fffffffffffffp+1023))
    33(assert_return (invoke "f64x2.ceil" (v128.const f64x2 -0x1.fffffffffffffp+1023 -0x1.fffffffffffffp+1023))
    34                                    (v128.const f64x2 -0x1.fffffffffffffp+1023 -0x1.fffffffffffffp+1023))
    35(assert_return (invoke "f64x2.ceil" (v128.const f64x2 0x0.0000000000001p-1022 0x0.0000000000001p-1022))
    36                                    (v128.const f64x2 0x1.0000000000000p+0 0x1.0000000000000p+0))
    37(assert_return (invoke "f64x2.ceil" (v128.const f64x2 0x0.0000000000001p-1022 0x0.0000000000001p-1022))
    38                                    (v128.const f64x2 0x1.0000000000000p+0 0x1.0000000000000p+0))
    39(assert_return (invoke "f64x2.ceil" (v128.const f64x2 inf inf))
    40                                    (v128.const f64x2 inf inf))
    41(assert_return (invoke "f64x2.ceil" (v128.const f64x2 -inf -inf))
    42                                    (v128.const f64x2 -inf -inf))
    43(assert_return (invoke "f64x2.ceil" (v128.const f64x2 0123456789 0123456789))
    44                                    (v128.const f64x2 123456789.0 123456789.0))
    45(assert_return (invoke "f64x2.ceil" (v128.const f64x2 0123456789e019 0123456789e019))
    46                                    (v128.const f64x2 1.23456789e+27 1.23456789e+27))
    47(assert_return (invoke "f64x2.ceil" (v128.const f64x2 0123456789e+019 0123456789e+019))
    48                                    (v128.const f64x2 1.23456789e+27 1.23456789e+27))
    49(assert_return (invoke "f64x2.ceil" (v128.const f64x2 0123456789e-019 0123456789e-019))
    50                                    (v128.const f64x2 1.0 1.0))
    51(assert_return (invoke "f64x2.ceil" (v128.const f64x2 0123456789. 0123456789.))
    52                                    (v128.const f64x2 123456789.0 123456789.0))
    53(assert_return (invoke "f64x2.ceil" (v128.const f64x2 0123456789.e019 0123456789.e019))
    54                                    (v128.const f64x2 1.23456789e+27 1.23456789e+27))
    55(assert_return (invoke "f64x2.ceil" (v128.const f64x2 0123456789.e+019 0123456789.e+019))
    56                                    (v128.const f64x2 1.23456789e+27 1.23456789e+27))
    57(assert_return (invoke "f64x2.ceil" (v128.const f64x2 0123456789.e-019 0123456789.e-019))
    58                                    (v128.const f64x2 1.0 1.0))
    59(assert_return (invoke "f64x2.ceil" (v128.const f64x2 0123456789.0123456789 0123456789.0123456789))
    60                                    (v128.const f64x2 123456790.0 123456790.0))
    61(assert_return (invoke "f64x2.ceil" (v128.const f64x2 0123456789.0123456789e019 0123456789.0123456789e019))
    62                                    (v128.const f64x2 1.2345678901234569e+27 1.2345678901234569e+27))
    63(assert_return (invoke "f64x2.ceil" (v128.const f64x2 0123456789.0123456789e+019 0123456789.0123456789e+019))
    64                                    (v128.const f64x2 1.2345678901234569e+27 1.2345678901234569e+27))
    65(assert_return (invoke "f64x2.ceil" (v128.const f64x2 0123456789.0123456789e-019 0123456789.0123456789e-019))
    66                                    (v128.const f64x2 1.0 1.0))
    67(assert_return (invoke "f64x2.ceil" (v128.const f64x2 0x0123456789ABCDEFabcdef 0x0123456789ABCDEFabcdef))
    68                                    (v128.const f64x2 1.3754889325393114e+24 1.3754889325393114e+24))
    69(assert_return (invoke "f64x2.ceil" (v128.const f64x2 0x0123456789ABCDEFabcdefp019 0x0123456789ABCDEFabcdefp019))
    70                                    (v128.const f64x2 7.211523414631705e+29 7.211523414631705e+29))
    71(assert_return (invoke "f64x2.ceil" (v128.const f64x2 0x0123456789ABCDEFabcdefp+019 0x0123456789ABCDEFabcdefp+019))
    72                                    (v128.const f64x2 7.211523414631705e+29 7.211523414631705e+29))
    73(assert_return (invoke "f64x2.ceil" (v128.const f64x2 0x0123456789ABCDEFabcdefp-019 0x0123456789ABCDEFabcdefp-019))
    74                                    (v128.const f64x2 2.6235369349275807e+18 2.6235369349275807e+18))
    75(assert_return (invoke "f64x2.ceil" (v128.const f64x2 0x0123456789ABCDEFabcdef. 0x0123456789ABCDEFabcdef.))
    76                                    (v128.const f64x2 1.3754889325393114e+24 1.3754889325393114e+24))
    77(assert_return (invoke "f64x2.ceil" (v128.const f64x2 0x0123456789ABCDEFabcdef.p019 0x0123456789ABCDEFabcdef.p019))
    78                                    (v128.const f64x2 7.211523414631705e+29 7.211523414631705e+29))
    79(assert_return (invoke "f64x2.ceil" (v128.const f64x2 0x0123456789ABCDEFabcdef.p+019 0x0123456789ABCDEFabcdef.p+019))
    80                                    (v128.const f64x2 7.211523414631705e+29 7.211523414631705e+29))
    81(assert_return (invoke "f64x2.ceil" (v128.const f64x2 0x0123456789ABCDEFabcdef.p-019 0x0123456789ABCDEFabcdef.p-019))
    82                                    (v128.const f64x2 2.6235369349275807e+18 2.6235369349275807e+18))
    83(assert_return (invoke "f64x2.ceil" (v128.const f64x2 0x0123456789ABCDEFabcdef.0123456789ABCDEFabcdef 0x0123456789ABCDEFabcdef.0123456789ABCDEFabcdef))
    84                                    (v128.const f64x2 1.3754889325393114e+24 1.3754889325393114e+24))
    85(assert_return (invoke "f64x2.ceil" (v128.const f64x2 0x0123456789ABCDEFabcdef.0123456789ABCDEFabcdefp019 0x0123456789ABCDEFabcdef.0123456789ABCDEFabcdefp019))
    86                                    (v128.const f64x2 7.211523414631705e+29 7.211523414631705e+29))
    87(assert_return (invoke "f64x2.ceil" (v128.const f64x2 0x0123456789ABCDEFabcdef.0123456789ABCDEFabcdefp+019 0x0123456789ABCDEFabcdef.0123456789ABCDEFabcdefp+019))
    88                                    (v128.const f64x2 7.211523414631705e+29 7.211523414631705e+29))
    89(assert_return (invoke "f64x2.ceil" (v128.const f64x2 0x0123456789ABCDEFabcdef.0123456789ABCDEFabcdefp-019 0x0123456789ABCDEFabcdef.0123456789ABCDEFabcdefp-019))
    90                                    (v128.const f64x2 2.6235369349275807e+18 2.6235369349275807e+18))
    91(assert_return (invoke "f64x2.ceil" (v128.const f64x2 nan nan))
    92                                    (v128.const f64x2 nan:canonical nan:canonical))
    93(assert_return (invoke "f64x2.ceil" (v128.const f64x2 -nan -nan))
    94                                    (v128.const f64x2 nan:canonical nan:canonical))
    95(assert_return (invoke "f64x2.ceil" (v128.const f64x2 nan:0x4000000000000 nan:0x4000000000000))
    96                                    (v128.const f64x2 nan:arithmetic nan:arithmetic))
    97(assert_return (invoke "f64x2.ceil" (v128.const f64x2 -nan:0x4000000000000 -nan:0x4000000000000))
    98                                    (v128.const f64x2 nan:arithmetic nan:arithmetic))
    99(assert_return (invoke "f64x2.floor" (v128.const f64x2 0x0p+0 0x0p+0))
   100                                     (v128.const f64x2 0x0.0p+0 0x0.0p+0))
   101(assert_return (invoke "f64x2.floor" (v128.const f64x2 -0x0p+0 -0x0p+0))
   102                                     (v128.const f64x2 -0x0.0p+0 -0x0.0p+0))
   103(assert_return (invoke "f64x2.floor" (v128.const f64x2 0x1p-1022 0x1p-1022))
   104                                     (v128.const f64x2 0x0.0p+0 0x0.0p+0))
   105(assert_return (invoke "f64x2.floor" (v128.const f64x2 -0x1p-1022 -0x1p-1022))
   106                                     (v128.const f64x2 -0x1.0000000000000p+0 -0x1.0000000000000p+0))
   107(assert_return (invoke "f64x2.floor" (v128.const f64x2 0x1p-1 0x1p-1))
   108                                     (v128.const f64x2 0x0.0p+0 0x0.0p+0))
   109(assert_return (invoke "f64x2.floor" (v128.const f64x2 -0x1p-1 -0x1p-1))
   110                                     (v128.const f64x2 -0x1.0000000000000p+0 -0x1.0000000000000p+0))
   111(assert_return (invoke "f64x2.floor" (v128.const f64x2 0x1p+0 0x1p+0))
   112                                     (v128.const f64x2 0x1.0000000000000p+0 0x1.0000000000000p+0))
   113(assert_return (invoke "f64x2.floor" (v128.const f64x2 -0x1p+0 -0x1p+0))
   114                                     (v128.const f64x2 -0x1.0000000000000p+0 -0x1.0000000000000p+0))
   115(assert_return (invoke "f64x2.floor" (v128.const f64x2 0x1.921fb54442d18p+2 0x1.921fb54442d18p+2))
   116                                     (v128.const f64x2 0x1.8000000000000p+2 0x1.8000000000000p+2))
   117(assert_return (invoke "f64x2.floor" (v128.const f64x2 -0x1.921fb54442d18p+2 -0x1.921fb54442d18p+2))
   118                                     (v128.const f64x2 -0x1.c000000000000p+2 -0x1.c000000000000p+2))
   119(assert_return (invoke "f64x2.floor" (v128.const f64x2 0x1.fffffffffffffp+1023 0x1.fffffffffffffp+1023))
   120                                     (v128.const f64x2 0x1.fffffffffffffp+1023 0x1.fffffffffffffp+1023))
   121(assert_return (invoke "f64x2.floor" (v128.const f64x2 -0x1.fffffffffffffp+1023 -0x1.fffffffffffffp+1023))
   122                                     (v128.const f64x2 -0x1.fffffffffffffp+1023 -0x1.fffffffffffffp+1023))
   123(assert_return (invoke "f64x2.floor" (v128.const f64x2 0x0.0000000000001p-1022 0x0.0000000000001p-1022))
   124                                     (v128.const f64x2 0x0.0p+0 0x0.0p+0))
   125(assert_return (invoke "f64x2.floor" (v128.const f64x2 0x0.0000000000001p-1022 0x0.0000000000001p-1022))
   126                                     (v128.const f64x2 0x0.0p+0 0x0.0p+0))
   127(assert_return (invoke "f64x2.floor" (v128.const f64x2 inf inf))
   128                                     (v128.const f64x2 inf inf))
   129(assert_return (invoke "f64x2.floor" (v128.const f64x2 -inf -inf))
   130                                     (v128.const f64x2 -inf -inf))
   131(assert_return (invoke "f64x2.floor" (v128.const f64x2 0123456789 0123456789))
   132                                     (v128.const f64x2 123456789.0 123456789.0))
   133(assert_return (invoke "f64x2.floor" (v128.const f64x2 0123456789e019 0123456789e019))
   134                                     (v128.const f64x2 1.23456789e+27 1.23456789e+27))
   135(assert_return (invoke "f64x2.floor" (v128.const f64x2 0123456789e+019 0123456789e+019))
   136                                     (v128.const f64x2 1.23456789e+27 1.23456789e+27))
   137(assert_return (invoke "f64x2.floor" (v128.const f64x2 0123456789e-019 0123456789e-019))
   138                                     (v128.const f64x2 0.0 0.0))
   139(assert_return (invoke "f64x2.floor" (v128.const f64x2 0123456789. 0123456789.))
   140                                     (v128.const f64x2 123456789.0 123456789.0))
   141(assert_return (invoke "f64x2.floor" (v128.const f64x2 0123456789.e019 0123456789.e019))
   142                                     (v128.const f64x2 1.23456789e+27 1.23456789e+27))
   143(assert_return (invoke "f64x2.floor" (v128.const f64x2 0123456789.e+019 0123456789.e+019))
   144                                     (v128.const f64x2 1.23456789e+27 1.23456789e+27))
   145(assert_return (invoke "f64x2.floor" (v128.const f64x2 0123456789.e-019 0123456789.e-019))
   146                                     (v128.const f64x2 0.0 0.0))
   147(assert_return (invoke "f64x2.floor" (v128.const f64x2 0123456789.0123456789 0123456789.0123456789))
   148                                     (v128.const f64x2 123456789.0 123456789.0))
   149(assert_return (invoke "f64x2.floor" (v128.const f64x2 0123456789.0123456789e019 0123456789.0123456789e019))
   150                                     (v128.const f64x2 1.2345678901234569e+27 1.2345678901234569e+27))
   151(assert_return (invoke "f64x2.floor" (v128.const f64x2 0123456789.0123456789e+019 0123456789.0123456789e+019))
   152                                     (v128.const f64x2 1.2345678901234569e+27 1.2345678901234569e+27))
   153(assert_return (invoke "f64x2.floor" (v128.const f64x2 0123456789.0123456789e-019 0123456789.0123456789e-019))
   154                                     (v128.const f64x2 0.0 0.0))
   155(assert_return (invoke "f64x2.floor" (v128.const f64x2 0x0123456789ABCDEFabcdef 0x0123456789ABCDEFabcdef))
   156                                     (v128.const f64x2 1.3754889325393114e+24 1.3754889325393114e+24))
   157(assert_return (invoke "f64x2.floor" (v128.const f64x2 0x0123456789ABCDEFabcdefp019 0x0123456789ABCDEFabcdefp019))
   158                                     (v128.const f64x2 7.211523414631705e+29 7.211523414631705e+29))
   159(assert_return (invoke "f64x2.floor" (v128.const f64x2 0x0123456789ABCDEFabcdefp+019 0x0123456789ABCDEFabcdefp+019))
   160                                     (v128.const f64x2 7.211523414631705e+29 7.211523414631705e+29))
   161(assert_return (invoke "f64x2.floor" (v128.const f64x2 0x0123456789ABCDEFabcdefp-019 0x0123456789ABCDEFabcdefp-019))
   162                                     (v128.const f64x2 2.6235369349275807e+18 2.6235369349275807e+18))
   163(assert_return (invoke "f64x2.floor" (v128.const f64x2 0x0123456789ABCDEFabcdef. 0x0123456789ABCDEFabcdef.))
   164                                     (v128.const f64x2 1.3754889325393114e+24 1.3754889325393114e+24))
   165(assert_return (invoke "f64x2.floor" (v128.const f64x2 0x0123456789ABCDEFabcdef.p019 0x0123456789ABCDEFabcdef.p019))
   166                                     (v128.const f64x2 7.211523414631705e+29 7.211523414631705e+29))
   167(assert_return (invoke "f64x2.floor" (v128.const f64x2 0x0123456789ABCDEFabcdef.p+019 0x0123456789ABCDEFabcdef.p+019))
   168                                     (v128.const f64x2 7.211523414631705e+29 7.211523414631705e+29))
   169(assert_return (invoke "f64x2.floor" (v128.const f64x2 0x0123456789ABCDEFabcdef.p-019 0x0123456789ABCDEFabcdef.p-019))
   170                                     (v128.const f64x2 2.6235369349275807e+18 2.6235369349275807e+18))
   171(assert_return (invoke "f64x2.floor" (v128.const f64x2 0x0123456789ABCDEFabcdef.0123456789ABCDEFabcdef 0x0123456789ABCDEFabcdef.0123456789ABCDEFabcdef))
   172                                     (v128.const f64x2 1.3754889325393114e+24 1.3754889325393114e+24))
   173(assert_return (invoke "f64x2.floor" (v128.const f64x2 0x0123456789ABCDEFabcdef.0123456789ABCDEFabcdefp019 0x0123456789ABCDEFabcdef.0123456789ABCDEFabcdefp019))
   174                                     (v128.const f64x2 7.211523414631705e+29 7.211523414631705e+29))
   175(assert_return (invoke "f64x2.floor" (v128.const f64x2 0x0123456789ABCDEFabcdef.0123456789ABCDEFabcdefp+019 0x0123456789ABCDEFabcdef.0123456789ABCDEFabcdefp+019))
   176                                     (v128.const f64x2 7.211523414631705e+29 7.211523414631705e+29))
   177(assert_return (invoke "f64x2.floor" (v128.const f64x2 0x0123456789ABCDEFabcdef.0123456789ABCDEFabcdefp-019 0x0123456789ABCDEFabcdef.0123456789ABCDEFabcdefp-019))
   178                                     (v128.const f64x2 2.6235369349275807e+18 2.6235369349275807e+18))
   179(assert_return (invoke "f64x2.floor" (v128.const f64x2 nan nan))
   180                                     (v128.const f64x2 nan:canonical nan:canonical))
   181(assert_return (invoke "f64x2.floor" (v128.const f64x2 -nan -nan))
   182                                     (v128.const f64x2 nan:canonical nan:canonical))
   183(assert_return (invoke "f64x2.floor" (v128.const f64x2 nan:0x4000000000000 nan:0x4000000000000))
   184                                     (v128.const f64x2 nan:arithmetic nan:arithmetic))
   185(assert_return (invoke "f64x2.floor" (v128.const f64x2 -nan:0x4000000000000 -nan:0x4000000000000))
   186                                     (v128.const f64x2 nan:arithmetic nan:arithmetic))
   187(assert_return (invoke "f64x2.trunc" (v128.const f64x2 0x0p+0 0x0p+0))
   188                                     (v128.const f64x2 0x0.0p+0 0x0.0p+0))
   189(assert_return (invoke "f64x2.trunc" (v128.const f64x2 -0x0p+0 -0x0p+0))
   190                                     (v128.const f64x2 -0x0.0p+0 -0x0.0p+0))
   191(assert_return (invoke "f64x2.trunc" (v128.const f64x2 0x1p-1022 0x1p-1022))
   192                                     (v128.const f64x2 0x0.0p+0 0x0.0p+0))
   193(assert_return (invoke "f64x2.trunc" (v128.const f64x2 -0x1p-1022 -0x1p-1022))
   194                                     (v128.const f64x2 -0x0.0p+0 -0x0.0p+0))
   195(assert_return (invoke "f64x2.trunc" (v128.const f64x2 0x1p-1 0x1p-1))
   196                                     (v128.const f64x2 0x0.0p+0 0x0.0p+0))
   197(assert_return (invoke "f64x2.trunc" (v128.const f64x2 -0x1p-1 -0x1p-1))
   198                                     (v128.const f64x2 -0x0.0p+0 -0x0.0p+0))
   199(assert_return (invoke "f64x2.trunc" (v128.const f64x2 0x1p+0 0x1p+0))
   200                                     (v128.const f64x2 0x1.0000000000000p+0 0x1.0000000000000p+0))
   201(assert_return (invoke "f64x2.trunc" (v128.const f64x2 -0x1p+0 -0x1p+0))
   202                                     (v128.const f64x2 -0x1.0000000000000p+0 -0x1.0000000000000p+0))
   203(assert_return (invoke "f64x2.trunc" (v128.const f64x2 0x1.921fb54442d18p+2 0x1.921fb54442d18p+2))
   204                                     (v128.const f64x2 0x1.8000000000000p+2 0x1.8000000000000p+2))
   205(assert_return (invoke "f64x2.trunc" (v128.const f64x2 -0x1.921fb54442d18p+2 -0x1.921fb54442d18p+2))
   206                                     (v128.const f64x2 -0x1.8000000000000p+2 -0x1.8000000000000p+2))
   207(assert_return (invoke "f64x2.trunc" (v128.const f64x2 0x1.fffffffffffffp+1023 0x1.fffffffffffffp+1023))
   208                                     (v128.const f64x2 0x1.fffffffffffffp+1023 0x1.fffffffffffffp+1023))
   209(assert_return (invoke "f64x2.trunc" (v128.const f64x2 -0x1.fffffffffffffp+1023 -0x1.fffffffffffffp+1023))
   210                                     (v128.const f64x2 -0x1.fffffffffffffp+1023 -0x1.fffffffffffffp+1023))
   211(assert_return (invoke "f64x2.trunc" (v128.const f64x2 0x0.0000000000001p-1022 0x0.0000000000001p-1022))
   212                                     (v128.const f64x2 0x0.0p+0 0x0.0p+0))
   213(assert_return (invoke "f64x2.trunc" (v128.const f64x2 0x0.0000000000001p-1022 0x0.0000000000001p-1022))
   214                                     (v128.const f64x2 0x0.0p+0 0x0.0p+0))
   215(assert_return (invoke "f64x2.trunc" (v128.const f64x2 inf inf))
   216                                     (v128.const f64x2 inf inf))
   217(assert_return (invoke "f64x2.trunc" (v128.const f64x2 -inf -inf))
   218                                     (v128.const f64x2 -inf -inf))
   219(assert_return (invoke "f64x2.trunc" (v128.const f64x2 0123456789 0123456789))
   220                                     (v128.const f64x2 123456789.0 123456789.0))
   221(assert_return (invoke "f64x2.trunc" (v128.const f64x2 0123456789e019 0123456789e019))
   222                                     (v128.const f64x2 1.23456789e+27 1.23456789e+27))
   223(assert_return (invoke "f64x2.trunc" (v128.const f64x2 0123456789e+019 0123456789e+019))
   224                                     (v128.const f64x2 1.23456789e+27 1.23456789e+27))
   225(assert_return (invoke "f64x2.trunc" (v128.const f64x2 0123456789e-019 0123456789e-019))
   226                                     (v128.const f64x2 0.0 0.0))
   227(assert_return (invoke "f64x2.trunc" (v128.const f64x2 0123456789. 0123456789.))
   228                                     (v128.const f64x2 123456789.0 123456789.0))
   229(assert_return (invoke "f64x2.trunc" (v128.const f64x2 0123456789.e019 0123456789.e019))
   230                                     (v128.const f64x2 1.23456789e+27 1.23456789e+27))
   231(assert_return (invoke "f64x2.trunc" (v128.const f64x2 0123456789.e+019 0123456789.e+019))
   232                                     (v128.const f64x2 1.23456789e+27 1.23456789e+27))
   233(assert_return (invoke "f64x2.trunc" (v128.const f64x2 0123456789.e-019 0123456789.e-019))
   234                                     (v128.const f64x2 0.0 0.0))
   235(assert_return (invoke "f64x2.trunc" (v128.const f64x2 0123456789.0123456789 0123456789.0123456789))
   236                                     (v128.const f64x2 123456789.0 123456789.0))
   237(assert_return (invoke "f64x2.trunc" (v128.const f64x2 0123456789.0123456789e019 0123456789.0123456789e019))
   238                                     (v128.const f64x2 1.2345678901234569e+27 1.2345678901234569e+27))
   239(assert_return (invoke "f64x2.trunc" (v128.const f64x2 0123456789.0123456789e+019 0123456789.0123456789e+019))
   240                                     (v128.const f64x2 1.2345678901234569e+27 1.2345678901234569e+27))
   241(assert_return (invoke "f64x2.trunc" (v128.const f64x2 0123456789.0123456789e-019 0123456789.0123456789e-019))
   242                                     (v128.const f64x2 0.0 0.0))
   243(assert_return (invoke "f64x2.trunc" (v128.const f64x2 0x0123456789ABCDEFabcdef 0x0123456789ABCDEFabcdef))
   244                                     (v128.const f64x2 1.3754889325393114e+24 1.3754889325393114e+24))
   245(assert_return (invoke "f64x2.trunc" (v128.const f64x2 0x0123456789ABCDEFabcdefp019 0x0123456789ABCDEFabcdefp019))
   246                                     (v128.const f64x2 7.211523414631705e+29 7.211523414631705e+29))
   247(assert_return (invoke "f64x2.trunc" (v128.const f64x2 0x0123456789ABCDEFabcdefp+019 0x0123456789ABCDEFabcdefp+019))
   248                                     (v128.const f64x2 7.211523414631705e+29 7.211523414631705e+29))
   249(assert_return (invoke "f64x2.trunc" (v128.const f64x2 0x0123456789ABCDEFabcdefp-019 0x0123456789ABCDEFabcdefp-019))
   250                                     (v128.const f64x2 2.6235369349275807e+18 2.6235369349275807e+18))
   251(assert_return (invoke "f64x2.trunc" (v128.const f64x2 0x0123456789ABCDEFabcdef. 0x0123456789ABCDEFabcdef.))
   252                                     (v128.const f64x2 1.3754889325393114e+24 1.3754889325393114e+24))
   253(assert_return (invoke "f64x2.trunc" (v128.const f64x2 0x0123456789ABCDEFabcdef.p019 0x0123456789ABCDEFabcdef.p019))
   254                                     (v128.const f64x2 7.211523414631705e+29 7.211523414631705e+29))
   255(assert_return (invoke "f64x2.trunc" (v128.const f64x2 0x0123456789ABCDEFabcdef.p+019 0x0123456789ABCDEFabcdef.p+019))
   256                                     (v128.const f64x2 7.211523414631705e+29 7.211523414631705e+29))
   257(assert_return (invoke "f64x2.trunc" (v128.const f64x2 0x0123456789ABCDEFabcdef.p-019 0x0123456789ABCDEFabcdef.p-019))
   258                                     (v128.const f64x2 2.6235369349275807e+18 2.6235369349275807e+18))
   259(assert_return (invoke "f64x2.trunc" (v128.const f64x2 0x0123456789ABCDEFabcdef.0123456789ABCDEFabcdef 0x0123456789ABCDEFabcdef.0123456789ABCDEFabcdef))
   260                                     (v128.const f64x2 1.3754889325393114e+24 1.3754889325393114e+24))
   261(assert_return (invoke "f64x2.trunc" (v128.const f64x2 0x0123456789ABCDEFabcdef.0123456789ABCDEFabcdefp019 0x0123456789ABCDEFabcdef.0123456789ABCDEFabcdefp019))
   262                                     (v128.const f64x2 7.211523414631705e+29 7.211523414631705e+29))
   263(assert_return (invoke "f64x2.trunc" (v128.const f64x2 0x0123456789ABCDEFabcdef.0123456789ABCDEFabcdefp+019 0x0123456789ABCDEFabcdef.0123456789ABCDEFabcdefp+019))
   264                                     (v128.const f64x2 7.211523414631705e+29 7.211523414631705e+29))
   265(assert_return (invoke "f64x2.trunc" (v128.const f64x2 0x0123456789ABCDEFabcdef.0123456789ABCDEFabcdefp-019 0x0123456789ABCDEFabcdef.0123456789ABCDEFabcdefp-019))
   266                                     (v128.const f64x2 2.6235369349275807e+18 2.6235369349275807e+18))
   267(assert_return (invoke "f64x2.trunc" (v128.const f64x2 nan nan))
   268                                     (v128.const f64x2 nan:canonical nan:canonical))
   269(assert_return (invoke "f64x2.trunc" (v128.const f64x2 -nan -nan))
   270                                     (v128.const f64x2 nan:canonical nan:canonical))
   271(assert_return (invoke "f64x2.trunc" (v128.const f64x2 nan:0x4000000000000 nan:0x4000000000000))
   272                                     (v128.const f64x2 nan:arithmetic nan:arithmetic))
   273(assert_return (invoke "f64x2.trunc" (v128.const f64x2 -nan:0x4000000000000 -nan:0x4000000000000))
   274                                     (v128.const f64x2 nan:arithmetic nan:arithmetic))
   275(assert_return (invoke "f64x2.nearest" (v128.const f64x2 0x0p+0 0x0p+0))
   276                                       (v128.const f64x2 0x0.0p+0 0x0.0p+0))
   277(assert_return (invoke "f64x2.nearest" (v128.const f64x2 -0x0p+0 -0x0p+0))
   278                                       (v128.const f64x2 -0x0.0p+0 -0x0.0p+0))
   279(assert_return (invoke "f64x2.nearest" (v128.const f64x2 0x1p-1022 0x1p-1022))
   280                                       (v128.const f64x2 0x0.0p+0 0x0.0p+0))
   281(assert_return (invoke "f64x2.nearest" (v128.const f64x2 -0x1p-1022 -0x1p-1022))
   282                                       (v128.const f64x2 -0x0.0p+0 -0x0.0p+0))
   283(assert_return (invoke "f64x2.nearest" (v128.const f64x2 0x1p-1 0x1p-1))
   284                                       (v128.const f64x2 0x0.0p+0 0x0.0p+0))
   285(assert_return (invoke "f64x2.nearest" (v128.const f64x2 -0x1p-1 -0x1p-1))
   286                                       (v128.const f64x2 -0x0.0p+0 -0x0.0p+0))
   287(assert_return (invoke "f64x2.nearest" (v128.const f64x2 0x1p+0 0x1p+0))
   288                                       (v128.const f64x2 0x1.0000000000000p+0 0x1.0000000000000p+0))
   289(assert_return (invoke "f64x2.nearest" (v128.const f64x2 -0x1p+0 -0x1p+0))
   290                                       (v128.const f64x2 -0x1.0000000000000p+0 -0x1.0000000000000p+0))
   291(assert_return (invoke "f64x2.nearest" (v128.const f64x2 0x1.921fb54442d18p+2 0x1.921fb54442d18p+2))
   292                                       (v128.const f64x2 0x1.8000000000000p+2 0x1.8000000000000p+2))
   293(assert_return (invoke "f64x2.nearest" (v128.const f64x2 -0x1.921fb54442d18p+2 -0x1.921fb54442d18p+2))
   294                                       (v128.const f64x2 -0x1.8000000000000p+2 -0x1.8000000000000p+2))
   295(assert_return (invoke "f64x2.nearest" (v128.const f64x2 0x1.fffffffffffffp+1023 0x1.fffffffffffffp+1023))
   296                                       (v128.const f64x2 0x1.fffffffffffffp+1023 0x1.fffffffffffffp+1023))
   297(assert_return (invoke "f64x2.nearest" (v128.const f64x2 -0x1.fffffffffffffp+1023 -0x1.fffffffffffffp+1023))
   298                                       (v128.const f64x2 -0x1.fffffffffffffp+1023 -0x1.fffffffffffffp+1023))
   299(assert_return (invoke "f64x2.nearest" (v128.const f64x2 0x0.0000000000001p-1022 0x0.0000000000001p-1022))
   300                                       (v128.const f64x2 0x0.0p+0 0x0.0p+0))
   301(assert_return (invoke "f64x2.nearest" (v128.const f64x2 0x0.0000000000001p-1022 0x0.0000000000001p-1022))
   302                                       (v128.const f64x2 0x0.0p+0 0x0.0p+0))
   303(assert_return (invoke "f64x2.nearest" (v128.const f64x2 inf inf))
   304                                       (v128.const f64x2 inf inf))
   305(assert_return (invoke "f64x2.nearest" (v128.const f64x2 -inf -inf))
   306                                       (v128.const f64x2 -inf -inf))
   307(assert_return (invoke "f64x2.nearest" (v128.const f64x2 0123456789 0123456789))
   308                                       (v128.const f64x2 123456789.0 123456789.0))
   309(assert_return (invoke "f64x2.nearest" (v128.const f64x2 0123456789e019 0123456789e019))
   310                                       (v128.const f64x2 1.23456789e+27 1.23456789e+27))
   311(assert_return (invoke "f64x2.nearest" (v128.const f64x2 0123456789e+019 0123456789e+019))
   312                                       (v128.const f64x2 1.23456789e+27 1.23456789e+27))
   313(assert_return (invoke "f64x2.nearest" (v128.const f64x2 0123456789e-019 0123456789e-019))
   314                                       (v128.const f64x2 0.0 0.0))
   315(assert_return (invoke "f64x2.nearest" (v128.const f64x2 0123456789. 0123456789.))
   316                                       (v128.const f64x2 123456789.0 123456789.0))
   317(assert_return (invoke "f64x2.nearest" (v128.const f64x2 0123456789.e019 0123456789.e019))
   318                                       (v128.const f64x2 1.23456789e+27 1.23456789e+27))
   319(assert_return (invoke "f64x2.nearest" (v128.const f64x2 0123456789.e+019 0123456789.e+019))
   320                                       (v128.const f64x2 1.23456789e+27 1.23456789e+27))
   321(assert_return (invoke "f64x2.nearest" (v128.const f64x2 0123456789.e-019 0123456789.e-019))
   322                                       (v128.const f64x2 0.0 0.0))
   323(assert_return (invoke "f64x2.nearest" (v128.const f64x2 0123456789.0123456789 0123456789.0123456789))
   324                                       (v128.const f64x2 123456789.0 123456789.0))
   325(assert_return (invoke "f64x2.nearest" (v128.const f64x2 0123456789.0123456789e019 0123456789.0123456789e019))
   326                                       (v128.const f64x2 1.2345678901234569e+27 1.2345678901234569e+27))
   327(assert_return (invoke "f64x2.nearest" (v128.const f64x2 0123456789.0123456789e+019 0123456789.0123456789e+019))
   328                                       (v128.const f64x2 1.2345678901234569e+27 1.2345678901234569e+27))
   329(assert_return (invoke "f64x2.nearest" (v128.const f64x2 0123456789.0123456789e-019 0123456789.0123456789e-019))
   330                                       (v128.const f64x2 0.0 0.0))
   331(assert_return (invoke "f64x2.nearest" (v128.const f64x2 0x0123456789ABCDEFabcdef 0x0123456789ABCDEFabcdef))
   332                                       (v128.const f64x2 1.3754889325393114e+24 1.3754889325393114e+24))
   333(assert_return (invoke "f64x2.nearest" (v128.const f64x2 0x0123456789ABCDEFabcdefp019 0x0123456789ABCDEFabcdefp019))
   334                                       (v128.const f64x2 7.211523414631705e+29 7.211523414631705e+29))
   335(assert_return (invoke "f64x2.nearest" (v128.const f64x2 0x0123456789ABCDEFabcdefp+019 0x0123456789ABCDEFabcdefp+019))
   336                                       (v128.const f64x2 7.211523414631705e+29 7.211523414631705e+29))
   337(assert_return (invoke "f64x2.nearest" (v128.const f64x2 0x0123456789ABCDEFabcdefp-019 0x0123456789ABCDEFabcdefp-019))
   338                                       (v128.const f64x2 2.6235369349275807e+18 2.6235369349275807e+18))
   339(assert_return (invoke "f64x2.nearest" (v128.const f64x2 0x0123456789ABCDEFabcdef. 0x0123456789ABCDEFabcdef.))
   340                                       (v128.const f64x2 1.3754889325393114e+24 1.3754889325393114e+24))
   341(assert_return (invoke "f64x2.nearest" (v128.const f64x2 0x0123456789ABCDEFabcdef.p019 0x0123456789ABCDEFabcdef.p019))
   342                                       (v128.const f64x2 7.211523414631705e+29 7.211523414631705e+29))
   343(assert_return (invoke "f64x2.nearest" (v128.const f64x2 0x0123456789ABCDEFabcdef.p+019 0x0123456789ABCDEFabcdef.p+019))
   344                                       (v128.const f64x2 7.211523414631705e+29 7.211523414631705e+29))
   345(assert_return (invoke "f64x2.nearest" (v128.const f64x2 0x0123456789ABCDEFabcdef.p-019 0x0123456789ABCDEFabcdef.p-019))
   346                                       (v128.const f64x2 2.6235369349275807e+18 2.6235369349275807e+18))
   347(assert_return (invoke "f64x2.nearest" (v128.const f64x2 0x0123456789ABCDEFabcdef.0123456789ABCDEFabcdef 0x0123456789ABCDEFabcdef.0123456789ABCDEFabcdef))
   348                                       (v128.const f64x2 1.3754889325393114e+24 1.3754889325393114e+24))
   349(assert_return (invoke "f64x2.nearest" (v128.const f64x2 0x0123456789ABCDEFabcdef.0123456789ABCDEFabcdefp019 0x0123456789ABCDEFabcdef.0123456789ABCDEFabcdefp019))
   350                                       (v128.const f64x2 7.211523414631705e+29 7.211523414631705e+29))
   351(assert_return (invoke "f64x2.nearest" (v128.const f64x2 0x0123456789ABCDEFabcdef.0123456789ABCDEFabcdefp+019 0x0123456789ABCDEFabcdef.0123456789ABCDEFabcdefp+019))
   352                                       (v128.const f64x2 7.211523414631705e+29 7.211523414631705e+29))
   353(assert_return (invoke "f64x2.nearest" (v128.const f64x2 0x0123456789ABCDEFabcdef.0123456789ABCDEFabcdefp-019 0x0123456789ABCDEFabcdef.0123456789ABCDEFabcdefp-019))
   354                                       (v128.const f64x2 2.6235369349275807e+18 2.6235369349275807e+18))
   355(assert_return (invoke "f64x2.nearest" (v128.const f64x2 nan nan))
   356                                       (v128.const f64x2 nan:canonical nan:canonical))
   357(assert_return (invoke "f64x2.nearest" (v128.const f64x2 -nan -nan))
   358                                       (v128.const f64x2 nan:canonical nan:canonical))
   359(assert_return (invoke "f64x2.nearest" (v128.const f64x2 nan:0x4000000000000 nan:0x4000000000000))
   360                                       (v128.const f64x2 nan:arithmetic nan:arithmetic))
   361(assert_return (invoke "f64x2.nearest" (v128.const f64x2 -nan:0x4000000000000 -nan:0x4000000000000))
   362                                       (v128.const f64x2 nan:arithmetic nan:arithmetic))
   363
   364
   365;; Unknown operators
   366
   367(assert_malformed (module quote "(memory 1) (func (result v128) (i8x16.ceil (v128.const i32x4 0 0 0 0)))") "unknown operator")
   368(assert_malformed (module quote "(memory 1) (func (result v128) (i8x16.floor (v128.const i32x4 0 0 0 0)))") "unknown operator")
   369(assert_malformed (module quote "(memory 1) (func (result v128) (i8x16.trunc (v128.const i32x4 0 0 0 0)))") "unknown operator")
   370(assert_malformed (module quote "(memory 1) (func (result v128) (i8x16.nearest (v128.const i32x4 0 0 0 0)))") "unknown operator")
   371(assert_malformed (module quote "(memory 1) (func (result v128) (i16x8.ceil (v128.const i32x4 0 0 0 0)))") "unknown operator")
   372(assert_malformed (module quote "(memory 1) (func (result v128) (i16x8.floor (v128.const i32x4 0 0 0 0)))") "unknown operator")
   373(assert_malformed (module quote "(memory 1) (func (result v128) (i16x8.trunc (v128.const i32x4 0 0 0 0)))") "unknown operator")
   374(assert_malformed (module quote "(memory 1) (func (result v128) (i16x8.nearest (v128.const i32x4 0 0 0 0)))") "unknown operator")
   375(assert_malformed (module quote "(memory 1) (func (result v128) (i32x4.ceil (v128.const i32x4 0 0 0 0)))") "unknown operator")
   376(assert_malformed (module quote "(memory 1) (func (result v128) (i32x4.floor (v128.const i32x4 0 0 0 0)))") "unknown operator")
   377(assert_malformed (module quote "(memory 1) (func (result v128) (i32x4.trunc (v128.const i32x4 0 0 0 0)))") "unknown operator")
   378(assert_malformed (module quote "(memory 1) (func (result v128) (i32x4.nearest (v128.const i32x4 0 0 0 0)))") "unknown operator")
   379(assert_malformed (module quote "(memory 1) (func (result v128) (i64x2.ceil (v128.const i32x4 0 0 0 0)))") "unknown operator")
   380(assert_malformed (module quote "(memory 1) (func (result v128) (i64x2.floor (v128.const i32x4 0 0 0 0)))") "unknown operator")
   381(assert_malformed (module quote "(memory 1) (func (result v128) (i64x2.trunc (v128.const i32x4 0 0 0 0)))") "unknown operator")
   382(assert_malformed (module quote "(memory 1) (func (result v128) (i64x2.nearest (v128.const i32x4 0 0 0 0)))") "unknown operator")
   383
   384;; type check
   385(assert_invalid (module (func (result v128) (f64x2.ceil (i32.const 0)))) "type mismatch")
   386(assert_invalid (module (func (result v128) (f64x2.floor (i32.const 0)))) "type mismatch")
   387(assert_invalid (module (func (result v128) (f64x2.trunc (i32.const 0)))) "type mismatch")
   388(assert_invalid (module (func (result v128) (f64x2.nearest (i32.const 0)))) "type mismatch")
   389
   390;; Test operation with empty argument
   391
   392(assert_invalid
   393  (module
   394    (func $f64x2.ceil-arg-empty (result v128)
   395      (f64x2.ceil)
   396    )
   397  )
   398  "type mismatch"
   399)
   400(assert_invalid
   401  (module
   402    (func $f64x2.floor-arg-empty (result v128)
   403      (f64x2.floor)
   404    )
   405  )
   406  "type mismatch"
   407)
   408(assert_invalid
   409  (module
   410    (func $f64x2.trunc-arg-empty (result v128)
   411      (f64x2.trunc)
   412    )
   413  )
   414  "type mismatch"
   415)
   416(assert_invalid
   417  (module
   418    (func $f64x2.nearest-arg-empty (result v128)
   419      (f64x2.nearest)
   420    )
   421  )
   422  "type mismatch"
   423)
   424

View as plain text