github.com/wasilibs/wazerox@v0.0.0-20240124024944-4923be63ab5f/internal/integration_test/spectest/v1/testdata/conversions.wast (about)

     1  (module
     2    (func (export "i64.extend_i32_s") (param $x i32) (result i64) (i64.extend_i32_s (local.get $x)))
     3    (func (export "i64.extend_i32_u") (param $x i32) (result i64) (i64.extend_i32_u (local.get $x)))
     4    (func (export "i32.wrap_i64") (param $x i64) (result i32) (i32.wrap_i64 (local.get $x)))
     5    (func (export "i32.trunc_f32_s") (param $x f32) (result i32) (i32.trunc_f32_s (local.get $x)))
     6    (func (export "i32.trunc_f32_u") (param $x f32) (result i32) (i32.trunc_f32_u (local.get $x)))
     7    (func (export "i32.trunc_f64_s") (param $x f64) (result i32) (i32.trunc_f64_s (local.get $x)))
     8    (func (export "i32.trunc_f64_u") (param $x f64) (result i32) (i32.trunc_f64_u (local.get $x)))
     9    (func (export "i64.trunc_f32_s") (param $x f32) (result i64) (i64.trunc_f32_s (local.get $x)))
    10    (func (export "i64.trunc_f32_u") (param $x f32) (result i64) (i64.trunc_f32_u (local.get $x)))
    11    (func (export "i64.trunc_f64_s") (param $x f64) (result i64) (i64.trunc_f64_s (local.get $x)))
    12    (func (export "i64.trunc_f64_u") (param $x f64) (result i64) (i64.trunc_f64_u (local.get $x)))
    13    (func (export "f32.convert_i32_s") (param $x i32) (result f32) (f32.convert_i32_s (local.get $x)))
    14    (func (export "f32.convert_i64_s") (param $x i64) (result f32) (f32.convert_i64_s (local.get $x)))
    15    (func (export "f64.convert_i32_s") (param $x i32) (result f64) (f64.convert_i32_s (local.get $x)))
    16    (func (export "f64.convert_i64_s") (param $x i64) (result f64) (f64.convert_i64_s (local.get $x)))
    17    (func (export "f32.convert_i32_u") (param $x i32) (result f32) (f32.convert_i32_u (local.get $x)))
    18    (func (export "f32.convert_i64_u") (param $x i64) (result f32) (f32.convert_i64_u (local.get $x)))
    19    (func (export "f64.convert_i32_u") (param $x i32) (result f64) (f64.convert_i32_u (local.get $x)))
    20    (func (export "f64.convert_i64_u") (param $x i64) (result f64) (f64.convert_i64_u (local.get $x)))
    21    (func (export "f64.promote_f32") (param $x f32) (result f64) (f64.promote_f32 (local.get $x)))
    22    (func (export "f32.demote_f64") (param $x f64) (result f32) (f32.demote_f64 (local.get $x)))
    23    (func (export "f32.reinterpret_i32") (param $x i32) (result f32) (f32.reinterpret_i32 (local.get $x)))
    24    (func (export "f64.reinterpret_i64") (param $x i64) (result f64) (f64.reinterpret_i64 (local.get $x)))
    25    (func (export "i32.reinterpret_f32") (param $x f32) (result i32) (i32.reinterpret_f32 (local.get $x)))
    26    (func (export "i64.reinterpret_f64") (param $x f64) (result i64) (i64.reinterpret_f64 (local.get $x)))
    27  )
    28  
    29  (assert_return (invoke "i64.extend_i32_s" (i32.const 0)) (i64.const 0))
    30  (assert_return (invoke "i64.extend_i32_s" (i32.const 10000)) (i64.const 10000))
    31  (assert_return (invoke "i64.extend_i32_s" (i32.const -10000)) (i64.const -10000))
    32  (assert_return (invoke "i64.extend_i32_s" (i32.const -1)) (i64.const -1))
    33  (assert_return (invoke "i64.extend_i32_s" (i32.const 0x7fffffff)) (i64.const 0x000000007fffffff))
    34  (assert_return (invoke "i64.extend_i32_s" (i32.const 0x80000000)) (i64.const 0xffffffff80000000))
    35  
    36  (assert_return (invoke "i64.extend_i32_u" (i32.const 0)) (i64.const 0))
    37  (assert_return (invoke "i64.extend_i32_u" (i32.const 10000)) (i64.const 10000))
    38  (assert_return (invoke "i64.extend_i32_u" (i32.const -10000)) (i64.const 0x00000000ffffd8f0))
    39  (assert_return (invoke "i64.extend_i32_u" (i32.const -1)) (i64.const 0xffffffff))
    40  (assert_return (invoke "i64.extend_i32_u" (i32.const 0x7fffffff)) (i64.const 0x000000007fffffff))
    41  (assert_return (invoke "i64.extend_i32_u" (i32.const 0x80000000)) (i64.const 0x0000000080000000))
    42  
    43  (assert_return (invoke "i32.wrap_i64" (i64.const -1)) (i32.const -1))
    44  (assert_return (invoke "i32.wrap_i64" (i64.const -100000)) (i32.const -100000))
    45  (assert_return (invoke "i32.wrap_i64" (i64.const 0x80000000)) (i32.const 0x80000000))
    46  (assert_return (invoke "i32.wrap_i64" (i64.const 0xffffffff7fffffff)) (i32.const 0x7fffffff))
    47  (assert_return (invoke "i32.wrap_i64" (i64.const 0xffffffff00000000)) (i32.const 0x00000000))
    48  (assert_return (invoke "i32.wrap_i64" (i64.const 0xfffffffeffffffff)) (i32.const 0xffffffff))
    49  (assert_return (invoke "i32.wrap_i64" (i64.const 0xffffffff00000001)) (i32.const 0x00000001))
    50  (assert_return (invoke "i32.wrap_i64" (i64.const 0)) (i32.const 0))
    51  (assert_return (invoke "i32.wrap_i64" (i64.const 1311768467463790320)) (i32.const 0x9abcdef0))
    52  (assert_return (invoke "i32.wrap_i64" (i64.const 0x00000000ffffffff)) (i32.const 0xffffffff))
    53  (assert_return (invoke "i32.wrap_i64" (i64.const 0x0000000100000000)) (i32.const 0x00000000))
    54  (assert_return (invoke "i32.wrap_i64" (i64.const 0x0000000100000001)) (i32.const 0x00000001))
    55  
    56  (assert_return (invoke "i32.trunc_f32_s" (f32.const 0.0)) (i32.const 0))
    57  (assert_return (invoke "i32.trunc_f32_s" (f32.const -0.0)) (i32.const 0))
    58  (assert_return (invoke "i32.trunc_f32_s" (f32.const 0x1p-149)) (i32.const 0))
    59  (assert_return (invoke "i32.trunc_f32_s" (f32.const -0x1p-149)) (i32.const 0))
    60  (assert_return (invoke "i32.trunc_f32_s" (f32.const 1.0)) (i32.const 1))
    61  (assert_return (invoke "i32.trunc_f32_s" (f32.const 0x1.19999ap+0)) (i32.const 1))
    62  (assert_return (invoke "i32.trunc_f32_s" (f32.const 1.5)) (i32.const 1))
    63  (assert_return (invoke "i32.trunc_f32_s" (f32.const -1.0)) (i32.const -1))
    64  (assert_return (invoke "i32.trunc_f32_s" (f32.const -0x1.19999ap+0)) (i32.const -1))
    65  (assert_return (invoke "i32.trunc_f32_s" (f32.const -1.5)) (i32.const -1))
    66  (assert_return (invoke "i32.trunc_f32_s" (f32.const -1.9)) (i32.const -1))
    67  (assert_return (invoke "i32.trunc_f32_s" (f32.const -2.0)) (i32.const -2))
    68  (assert_return (invoke "i32.trunc_f32_s" (f32.const 2147483520.0)) (i32.const 2147483520))
    69  (assert_return (invoke "i32.trunc_f32_s" (f32.const -2147483648.0)) (i32.const -2147483648))
    70  (assert_trap (invoke "i32.trunc_f32_s" (f32.const 2147483648.0)) "integer overflow")
    71  (assert_trap (invoke "i32.trunc_f32_s" (f32.const -2147483904.0)) "integer overflow")
    72  (assert_trap (invoke "i32.trunc_f32_s" (f32.const inf)) "integer overflow")
    73  (assert_trap (invoke "i32.trunc_f32_s" (f32.const -inf)) "integer overflow")
    74  (assert_trap (invoke "i32.trunc_f32_s" (f32.const nan)) "invalid conversion to integer")
    75  (assert_trap (invoke "i32.trunc_f32_s" (f32.const nan:0x200000)) "invalid conversion to integer")
    76  (assert_trap (invoke "i32.trunc_f32_s" (f32.const -nan)) "invalid conversion to integer")
    77  (assert_trap (invoke "i32.trunc_f32_s" (f32.const -nan:0x200000)) "invalid conversion to integer")
    78  
    79  (assert_return (invoke "i32.trunc_f32_u" (f32.const 0.0)) (i32.const 0))
    80  (assert_return (invoke "i32.trunc_f32_u" (f32.const -0.0)) (i32.const 0))
    81  (assert_return (invoke "i32.trunc_f32_u" (f32.const 0x1p-149)) (i32.const 0))
    82  (assert_return (invoke "i32.trunc_f32_u" (f32.const -0x1p-149)) (i32.const 0))
    83  (assert_return (invoke "i32.trunc_f32_u" (f32.const 1.0)) (i32.const 1))
    84  (assert_return (invoke "i32.trunc_f32_u" (f32.const 0x1.19999ap+0)) (i32.const 1))
    85  (assert_return (invoke "i32.trunc_f32_u" (f32.const 1.5)) (i32.const 1))
    86  (assert_return (invoke "i32.trunc_f32_u" (f32.const 1.9)) (i32.const 1))
    87  (assert_return (invoke "i32.trunc_f32_u" (f32.const 2.0)) (i32.const 2))
    88  (assert_return (invoke "i32.trunc_f32_u" (f32.const 2147483648)) (i32.const -2147483648)) ;; 0x1.00000p+31 -> 8000 0000
    89  (assert_return (invoke "i32.trunc_f32_u" (f32.const 4294967040.0)) (i32.const -256))
    90  (assert_return (invoke "i32.trunc_f32_u" (f32.const -0x1.ccccccp-1)) (i32.const 0))
    91  (assert_return (invoke "i32.trunc_f32_u" (f32.const -0x1.fffffep-1)) (i32.const 0))
    92  (assert_trap (invoke "i32.trunc_f32_u" (f32.const 4294967296.0)) "integer overflow")
    93  (assert_trap (invoke "i32.trunc_f32_u" (f32.const -1.0)) "integer overflow")
    94  (assert_trap (invoke "i32.trunc_f32_u" (f32.const inf)) "integer overflow")
    95  (assert_trap (invoke "i32.trunc_f32_u" (f32.const -inf)) "integer overflow")
    96  (assert_trap (invoke "i32.trunc_f32_u" (f32.const nan)) "invalid conversion to integer")
    97  (assert_trap (invoke "i32.trunc_f32_u" (f32.const nan:0x200000)) "invalid conversion to integer")
    98  (assert_trap (invoke "i32.trunc_f32_u" (f32.const -nan)) "invalid conversion to integer")
    99  (assert_trap (invoke "i32.trunc_f32_u" (f32.const -nan:0x200000)) "invalid conversion to integer")
   100  
   101  (assert_return (invoke "i32.trunc_f64_s" (f64.const 0.0)) (i32.const 0))
   102  (assert_return (invoke "i32.trunc_f64_s" (f64.const -0.0)) (i32.const 0))
   103  (assert_return (invoke "i32.trunc_f64_s" (f64.const 0x0.0000000000001p-1022)) (i32.const 0))
   104  (assert_return (invoke "i32.trunc_f64_s" (f64.const -0x0.0000000000001p-1022)) (i32.const 0))
   105  (assert_return (invoke "i32.trunc_f64_s" (f64.const 1.0)) (i32.const 1))
   106  (assert_return (invoke "i32.trunc_f64_s" (f64.const 0x1.199999999999ap+0)) (i32.const 1))
   107  (assert_return (invoke "i32.trunc_f64_s" (f64.const 1.5)) (i32.const 1))
   108  (assert_return (invoke "i32.trunc_f64_s" (f64.const -1.0)) (i32.const -1))
   109  (assert_return (invoke "i32.trunc_f64_s" (f64.const -0x1.199999999999ap+0)) (i32.const -1))
   110  (assert_return (invoke "i32.trunc_f64_s" (f64.const -1.5)) (i32.const -1))
   111  (assert_return (invoke "i32.trunc_f64_s" (f64.const -1.9)) (i32.const -1))
   112  (assert_return (invoke "i32.trunc_f64_s" (f64.const -2.0)) (i32.const -2))
   113  (assert_return (invoke "i32.trunc_f64_s" (f64.const 2147483647.0)) (i32.const 2147483647))
   114  (assert_return (invoke "i32.trunc_f64_s" (f64.const -2147483648.0)) (i32.const -2147483648))
   115  (assert_trap (invoke "i32.trunc_f64_s" (f64.const 2147483648.0)) "integer overflow")
   116  (assert_trap (invoke "i32.trunc_f64_s" (f64.const -2147483649.0)) "integer overflow")
   117  (assert_trap (invoke "i32.trunc_f64_s" (f64.const inf)) "integer overflow")
   118  (assert_trap (invoke "i32.trunc_f64_s" (f64.const -inf)) "integer overflow")
   119  (assert_trap (invoke "i32.trunc_f64_s" (f64.const nan)) "invalid conversion to integer")
   120  (assert_trap (invoke "i32.trunc_f64_s" (f64.const nan:0x4000000000000)) "invalid conversion to integer")
   121  (assert_trap (invoke "i32.trunc_f64_s" (f64.const -nan)) "invalid conversion to integer")
   122  (assert_trap (invoke "i32.trunc_f64_s" (f64.const -nan:0x4000000000000)) "invalid conversion to integer")
   123  
   124  (assert_return (invoke "i32.trunc_f64_u" (f64.const 0.0)) (i32.const 0))
   125  (assert_return (invoke "i32.trunc_f64_u" (f64.const -0.0)) (i32.const 0))
   126  (assert_return (invoke "i32.trunc_f64_u" (f64.const 0x0.0000000000001p-1022)) (i32.const 0))
   127  (assert_return (invoke "i32.trunc_f64_u" (f64.const -0x0.0000000000001p-1022)) (i32.const 0))
   128  (assert_return (invoke "i32.trunc_f64_u" (f64.const 1.0)) (i32.const 1))
   129  (assert_return (invoke "i32.trunc_f64_u" (f64.const 0x1.199999999999ap+0)) (i32.const 1))
   130  (assert_return (invoke "i32.trunc_f64_u" (f64.const 1.5)) (i32.const 1))
   131  (assert_return (invoke "i32.trunc_f64_u" (f64.const 1.9)) (i32.const 1))
   132  (assert_return (invoke "i32.trunc_f64_u" (f64.const 2.0)) (i32.const 2))
   133  (assert_return (invoke "i32.trunc_f64_u" (f64.const 2147483648)) (i32.const -2147483648)) ;; 0x1.00000p+31 -> 8000 0000
   134  (assert_return (invoke "i32.trunc_f64_u" (f64.const 4294967295.0)) (i32.const -1))
   135  (assert_return (invoke "i32.trunc_f64_u" (f64.const -0x1.ccccccccccccdp-1)) (i32.const 0))
   136  (assert_return (invoke "i32.trunc_f64_u" (f64.const -0x1.fffffffffffffp-1)) (i32.const 0))
   137  (assert_return (invoke "i32.trunc_f64_u" (f64.const 1e8)) (i32.const 100000000))
   138  (assert_trap (invoke "i32.trunc_f64_u" (f64.const 4294967296.0)) "integer overflow")
   139  (assert_trap (invoke "i32.trunc_f64_u" (f64.const -1.0)) "integer overflow")
   140  (assert_trap (invoke "i32.trunc_f64_u" (f64.const 1e16)) "integer overflow")
   141  (assert_trap (invoke "i32.trunc_f64_u" (f64.const 1e30)) "integer overflow")
   142  (assert_trap (invoke "i32.trunc_f64_u" (f64.const 9223372036854775808)) "integer overflow")
   143  (assert_trap (invoke "i32.trunc_f64_u" (f64.const inf)) "integer overflow")
   144  (assert_trap (invoke "i32.trunc_f64_u" (f64.const -inf)) "integer overflow")
   145  (assert_trap (invoke "i32.trunc_f64_u" (f64.const nan)) "invalid conversion to integer")
   146  (assert_trap (invoke "i32.trunc_f64_u" (f64.const nan:0x4000000000000)) "invalid conversion to integer")
   147  (assert_trap (invoke "i32.trunc_f64_u" (f64.const -nan)) "invalid conversion to integer")
   148  (assert_trap (invoke "i32.trunc_f64_u" (f64.const -nan:0x4000000000000)) "invalid conversion to integer")
   149  
   150  (assert_return (invoke "i64.trunc_f32_s" (f32.const 0.0)) (i64.const 0))
   151  (assert_return (invoke "i64.trunc_f32_s" (f32.const -0.0)) (i64.const 0))
   152  (assert_return (invoke "i64.trunc_f32_s" (f32.const 0x1p-149)) (i64.const 0))
   153  (assert_return (invoke "i64.trunc_f32_s" (f32.const -0x1p-149)) (i64.const 0))
   154  (assert_return (invoke "i64.trunc_f32_s" (f32.const 1.0)) (i64.const 1))
   155  (assert_return (invoke "i64.trunc_f32_s" (f32.const 0x1.19999ap+0)) (i64.const 1))
   156  (assert_return (invoke "i64.trunc_f32_s" (f32.const 1.5)) (i64.const 1))
   157  (assert_return (invoke "i64.trunc_f32_s" (f32.const -1.0)) (i64.const -1))
   158  (assert_return (invoke "i64.trunc_f32_s" (f32.const -0x1.19999ap+0)) (i64.const -1))
   159  (assert_return (invoke "i64.trunc_f32_s" (f32.const -1.5)) (i64.const -1))
   160  (assert_return (invoke "i64.trunc_f32_s" (f32.const -1.9)) (i64.const -1))
   161  (assert_return (invoke "i64.trunc_f32_s" (f32.const -2.0)) (i64.const -2))
   162  (assert_return (invoke "i64.trunc_f32_s" (f32.const 4294967296)) (i64.const 4294967296)) ;; 0x1.00000p+32 -> 1 0000 0000
   163  (assert_return (invoke "i64.trunc_f32_s" (f32.const -4294967296)) (i64.const -4294967296)) ;; -0x1.00000p+32 -> ffff ffff 0000 0000
   164  (assert_return (invoke "i64.trunc_f32_s" (f32.const 9223371487098961920.0)) (i64.const 9223371487098961920))
   165  (assert_return (invoke "i64.trunc_f32_s" (f32.const -9223372036854775808.0)) (i64.const -9223372036854775808))
   166  (assert_trap (invoke "i64.trunc_f32_s" (f32.const 9223372036854775808.0)) "integer overflow")
   167  (assert_trap (invoke "i64.trunc_f32_s" (f32.const -9223373136366403584.0)) "integer overflow")
   168  (assert_trap (invoke "i64.trunc_f32_s" (f32.const inf)) "integer overflow")
   169  (assert_trap (invoke "i64.trunc_f32_s" (f32.const -inf)) "integer overflow")
   170  (assert_trap (invoke "i64.trunc_f32_s" (f32.const nan)) "invalid conversion to integer")
   171  (assert_trap (invoke "i64.trunc_f32_s" (f32.const nan:0x200000)) "invalid conversion to integer")
   172  (assert_trap (invoke "i64.trunc_f32_s" (f32.const -nan)) "invalid conversion to integer")
   173  (assert_trap (invoke "i64.trunc_f32_s" (f32.const -nan:0x200000)) "invalid conversion to integer")
   174  
   175  (assert_return (invoke "i64.trunc_f32_u" (f32.const 0.0)) (i64.const 0))
   176  (assert_return (invoke "i64.trunc_f32_u" (f32.const -0.0)) (i64.const 0))
   177  (assert_return (invoke "i64.trunc_f32_u" (f32.const 0x1p-149)) (i64.const 0))
   178  (assert_return (invoke "i64.trunc_f32_u" (f32.const -0x1p-149)) (i64.const 0))
   179  (assert_return (invoke "i64.trunc_f32_u" (f32.const 1.0)) (i64.const 1))
   180  (assert_return (invoke "i64.trunc_f32_u" (f32.const 0x1.19999ap+0)) (i64.const 1))
   181  (assert_return (invoke "i64.trunc_f32_u" (f32.const 1.5)) (i64.const 1))
   182  (assert_return (invoke "i64.trunc_f32_u" (f32.const 4294967296)) (i64.const 4294967296))
   183  (assert_return (invoke "i64.trunc_f32_u" (f32.const 18446742974197923840.0)) (i64.const -1099511627776))
   184  (assert_return (invoke "i64.trunc_f32_u" (f32.const -0x1.ccccccp-1)) (i64.const 0))
   185  (assert_return (invoke "i64.trunc_f32_u" (f32.const -0x1.fffffep-1)) (i64.const 0))
   186  (assert_trap (invoke "i64.trunc_f32_u" (f32.const 18446744073709551616.0)) "integer overflow")
   187  (assert_trap (invoke "i64.trunc_f32_u" (f32.const -1.0)) "integer overflow")
   188  (assert_trap (invoke "i64.trunc_f32_u" (f32.const inf)) "integer overflow")
   189  (assert_trap (invoke "i64.trunc_f32_u" (f32.const -inf)) "integer overflow")
   190  (assert_trap (invoke "i64.trunc_f32_u" (f32.const nan)) "invalid conversion to integer")
   191  (assert_trap (invoke "i64.trunc_f32_u" (f32.const nan:0x200000)) "invalid conversion to integer")
   192  (assert_trap (invoke "i64.trunc_f32_u" (f32.const -nan)) "invalid conversion to integer")
   193  (assert_trap (invoke "i64.trunc_f32_u" (f32.const -nan:0x200000)) "invalid conversion to integer")
   194  
   195  (assert_return (invoke "i64.trunc_f64_s" (f64.const 0.0)) (i64.const 0))
   196  (assert_return (invoke "i64.trunc_f64_s" (f64.const -0.0)) (i64.const 0))
   197  (assert_return (invoke "i64.trunc_f64_s" (f64.const 0x0.0000000000001p-1022)) (i64.const 0))
   198  (assert_return (invoke "i64.trunc_f64_s" (f64.const -0x0.0000000000001p-1022)) (i64.const 0))
   199  (assert_return (invoke "i64.trunc_f64_s" (f64.const 1.0)) (i64.const 1))
   200  (assert_return (invoke "i64.trunc_f64_s" (f64.const 0x1.199999999999ap+0)) (i64.const 1))
   201  (assert_return (invoke "i64.trunc_f64_s" (f64.const 1.5)) (i64.const 1))
   202  (assert_return (invoke "i64.trunc_f64_s" (f64.const -1.0)) (i64.const -1))
   203  (assert_return (invoke "i64.trunc_f64_s" (f64.const -0x1.199999999999ap+0)) (i64.const -1))
   204  (assert_return (invoke "i64.trunc_f64_s" (f64.const -1.5)) (i64.const -1))
   205  (assert_return (invoke "i64.trunc_f64_s" (f64.const -1.9)) (i64.const -1))
   206  (assert_return (invoke "i64.trunc_f64_s" (f64.const -2.0)) (i64.const -2))
   207  (assert_return (invoke "i64.trunc_f64_s" (f64.const 4294967296)) (i64.const 4294967296)) ;; 0x1.00000p+32 -> 1 0000 0000
   208  (assert_return (invoke "i64.trunc_f64_s" (f64.const -4294967296)) (i64.const -4294967296)) ;; -0x1.00000p+32 -> ffff ffff 0000 0000
   209  (assert_return (invoke "i64.trunc_f64_s" (f64.const 9223372036854774784.0)) (i64.const 9223372036854774784))
   210  (assert_return (invoke "i64.trunc_f64_s" (f64.const -9223372036854775808.0)) (i64.const -9223372036854775808))
   211  (assert_trap (invoke "i64.trunc_f64_s" (f64.const 9223372036854775808.0)) "integer overflow")
   212  (assert_trap (invoke "i64.trunc_f64_s" (f64.const -9223372036854777856.0)) "integer overflow")
   213  (assert_trap (invoke "i64.trunc_f64_s" (f64.const inf)) "integer overflow")
   214  (assert_trap (invoke "i64.trunc_f64_s" (f64.const -inf)) "integer overflow")
   215  (assert_trap (invoke "i64.trunc_f64_s" (f64.const nan)) "invalid conversion to integer")
   216  (assert_trap (invoke "i64.trunc_f64_s" (f64.const nan:0x4000000000000)) "invalid conversion to integer")
   217  (assert_trap (invoke "i64.trunc_f64_s" (f64.const -nan)) "invalid conversion to integer")
   218  (assert_trap (invoke "i64.trunc_f64_s" (f64.const -nan:0x4000000000000)) "invalid conversion to integer")
   219  
   220  (assert_return (invoke "i64.trunc_f64_u" (f64.const 0.0)) (i64.const 0))
   221  (assert_return (invoke "i64.trunc_f64_u" (f64.const -0.0)) (i64.const 0))
   222  (assert_return (invoke "i64.trunc_f64_u" (f64.const 0x0.0000000000001p-1022)) (i64.const 0))
   223  (assert_return (invoke "i64.trunc_f64_u" (f64.const -0x0.0000000000001p-1022)) (i64.const 0))
   224  (assert_return (invoke "i64.trunc_f64_u" (f64.const 1.0)) (i64.const 1))
   225  (assert_return (invoke "i64.trunc_f64_u" (f64.const 0x1.199999999999ap+0)) (i64.const 1))
   226  (assert_return (invoke "i64.trunc_f64_u" (f64.const 1.5)) (i64.const 1))
   227  (assert_return (invoke "i64.trunc_f64_u" (f64.const 4294967295)) (i64.const 0xffffffff))
   228  (assert_return (invoke "i64.trunc_f64_u" (f64.const 4294967296)) (i64.const 0x100000000))
   229  (assert_return (invoke "i64.trunc_f64_u" (f64.const 18446744073709549568.0)) (i64.const -2048))
   230  (assert_return (invoke "i64.trunc_f64_u" (f64.const -0x1.ccccccccccccdp-1)) (i64.const 0))
   231  (assert_return (invoke "i64.trunc_f64_u" (f64.const -0x1.fffffffffffffp-1)) (i64.const 0))
   232  (assert_return (invoke "i64.trunc_f64_u" (f64.const 1e8)) (i64.const 100000000))
   233  (assert_return (invoke "i64.trunc_f64_u" (f64.const 1e16)) (i64.const 10000000000000000))
   234  (assert_return (invoke "i64.trunc_f64_u" (f64.const 9223372036854775808)) (i64.const -9223372036854775808))
   235  (assert_trap (invoke "i64.trunc_f64_u" (f64.const 18446744073709551616.0)) "integer overflow")
   236  (assert_trap (invoke "i64.trunc_f64_u" (f64.const -1.0)) "integer overflow")
   237  (assert_trap (invoke "i64.trunc_f64_u" (f64.const inf)) "integer overflow")
   238  (assert_trap (invoke "i64.trunc_f64_u" (f64.const -inf)) "integer overflow")
   239  (assert_trap (invoke "i64.trunc_f64_u" (f64.const nan)) "invalid conversion to integer")
   240  (assert_trap (invoke "i64.trunc_f64_u" (f64.const nan:0x4000000000000)) "invalid conversion to integer")
   241  (assert_trap (invoke "i64.trunc_f64_u" (f64.const -nan)) "invalid conversion to integer")
   242  (assert_trap (invoke "i64.trunc_f64_u" (f64.const -nan:0x4000000000000)) "invalid conversion to integer")
   243  
   244  (assert_return (invoke "f32.convert_i32_s" (i32.const 1)) (f32.const 1.0))
   245  (assert_return (invoke "f32.convert_i32_s" (i32.const -1)) (f32.const -1.0))
   246  (assert_return (invoke "f32.convert_i32_s" (i32.const 0)) (f32.const 0.0))
   247  (assert_return (invoke "f32.convert_i32_s" (i32.const 2147483647)) (f32.const 2147483648))
   248  (assert_return (invoke "f32.convert_i32_s" (i32.const -2147483648)) (f32.const -2147483648))
   249  (assert_return (invoke "f32.convert_i32_s" (i32.const 1234567890)) (f32.const 0x1.26580cp+30))
   250  ;; Test rounding directions.
   251  (assert_return (invoke "f32.convert_i32_s" (i32.const 16777217)) (f32.const 16777216.0))
   252  (assert_return (invoke "f32.convert_i32_s" (i32.const -16777217)) (f32.const -16777216.0))
   253  (assert_return (invoke "f32.convert_i32_s" (i32.const 16777219)) (f32.const 16777220.0))
   254  (assert_return (invoke "f32.convert_i32_s" (i32.const -16777219)) (f32.const -16777220.0))
   255  
   256  (assert_return (invoke "f32.convert_i64_s" (i64.const 1)) (f32.const 1.0))
   257  (assert_return (invoke "f32.convert_i64_s" (i64.const -1)) (f32.const -1.0))
   258  (assert_return (invoke "f32.convert_i64_s" (i64.const 0)) (f32.const 0.0))
   259  (assert_return (invoke "f32.convert_i64_s" (i64.const 9223372036854775807)) (f32.const 9223372036854775807))
   260  (assert_return (invoke "f32.convert_i64_s" (i64.const -9223372036854775808)) (f32.const -9223372036854775808))
   261  (assert_return (invoke "f32.convert_i64_s" (i64.const 314159265358979)) (f32.const 0x1.1db9e8p+48)) ;; PI
   262  ;; Test rounding directions.
   263  (assert_return (invoke "f32.convert_i64_s" (i64.const 16777217)) (f32.const 16777216.0))
   264  (assert_return (invoke "f32.convert_i64_s" (i64.const -16777217)) (f32.const -16777216.0))
   265  (assert_return (invoke "f32.convert_i64_s" (i64.const 16777219)) (f32.const 16777220.0))
   266  (assert_return (invoke "f32.convert_i64_s" (i64.const -16777219)) (f32.const -16777220.0))
   267  
   268  (assert_return (invoke "f32.convert_i64_s" (i64.const 0x7fffff4000000001)) (f32.const 0x1.fffffep+62))
   269  (assert_return (invoke "f32.convert_i64_s" (i64.const 0x8000004000000001)) (f32.const -0x1.fffffep+62))
   270  (assert_return (invoke "f32.convert_i64_s" (i64.const 0x0020000020000001)) (f32.const 0x1.000002p+53))
   271  (assert_return (invoke "f32.convert_i64_s" (i64.const 0xffdfffffdfffffff)) (f32.const -0x1.000002p+53))
   272  
   273  (assert_return (invoke "f64.convert_i32_s" (i32.const 1)) (f64.const 1.0))
   274  (assert_return (invoke "f64.convert_i32_s" (i32.const -1)) (f64.const -1.0))
   275  (assert_return (invoke "f64.convert_i32_s" (i32.const 0)) (f64.const 0.0))
   276  (assert_return (invoke "f64.convert_i32_s" (i32.const 2147483647)) (f64.const 2147483647))
   277  (assert_return (invoke "f64.convert_i32_s" (i32.const -2147483648)) (f64.const -2147483648))
   278  (assert_return (invoke "f64.convert_i32_s" (i32.const 987654321)) (f64.const 987654321))
   279  
   280  (assert_return (invoke "f64.convert_i64_s" (i64.const 1)) (f64.const 1.0))
   281  (assert_return (invoke "f64.convert_i64_s" (i64.const -1)) (f64.const -1.0))
   282  (assert_return (invoke "f64.convert_i64_s" (i64.const 0)) (f64.const 0.0))
   283  (assert_return (invoke "f64.convert_i64_s" (i64.const 9223372036854775807)) (f64.const 9223372036854775807))
   284  (assert_return (invoke "f64.convert_i64_s" (i64.const -9223372036854775808)) (f64.const -9223372036854775808))
   285  (assert_return (invoke "f64.convert_i64_s" (i64.const 4669201609102990)) (f64.const 4669201609102990)) ;; Feigenbaum
   286  ;; Test rounding directions.
   287  (assert_return (invoke "f64.convert_i64_s" (i64.const 9007199254740993)) (f64.const 9007199254740992))
   288  (assert_return (invoke "f64.convert_i64_s" (i64.const -9007199254740993)) (f64.const -9007199254740992))
   289  (assert_return (invoke "f64.convert_i64_s" (i64.const 9007199254740995)) (f64.const 9007199254740996))
   290  (assert_return (invoke "f64.convert_i64_s" (i64.const -9007199254740995)) (f64.const -9007199254740996))
   291  
   292  (assert_return (invoke "f32.convert_i32_u" (i32.const 1)) (f32.const 1.0))
   293  (assert_return (invoke "f32.convert_i32_u" (i32.const 0)) (f32.const 0.0))
   294  (assert_return (invoke "f32.convert_i32_u" (i32.const 2147483647)) (f32.const 2147483648))
   295  (assert_return (invoke "f32.convert_i32_u" (i32.const -2147483648)) (f32.const 2147483648))
   296  (assert_return (invoke "f32.convert_i32_u" (i32.const 0x12345678)) (f32.const 0x1.234568p+28))
   297  (assert_return (invoke "f32.convert_i32_u" (i32.const 0xffffffff)) (f32.const 4294967296.0))
   298  (assert_return (invoke "f32.convert_i32_u" (i32.const 0x80000080)) (f32.const 0x1.000000p+31))
   299  (assert_return (invoke "f32.convert_i32_u" (i32.const 0x80000081)) (f32.const 0x1.000002p+31))
   300  (assert_return (invoke "f32.convert_i32_u" (i32.const 0x80000082)) (f32.const 0x1.000002p+31))
   301  (assert_return (invoke "f32.convert_i32_u" (i32.const 0xfffffe80)) (f32.const 0x1.fffffcp+31))
   302  (assert_return (invoke "f32.convert_i32_u" (i32.const 0xfffffe81)) (f32.const 0x1.fffffep+31))
   303  (assert_return (invoke "f32.convert_i32_u" (i32.const 0xfffffe82)) (f32.const 0x1.fffffep+31))
   304  ;; Test rounding directions.
   305  (assert_return (invoke "f32.convert_i32_u" (i32.const 16777217)) (f32.const 16777216.0))
   306  (assert_return (invoke "f32.convert_i32_u" (i32.const 16777219)) (f32.const 16777220.0))
   307  
   308  (assert_return (invoke "f32.convert_i64_u" (i64.const 1)) (f32.const 1.0))
   309  (assert_return (invoke "f32.convert_i64_u" (i64.const 0)) (f32.const 0.0))
   310  (assert_return (invoke "f32.convert_i64_u" (i64.const 9223372036854775807)) (f32.const 9223372036854775807))
   311  (assert_return (invoke "f32.convert_i64_u" (i64.const -9223372036854775808)) (f32.const 9223372036854775808))
   312  (assert_return (invoke "f32.convert_i64_u" (i64.const 0xffffffffffffffff)) (f32.const 18446744073709551616.0))
   313  ;; Test rounding directions.
   314  (assert_return (invoke "f32.convert_i64_u" (i64.const 16777217)) (f32.const 16777216.0))
   315  (assert_return (invoke "f32.convert_i64_u" (i64.const 16777219)) (f32.const 16777220.0))
   316  
   317  (assert_return (invoke "f32.convert_i64_u" (i64.const 0x0020000020000001)) (f32.const 0x1.000002p+53))
   318  (assert_return (invoke "f32.convert_i64_u" (i64.const 0x7fffffbfffffffff)) (f32.const 0x1.fffffep+62))
   319  (assert_return (invoke "f32.convert_i64_u" (i64.const 0x8000008000000001)) (f32.const 0x1.000002p+63))
   320  (assert_return (invoke "f32.convert_i64_u" (i64.const 0xfffffe8000000001)) (f32.const 0x1.fffffep+63))
   321  
   322  (assert_return (invoke "f64.convert_i32_u" (i32.const 1)) (f64.const 1.0))
   323  (assert_return (invoke "f64.convert_i32_u" (i32.const 0)) (f64.const 0.0))
   324  (assert_return (invoke "f64.convert_i32_u" (i32.const 2147483647)) (f64.const 2147483647))
   325  (assert_return (invoke "f64.convert_i32_u" (i32.const -2147483648)) (f64.const 2147483648))
   326  (assert_return (invoke "f64.convert_i32_u" (i32.const 0xffffffff)) (f64.const 4294967295.0))
   327  
   328  (assert_return (invoke "f64.convert_i64_u" (i64.const 1)) (f64.const 1.0))
   329  (assert_return (invoke "f64.convert_i64_u" (i64.const 0)) (f64.const 0.0))
   330  (assert_return (invoke "f64.convert_i64_u" (i64.const 9223372036854775807)) (f64.const 9223372036854775807))
   331  (assert_return (invoke "f64.convert_i64_u" (i64.const -9223372036854775808)) (f64.const 9223372036854775808))
   332  (assert_return (invoke "f64.convert_i64_u" (i64.const 0xffffffffffffffff)) (f64.const 18446744073709551616.0))
   333  (assert_return (invoke "f64.convert_i64_u" (i64.const 0x8000000000000400)) (f64.const 0x1.0000000000000p+63))
   334  (assert_return (invoke "f64.convert_i64_u" (i64.const 0x8000000000000401)) (f64.const 0x1.0000000000001p+63))
   335  (assert_return (invoke "f64.convert_i64_u" (i64.const 0x8000000000000402)) (f64.const 0x1.0000000000001p+63))
   336  (assert_return (invoke "f64.convert_i64_u" (i64.const 0xfffffffffffff400)) (f64.const 0x1.ffffffffffffep+63))
   337  (assert_return (invoke "f64.convert_i64_u" (i64.const 0xfffffffffffff401)) (f64.const 0x1.fffffffffffffp+63))
   338  (assert_return (invoke "f64.convert_i64_u" (i64.const 0xfffffffffffff402)) (f64.const 0x1.fffffffffffffp+63))
   339  ;; Test rounding directions.
   340  (assert_return (invoke "f64.convert_i64_u" (i64.const 9007199254740993)) (f64.const 9007199254740992))
   341  (assert_return (invoke "f64.convert_i64_u" (i64.const 9007199254740995)) (f64.const 9007199254740996))
   342  
   343  (assert_return (invoke "f64.promote_f32" (f32.const 0.0)) (f64.const 0.0))
   344  (assert_return (invoke "f64.promote_f32" (f32.const -0.0)) (f64.const -0.0))
   345  (assert_return (invoke "f64.promote_f32" (f32.const 0x1p-149)) (f64.const 0x1p-149))
   346  (assert_return (invoke "f64.promote_f32" (f32.const -0x1p-149)) (f64.const -0x1p-149))
   347  (assert_return (invoke "f64.promote_f32" (f32.const 1.0)) (f64.const 1.0))
   348  (assert_return (invoke "f64.promote_f32" (f32.const -1.0)) (f64.const -1.0))
   349  (assert_return (invoke "f64.promote_f32" (f32.const -0x1.fffffep+127)) (f64.const -0x1.fffffep+127))
   350  (assert_return (invoke "f64.promote_f32" (f32.const 0x1.fffffep+127)) (f64.const 0x1.fffffep+127))
   351  ;; Generated randomly by picking a random int and reinterpret it to float.
   352  (assert_return (invoke "f64.promote_f32" (f32.const 0x1p-119)) (f64.const 0x1p-119))
   353  ;; Generated randomly by picking a random float.
   354  (assert_return (invoke "f64.promote_f32" (f32.const 0x1.8f867ep+125)) (f64.const 6.6382536710104395e+37))
   355  (assert_return (invoke "f64.promote_f32" (f32.const inf)) (f64.const inf))
   356  (assert_return (invoke "f64.promote_f32" (f32.const -inf)) (f64.const -inf))
   357  (assert_return (invoke "f64.promote_f32" (f32.const nan)) (f64.const nan:canonical))
   358  (assert_return (invoke "f64.promote_f32" (f32.const nan:0x200000)) (f64.const nan:arithmetic))
   359  (assert_return (invoke "f64.promote_f32" (f32.const -nan)) (f64.const nan:canonical))
   360  (assert_return (invoke "f64.promote_f32" (f32.const -nan:0x200000)) (f64.const nan:arithmetic))
   361  
   362  (assert_return (invoke "f32.demote_f64" (f64.const 0.0)) (f32.const 0.0))
   363  (assert_return (invoke "f32.demote_f64" (f64.const -0.0)) (f32.const -0.0))
   364  (assert_return (invoke "f32.demote_f64" (f64.const 0x0.0000000000001p-1022)) (f32.const 0.0))
   365  (assert_return (invoke "f32.demote_f64" (f64.const -0x0.0000000000001p-1022)) (f32.const -0.0))
   366  (assert_return (invoke "f32.demote_f64" (f64.const 1.0)) (f32.const 1.0))
   367  (assert_return (invoke "f32.demote_f64" (f64.const -1.0)) (f32.const -1.0))
   368  (assert_return (invoke "f32.demote_f64" (f64.const 0x1.fffffe0000000p-127)) (f32.const 0x1p-126))
   369  (assert_return (invoke "f32.demote_f64" (f64.const -0x1.fffffe0000000p-127)) (f32.const -0x1p-126))
   370  (assert_return (invoke "f32.demote_f64" (f64.const 0x1.fffffdfffffffp-127)) (f32.const 0x1.fffffcp-127))
   371  (assert_return (invoke "f32.demote_f64" (f64.const -0x1.fffffdfffffffp-127)) (f32.const -0x1.fffffcp-127))
   372  (assert_return (invoke "f32.demote_f64" (f64.const 0x1p-149)) (f32.const 0x1p-149))
   373  (assert_return (invoke "f32.demote_f64" (f64.const -0x1p-149)) (f32.const -0x1p-149))
   374  (assert_return (invoke "f32.demote_f64" (f64.const 0x1.fffffd0000000p+127)) (f32.const 0x1.fffffcp+127))
   375  (assert_return (invoke "f32.demote_f64" (f64.const -0x1.fffffd0000000p+127)) (f32.const -0x1.fffffcp+127))
   376  (assert_return (invoke "f32.demote_f64" (f64.const 0x1.fffffd0000001p+127)) (f32.const 0x1.fffffep+127))
   377  (assert_return (invoke "f32.demote_f64" (f64.const -0x1.fffffd0000001p+127)) (f32.const -0x1.fffffep+127))
   378  (assert_return (invoke "f32.demote_f64" (f64.const 0x1.fffffep+127)) (f32.const 0x1.fffffep+127))
   379  (assert_return (invoke "f32.demote_f64" (f64.const -0x1.fffffep+127)) (f32.const -0x1.fffffep+127))
   380  (assert_return (invoke "f32.demote_f64" (f64.const 0x1.fffffefffffffp+127)) (f32.const 0x1.fffffep+127))
   381  (assert_return (invoke "f32.demote_f64" (f64.const -0x1.fffffefffffffp+127)) (f32.const -0x1.fffffep+127))
   382  (assert_return (invoke "f32.demote_f64" (f64.const 0x1.ffffffp+127)) (f32.const inf))
   383  (assert_return (invoke "f32.demote_f64" (f64.const -0x1.ffffffp+127)) (f32.const -inf))
   384  (assert_return (invoke "f32.demote_f64" (f64.const 0x1p-119)) (f32.const 0x1p-119))
   385  (assert_return (invoke "f32.demote_f64" (f64.const 0x1.8f867ep+125)) (f32.const 0x1.8f867ep+125))
   386  (assert_return (invoke "f32.demote_f64" (f64.const inf)) (f32.const inf))
   387  (assert_return (invoke "f32.demote_f64" (f64.const -inf)) (f32.const -inf))
   388  (assert_return (invoke "f32.demote_f64" (f64.const 0x1.0000000000001p+0)) (f32.const 1.0))
   389  (assert_return (invoke "f32.demote_f64" (f64.const 0x1.fffffffffffffp-1)) (f32.const 1.0))
   390  (assert_return (invoke "f32.demote_f64" (f64.const 0x1.0000010000000p+0)) (f32.const 0x1.000000p+0))
   391  (assert_return (invoke "f32.demote_f64" (f64.const 0x1.0000010000001p+0)) (f32.const 0x1.000002p+0))
   392  (assert_return (invoke "f32.demote_f64" (f64.const 0x1.000002fffffffp+0)) (f32.const 0x1.000002p+0))
   393  (assert_return (invoke "f32.demote_f64" (f64.const 0x1.0000030000000p+0)) (f32.const 0x1.000004p+0))
   394  (assert_return (invoke "f32.demote_f64" (f64.const 0x1.0000050000000p+0)) (f32.const 0x1.000004p+0))
   395  (assert_return (invoke "f32.demote_f64" (f64.const 0x1.0000010000000p+24)) (f32.const 0x1.0p+24))
   396  (assert_return (invoke "f32.demote_f64" (f64.const 0x1.0000010000001p+24)) (f32.const 0x1.000002p+24))
   397  (assert_return (invoke "f32.demote_f64" (f64.const 0x1.000002fffffffp+24)) (f32.const 0x1.000002p+24))
   398  (assert_return (invoke "f32.demote_f64" (f64.const 0x1.0000030000000p+24)) (f32.const 0x1.000004p+24))
   399  (assert_return (invoke "f32.demote_f64" (f64.const 0x1.4eae4f7024c7p+108)) (f32.const 0x1.4eae5p+108))
   400  (assert_return (invoke "f32.demote_f64" (f64.const 0x1.a12e71e358685p-113)) (f32.const 0x1.a12e72p-113))
   401  (assert_return (invoke "f32.demote_f64" (f64.const 0x1.cb98354d521ffp-127)) (f32.const 0x1.cb9834p-127))
   402  (assert_return (invoke "f32.demote_f64" (f64.const -0x1.6972b30cfb562p+1)) (f32.const -0x1.6972b4p+1))
   403  (assert_return (invoke "f32.demote_f64" (f64.const -0x1.bedbe4819d4c4p+112)) (f32.const -0x1.bedbe4p+112))
   404  (assert_return (invoke "f32.demote_f64" (f64.const nan)) (f32.const nan:canonical))
   405  (assert_return (invoke "f32.demote_f64" (f64.const nan:0x4000000000000)) (f32.const nan:arithmetic))
   406  (assert_return (invoke "f32.demote_f64" (f64.const -nan)) (f32.const nan:canonical))
   407  (assert_return (invoke "f32.demote_f64" (f64.const -nan:0x4000000000000)) (f32.const nan:arithmetic))
   408  (assert_return (invoke "f32.demote_f64" (f64.const 0x1p-1022)) (f32.const 0.0))
   409  (assert_return (invoke "f32.demote_f64" (f64.const -0x1p-1022)) (f32.const -0.0))
   410  (assert_return (invoke "f32.demote_f64" (f64.const 0x1.0p-150)) (f32.const 0.0))
   411  (assert_return (invoke "f32.demote_f64" (f64.const -0x1.0p-150)) (f32.const -0.0))
   412  (assert_return (invoke "f32.demote_f64" (f64.const 0x1.0000000000001p-150)) (f32.const 0x1p-149))
   413  (assert_return (invoke "f32.demote_f64" (f64.const -0x1.0000000000001p-150)) (f32.const -0x1p-149))
   414  
   415  (assert_return (invoke "f32.reinterpret_i32" (i32.const 0)) (f32.const 0.0))
   416  (assert_return (invoke "f32.reinterpret_i32" (i32.const 0x80000000)) (f32.const -0.0))
   417  (assert_return (invoke "f32.reinterpret_i32" (i32.const 1)) (f32.const 0x1p-149))
   418  (assert_return (invoke "f32.reinterpret_i32" (i32.const -1)) (f32.const -nan:0x7fffff))
   419  (assert_return (invoke "f32.reinterpret_i32" (i32.const 123456789)) (f32.const 0x1.b79a2ap-113))
   420  (assert_return (invoke "f32.reinterpret_i32" (i32.const -2147483647)) (f32.const -0x1p-149))
   421  (assert_return (invoke "f32.reinterpret_i32" (i32.const 0x7f800000)) (f32.const inf))
   422  (assert_return (invoke "f32.reinterpret_i32" (i32.const 0xff800000)) (f32.const -inf))
   423  (assert_return (invoke "f32.reinterpret_i32" (i32.const 0x7fc00000)) (f32.const nan))
   424  (assert_return (invoke "f32.reinterpret_i32" (i32.const 0xffc00000)) (f32.const -nan))
   425  (assert_return (invoke "f32.reinterpret_i32" (i32.const 0x7fa00000)) (f32.const nan:0x200000))
   426  (assert_return (invoke "f32.reinterpret_i32" (i32.const 0xffa00000)) (f32.const -nan:0x200000))
   427  
   428  (assert_return (invoke "f64.reinterpret_i64" (i64.const 0)) (f64.const 0.0))
   429  (assert_return (invoke "f64.reinterpret_i64" (i64.const 1)) (f64.const 0x0.0000000000001p-1022))
   430  (assert_return (invoke "f64.reinterpret_i64" (i64.const -1)) (f64.const -nan:0xfffffffffffff))
   431  (assert_return (invoke "f64.reinterpret_i64" (i64.const 0x8000000000000000)) (f64.const -0.0))
   432  (assert_return (invoke "f64.reinterpret_i64" (i64.const 1234567890)) (f64.const 0x0.00000499602d2p-1022))
   433  (assert_return (invoke "f64.reinterpret_i64" (i64.const -9223372036854775807)) (f64.const -0x0.0000000000001p-1022))
   434  (assert_return (invoke "f64.reinterpret_i64" (i64.const 0x7ff0000000000000)) (f64.const inf))
   435  (assert_return (invoke "f64.reinterpret_i64" (i64.const 0xfff0000000000000)) (f64.const -inf))
   436  (assert_return (invoke "f64.reinterpret_i64" (i64.const 0x7ff8000000000000)) (f64.const nan))
   437  (assert_return (invoke "f64.reinterpret_i64" (i64.const 0xfff8000000000000)) (f64.const -nan))
   438  (assert_return (invoke "f64.reinterpret_i64" (i64.const 0x7ff4000000000000)) (f64.const nan:0x4000000000000))
   439  (assert_return (invoke "f64.reinterpret_i64" (i64.const 0xfff4000000000000)) (f64.const -nan:0x4000000000000))
   440  
   441  (assert_return (invoke "i32.reinterpret_f32" (f32.const 0.0)) (i32.const 0))
   442  (assert_return (invoke "i32.reinterpret_f32" (f32.const -0.0)) (i32.const 0x80000000))
   443  (assert_return (invoke "i32.reinterpret_f32" (f32.const 0x1p-149)) (i32.const 1))
   444  (assert_return (invoke "i32.reinterpret_f32" (f32.const -nan:0x7fffff)) (i32.const -1))
   445  (assert_return (invoke "i32.reinterpret_f32" (f32.const -0x1p-149)) (i32.const 0x80000001))
   446  (assert_return (invoke "i32.reinterpret_f32" (f32.const 1.0)) (i32.const 1065353216))
   447  (assert_return (invoke "i32.reinterpret_f32" (f32.const 3.1415926)) (i32.const 1078530010))
   448  (assert_return (invoke "i32.reinterpret_f32" (f32.const 0x1.fffffep+127)) (i32.const 2139095039))
   449  (assert_return (invoke "i32.reinterpret_f32" (f32.const -0x1.fffffep+127)) (i32.const -8388609))
   450  (assert_return (invoke "i32.reinterpret_f32" (f32.const inf)) (i32.const 0x7f800000))
   451  (assert_return (invoke "i32.reinterpret_f32" (f32.const -inf)) (i32.const 0xff800000))
   452  (assert_return (invoke "i32.reinterpret_f32" (f32.const nan)) (i32.const 0x7fc00000))
   453  (assert_return (invoke "i32.reinterpret_f32" (f32.const -nan)) (i32.const 0xffc00000))
   454  (assert_return (invoke "i32.reinterpret_f32" (f32.const nan:0x200000)) (i32.const 0x7fa00000))
   455  (assert_return (invoke "i32.reinterpret_f32" (f32.const -nan:0x200000)) (i32.const 0xffa00000))
   456  
   457  (assert_return (invoke "i64.reinterpret_f64" (f64.const 0.0)) (i64.const 0))
   458  (assert_return (invoke "i64.reinterpret_f64" (f64.const -0.0)) (i64.const 0x8000000000000000))
   459  (assert_return (invoke "i64.reinterpret_f64" (f64.const 0x0.0000000000001p-1022)) (i64.const 1))
   460  (assert_return (invoke "i64.reinterpret_f64" (f64.const -nan:0xfffffffffffff)) (i64.const -1))
   461  (assert_return (invoke "i64.reinterpret_f64" (f64.const -0x0.0000000000001p-1022)) (i64.const 0x8000000000000001))
   462  (assert_return (invoke "i64.reinterpret_f64" (f64.const 1.0)) (i64.const 4607182418800017408))
   463  (assert_return (invoke "i64.reinterpret_f64" (f64.const 3.14159265358979)) (i64.const 4614256656552045841))
   464  (assert_return (invoke "i64.reinterpret_f64" (f64.const 0x1.fffffffffffffp+1023)) (i64.const 9218868437227405311))
   465  (assert_return (invoke "i64.reinterpret_f64" (f64.const -0x1.fffffffffffffp+1023)) (i64.const -4503599627370497))
   466  (assert_return (invoke "i64.reinterpret_f64" (f64.const inf)) (i64.const 0x7ff0000000000000))
   467  (assert_return (invoke "i64.reinterpret_f64" (f64.const -inf)) (i64.const 0xfff0000000000000))
   468  (assert_return (invoke "i64.reinterpret_f64" (f64.const nan)) (i64.const 0x7ff8000000000000))
   469  (assert_return (invoke "i64.reinterpret_f64" (f64.const -nan)) (i64.const 0xfff8000000000000))
   470  (assert_return (invoke "i64.reinterpret_f64" (f64.const nan:0x4000000000000)) (i64.const 0x7ff4000000000000))
   471  (assert_return (invoke "i64.reinterpret_f64" (f64.const -nan:0x4000000000000)) (i64.const 0xfff4000000000000))
   472  
   473  ;; Type check
   474  
   475  (assert_invalid (module (func (result i32) (i32.wrap_i64 (f32.const 0)))) "type mismatch")
   476  (assert_invalid (module (func (result i32) (i32.trunc_f32_s (i64.const 0)))) "type mismatch")
   477  (assert_invalid (module (func (result i32) (i32.trunc_f32_u (i64.const 0)))) "type mismatch")
   478  (assert_invalid (module (func (result i32) (i32.trunc_f64_s (i64.const 0)))) "type mismatch")
   479  (assert_invalid (module (func (result i32) (i32.trunc_f64_u (i64.const 0)))) "type mismatch")
   480  (assert_invalid (module (func (result i32) (i32.reinterpret_f32 (i64.const 0)))) "type mismatch")
   481  (assert_invalid (module (func (result i64) (i64.extend_i32_s (f32.const 0)))) "type mismatch")
   482  (assert_invalid (module (func (result i64) (i64.extend_i32_u (f32.const 0)))) "type mismatch")
   483  (assert_invalid (module (func (result i64) (i64.trunc_f32_s (i32.const 0)))) "type mismatch")
   484  (assert_invalid (module (func (result i64) (i64.trunc_f32_u (i32.const 0)))) "type mismatch")
   485  (assert_invalid (module (func (result i64) (i64.trunc_f64_s (i32.const 0)))) "type mismatch")
   486  (assert_invalid (module (func (result i64) (i64.trunc_f64_u (i32.const 0)))) "type mismatch")
   487  (assert_invalid (module (func (result i64) (i64.reinterpret_f64 (i32.const 0)))) "type mismatch")
   488  (assert_invalid (module (func (result f32) (f32.convert_i32_s (i64.const 0)))) "type mismatch")
   489  (assert_invalid (module (func (result f32) (f32.convert_i32_u (i64.const 0)))) "type mismatch")
   490  (assert_invalid (module (func (result f32) (f32.convert_i64_s (i32.const 0)))) "type mismatch")
   491  (assert_invalid (module (func (result f32) (f32.convert_i64_u (i32.const 0)))) "type mismatch")
   492  (assert_invalid (module (func (result f32) (f32.demote_f64 (i32.const 0)))) "type mismatch")
   493  (assert_invalid (module (func (result f32) (f32.reinterpret_i32 (i64.const 0)))) "type mismatch")
   494  (assert_invalid (module (func (result f64) (f64.convert_i32_s (i64.const 0)))) "type mismatch")
   495  (assert_invalid (module (func (result f64) (f64.convert_i32_u (i64.const 0)))) "type mismatch")
   496  (assert_invalid (module (func (result f64) (f64.convert_i64_s (i32.const 0)))) "type mismatch")
   497  (assert_invalid (module (func (result f64) (f64.convert_i64_u (i32.const 0)))) "type mismatch")
   498  (assert_invalid (module (func (result f64) (f64.promote_f32 (i32.const 0)))) "type mismatch")
   499  (assert_invalid (module (func (result f64) (f64.reinterpret_i64 (i32.const 0)))) "type mismatch")