|
16 | 16 | (i16x8.narrow_i32x4_s (local.get 0) (local.get 1)))
|
17 | 17 | (func (export "i16x8.narrow_i32x4_u") (param v128 v128) (result v128)
|
18 | 18 | (i16x8.narrow_i32x4_u (local.get 0)(local.get 1)))
|
| 19 | + |
| 20 | + ;; Float to float promote/demote |
| 21 | + (func (export "f64x2.promote_low_f32x4") (param v128) (result v128) |
| 22 | + (f64x2.promote_low_f32x4 (local.get 0))) |
| 23 | + (func (export "f32x4.demote_f64x2_zero") (param v128) (result v128) |
| 24 | + (f32x4.demote_f64x2_zero (local.get 0))) |
19 | 25 | )
|
20 | 26 |
|
| 27 | +;; f64x2.promote_low_f32x4 |
| 28 | +;; Float constants copied from test/core/conversions.wast. |
| 29 | + |
| 30 | +(assert_return (invoke "f64x2.promote_low_f32x4" (v128.const f32x4 0.0 0.0 0.0 0.0)) |
| 31 | + (v128.const f64x2 0.0 0.0)) |
| 32 | +(assert_return (invoke "f64x2.promote_low_f32x4" (v128.const f32x4 -0.0 -0.0 -0.0 -0.0)) |
| 33 | + (v128.const f64x2 -0.0 -0.0)) |
| 34 | +(assert_return (invoke "f64x2.promote_low_f32x4" (v128.const f32x4 0x1p-149 0x1p-149 0x1p-149 0x1p-149)) |
| 35 | + (v128.const f64x2 0x1p-149 0x1p-149)) |
| 36 | +(assert_return (invoke "f64x2.promote_low_f32x4" (v128.const f32x4 -0x1p-149 -0x1p-149 -0x1p-149 -0x1p-149)) |
| 37 | + (v128.const f64x2 -0x1p-149 -0x1p-149)) |
| 38 | +(assert_return (invoke "f64x2.promote_low_f32x4" (v128.const f32x4 1.0 1.0 1.0 1.0)) |
| 39 | + (v128.const f64x2 1.0 1.0)) |
| 40 | +(assert_return (invoke "f64x2.promote_low_f32x4" (v128.const f32x4 -1.0 -1.0 -1.0 -1.0)) |
| 41 | + (v128.const f64x2 -1.0 -1.0)) |
| 42 | +(assert_return (invoke "f64x2.promote_low_f32x4" (v128.const f32x4 -0x1.fffffep+127 -0x1.fffffep+127 -0x1.fffffep+127 -0x1.fffffep+127)) |
| 43 | + (v128.const f64x2 -0x1.fffffep+127 -0x1.fffffep+127)) |
| 44 | +(assert_return (invoke "f64x2.promote_low_f32x4" (v128.const f32x4 0x1.fffffep+127 0x1.fffffep+127 0x1.fffffep+127 0x1.fffffep+127)) |
| 45 | + (v128.const f64x2 0x1.fffffep+127 0x1.fffffep+127)) |
| 46 | +;; Generated randomly by picking a random int and reinterpret it to float. |
| 47 | +(assert_return (invoke "f64x2.promote_low_f32x4" (v128.const f32x4 0x1p-119 0x1p-119 0x1p-119 0x1p-119)) |
| 48 | + (v128.const f64x2 0x1p-119 0x1p-119)) |
| 49 | +;; Generated randomly by picking a random float. |
| 50 | +(assert_return (invoke "f64x2.promote_low_f32x4" (v128.const f32x4 0x1.8f867ep+125 0x1.8f867ep+125 0x1.8f867ep+125 0x1.8f867ep+125)) |
| 51 | + (v128.const f64x2 6.6382536710104395e+37 6.6382536710104395e+37)) |
| 52 | +(assert_return (invoke "f64x2.promote_low_f32x4" (v128.const f32x4 inf inf inf inf)) |
| 53 | + (v128.const f64x2 inf inf)) |
| 54 | +(assert_return (invoke "f64x2.promote_low_f32x4" (v128.const f32x4 -inf -inf -inf -inf)) |
| 55 | + (v128.const f64x2 -inf -inf)) |
| 56 | +(assert_return (invoke "f64x2.promote_low_f32x4" (v128.const f32x4 nan nan nan nan)) |
| 57 | + (v128.const f64x2 nan:canonical nan:canonical)) |
| 58 | +(assert_return (invoke "f64x2.promote_low_f32x4" (v128.const f32x4 nan:0x200000 nan:0x200000 nan:0x200000 nan:0x200000)) |
| 59 | + (v128.const f64x2 nan:arithmetic nan:arithmetic)) |
| 60 | +(assert_return (invoke "f64x2.promote_low_f32x4" (v128.const f32x4 -nan -nan -nan -nan)) |
| 61 | + (v128.const f64x2 nan:canonical nan:canonical)) |
| 62 | +(assert_return (invoke "f64x2.promote_low_f32x4" (v128.const f32x4 -nan:0x200000 -nan:0x200000 -nan:0x200000 -nan:0x200000)) |
| 63 | + (v128.const f64x2 nan:arithmetic nan:arithmetic)) |
| 64 | + |
| 65 | +;; f32x4.demote_f64x2_zero |
| 66 | +;; Float constants copied from test/core/conversions.wast. |
| 67 | + |
| 68 | +(assert_return (invoke "f32x4.demote_f64x2_zero" (v128.const f64x2 0.0 0.0)) |
| 69 | + (v128.const f32x4 0.0 0.0 0 0)) |
| 70 | +(assert_return (invoke "f32x4.demote_f64x2_zero" (v128.const f64x2 -0.0 -0.0)) |
| 71 | + (v128.const f32x4 -0.0 -0.0 0 0)) |
| 72 | +(assert_return (invoke "f32x4.demote_f64x2_zero" (v128.const f64x2 0x0.0000000000001p-1022 0x0.0000000000001p-1022)) |
| 73 | + (v128.const f32x4 0.0 0.0 0 0)) |
| 74 | +(assert_return (invoke "f32x4.demote_f64x2_zero" (v128.const f64x2 -0x0.0000000000001p-1022 -0x0.0000000000001p-1022)) |
| 75 | + (v128.const f32x4 -0.0 -0.0 0 0)) |
| 76 | +(assert_return (invoke "f32x4.demote_f64x2_zero" (v128.const f64x2 1.0 1.0)) |
| 77 | + (v128.const f32x4 1.0 1.0 0 0)) |
| 78 | +(assert_return (invoke "f32x4.demote_f64x2_zero" (v128.const f64x2 -1.0 -1.0)) |
| 79 | + (v128.const f32x4 -1.0 -1.0 0 0)) |
| 80 | +(assert_return (invoke "f32x4.demote_f64x2_zero" (v128.const f64x2 0x1.fffffe0000000p-127 0x1.fffffe0000000p-127)) |
| 81 | + (v128.const f32x4 0x1p-126 0x1p-126 0 0)) |
| 82 | +(assert_return (invoke "f32x4.demote_f64x2_zero" (v128.const f64x2 -0x1.fffffe0000000p-127 -0x1.fffffe0000000p-127)) |
| 83 | + (v128.const f32x4 -0x1p-126 -0x1p-126 0 0)) |
| 84 | +(assert_return (invoke "f32x4.demote_f64x2_zero" (v128.const f64x2 0x1.fffffdfffffffp-127 0x1.fffffdfffffffp-127)) |
| 85 | + (v128.const f32x4 0x1.fffffcp-127 0x1.fffffcp-127 0 0)) |
| 86 | +(assert_return (invoke "f32x4.demote_f64x2_zero" (v128.const f64x2 -0x1.fffffdfffffffp-127 -0x1.fffffdfffffffp-127)) |
| 87 | + (v128.const f32x4 -0x1.fffffcp-127 -0x1.fffffcp-127 0 0)) |
| 88 | +(assert_return (invoke "f32x4.demote_f64x2_zero" (v128.const f64x2 0x1p-149 0x1p-149)) |
| 89 | + (v128.const f32x4 0x1p-149 0x1p-149 0 0)) |
| 90 | +(assert_return (invoke "f32x4.demote_f64x2_zero" (v128.const f64x2 -0x1p-149 -0x1p-149)) |
| 91 | + (v128.const f32x4 -0x1p-149 -0x1p-149 0 0)) |
| 92 | +(assert_return (invoke "f32x4.demote_f64x2_zero" (v128.const f64x2 0x1.fffffd0000000p+127 0x1.fffffd0000000p+127)) |
| 93 | + (v128.const f32x4 0x1.fffffcp+127 0x1.fffffcp+127 0 0)) |
| 94 | +(assert_return (invoke "f32x4.demote_f64x2_zero" (v128.const f64x2 -0x1.fffffd0000000p+127 -0x1.fffffd0000000p+127)) |
| 95 | + (v128.const f32x4 -0x1.fffffcp+127 -0x1.fffffcp+127 0 0)) |
| 96 | +(assert_return (invoke "f32x4.demote_f64x2_zero" (v128.const f64x2 0x1.fffffd0000001p+127 0x1.fffffd0000001p+127)) |
| 97 | + (v128.const f32x4 0x1.fffffep+127 0x1.fffffep+127 0 0)) |
| 98 | +(assert_return (invoke "f32x4.demote_f64x2_zero" (v128.const f64x2 -0x1.fffffd0000001p+127 -0x1.fffffd0000001p+127)) |
| 99 | + (v128.const f32x4 -0x1.fffffep+127 -0x1.fffffep+127 0 0)) |
| 100 | +(assert_return (invoke "f32x4.demote_f64x2_zero" (v128.const f64x2 0x1.fffffep+127 0x1.fffffep+127)) |
| 101 | + (v128.const f32x4 0x1.fffffep+127 0x1.fffffep+127 0 0)) |
| 102 | +(assert_return (invoke "f32x4.demote_f64x2_zero" (v128.const f64x2 -0x1.fffffep+127 -0x1.fffffep+127)) |
| 103 | + (v128.const f32x4 -0x1.fffffep+127 -0x1.fffffep+127 0 0)) |
| 104 | +(assert_return (invoke "f32x4.demote_f64x2_zero" (v128.const f64x2 0x1.fffffefffffffp+127 0x1.fffffefffffffp+127)) |
| 105 | + (v128.const f32x4 0x1.fffffep+127 0x1.fffffep+127 0 0)) |
| 106 | +(assert_return (invoke "f32x4.demote_f64x2_zero" (v128.const f64x2 -0x1.fffffefffffffp+127 -0x1.fffffefffffffp+127)) |
| 107 | + (v128.const f32x4 -0x1.fffffep+127 -0x1.fffffep+127 0 0)) |
| 108 | +(assert_return (invoke "f32x4.demote_f64x2_zero" (v128.const f64x2 0x1.ffffffp+127 0x1.ffffffp+127)) |
| 109 | + (v128.const f32x4 inf inf 0 0)) |
| 110 | +(assert_return (invoke "f32x4.demote_f64x2_zero" (v128.const f64x2 -0x1.ffffffp+127 -0x1.ffffffp+127)) |
| 111 | + (v128.const f32x4 -inf -inf 0 0)) |
| 112 | +(assert_return (invoke "f32x4.demote_f64x2_zero" (v128.const f64x2 0x1p-119 0x1p-119)) |
| 113 | + (v128.const f32x4 0x1p-119 0x1p-119 0 0)) |
| 114 | +(assert_return (invoke "f32x4.demote_f64x2_zero" (v128.const f64x2 0x1.8f867ep+125 0x1.8f867ep+125)) |
| 115 | + (v128.const f32x4 0x1.8f867ep+125 0x1.8f867ep+125 0 0)) |
| 116 | +(assert_return (invoke "f32x4.demote_f64x2_zero" (v128.const f64x2 inf inf)) |
| 117 | + (v128.const f32x4 inf inf 0 0)) |
| 118 | +(assert_return (invoke "f32x4.demote_f64x2_zero" (v128.const f64x2 -inf -inf)) |
| 119 | + (v128.const f32x4 -inf -inf 0 0)) |
| 120 | +(assert_return (invoke "f32x4.demote_f64x2_zero" (v128.const f64x2 0x1.0000000000001p+0 0x1.0000000000001p+0)) |
| 121 | + (v128.const f32x4 1.0 1.0 0 0)) |
| 122 | +(assert_return (invoke "f32x4.demote_f64x2_zero" (v128.const f64x2 0x1.fffffffffffffp-1 0x1.fffffffffffffp-1)) |
| 123 | + (v128.const f32x4 1.0 1.0 0 0)) |
| 124 | +(assert_return (invoke "f32x4.demote_f64x2_zero" (v128.const f64x2 0x1.0000010000000p+0 0x1.0000010000000p+0)) |
| 125 | + (v128.const f32x4 0x1.000000p+0 0x1.000000p+0 0 0)) |
| 126 | +(assert_return (invoke "f32x4.demote_f64x2_zero" (v128.const f64x2 0x1.0000010000001p+0 0x1.0000010000001p+0)) |
| 127 | + (v128.const f32x4 0x1.000002p+0 0x1.000002p+0 0 0)) |
| 128 | +(assert_return (invoke "f32x4.demote_f64x2_zero" (v128.const f64x2 0x1.000002fffffffp+0 0x1.000002fffffffp+0)) |
| 129 | + (v128.const f32x4 0x1.000002p+0 0x1.000002p+0 0 0)) |
| 130 | +(assert_return (invoke "f32x4.demote_f64x2_zero" (v128.const f64x2 0x1.0000030000000p+0 0x1.0000030000000p+0)) |
| 131 | + (v128.const f32x4 0x1.000004p+0 0x1.000004p+0 0 0)) |
| 132 | +(assert_return (invoke "f32x4.demote_f64x2_zero" (v128.const f64x2 0x1.0000050000000p+0 0x1.0000050000000p+0)) |
| 133 | + (v128.const f32x4 0x1.000004p+0 0x1.000004p+0 0 0)) |
| 134 | +(assert_return (invoke "f32x4.demote_f64x2_zero" (v128.const f64x2 0x1.0000010000000p+24 0x1.0000010000000p+24)) |
| 135 | + (v128.const f32x4 0x1.0p+24 0x1.0p+24 0 0)) |
| 136 | +(assert_return (invoke "f32x4.demote_f64x2_zero" (v128.const f64x2 0x1.0000010000001p+24 0x1.0000010000001p+24)) |
| 137 | + (v128.const f32x4 0x1.000002p+24 0x1.000002p+24 0 0)) |
| 138 | +(assert_return (invoke "f32x4.demote_f64x2_zero" (v128.const f64x2 0x1.000002fffffffp+24 0x1.000002fffffffp+24)) |
| 139 | + (v128.const f32x4 0x1.000002p+24 0x1.000002p+24 0 0)) |
| 140 | +(assert_return (invoke "f32x4.demote_f64x2_zero" (v128.const f64x2 0x1.0000030000000p+24 0x1.0000030000000p+24)) |
| 141 | + (v128.const f32x4 0x1.000004p+24 0x1.000004p+24 0 0)) |
| 142 | +(assert_return (invoke "f32x4.demote_f64x2_zero" (v128.const f64x2 0x1.4eae4f7024c7p+108 0x1.4eae4f7024c7p+108)) |
| 143 | + (v128.const f32x4 0x1.4eae5p+108 0x1.4eae5p+108 0 0)) |
| 144 | +(assert_return (invoke "f32x4.demote_f64x2_zero" (v128.const f64x2 0x1.a12e71e358685p-113 0x1.a12e71e358685p-113)) |
| 145 | + (v128.const f32x4 0x1.a12e72p-113 0x1.a12e72p-113 0 0)) |
| 146 | +(assert_return (invoke "f32x4.demote_f64x2_zero" (v128.const f64x2 0x1.cb98354d521ffp-127 0x1.cb98354d521ffp-127)) |
| 147 | + (v128.const f32x4 0x1.cb9834p-127 0x1.cb9834p-127 0 0)) |
| 148 | +(assert_return (invoke "f32x4.demote_f64x2_zero" (v128.const f64x2 -0x1.6972b30cfb562p+1 -0x1.6972b30cfb562p+1)) |
| 149 | + (v128.const f32x4 -0x1.6972b4p+1 -0x1.6972b4p+1 0 0)) |
| 150 | +(assert_return (invoke "f32x4.demote_f64x2_zero" (v128.const f64x2 -0x1.bedbe4819d4c4p+112 -0x1.bedbe4819d4c4p+112)) |
| 151 | + (v128.const f32x4 -0x1.bedbe4p+112 -0x1.bedbe4p+112 0 0)) |
| 152 | +(assert_return (invoke "f32x4.demote_f64x2_zero" (v128.const f64x2 nan nan)) |
| 153 | + (v128.const f32x4 nan:canonical nan:canonical 0 0)) |
| 154 | +(assert_return (invoke "f32x4.demote_f64x2_zero" (v128.const f64x2 nan:0x4000000000000 nan:0x4000000000000)) |
| 155 | + (v128.const f32x4 nan:arithmetic nan:arithmetic 0 0)) |
| 156 | +(assert_return (invoke "f32x4.demote_f64x2_zero" (v128.const f64x2 -nan -nan)) |
| 157 | + (v128.const f32x4 nan:canonical nan:canonical 0 0)) |
| 158 | +(assert_return (invoke "f32x4.demote_f64x2_zero" (v128.const f64x2 -nan:0x4000000000000 -nan:0x4000000000000)) |
| 159 | + (v128.const f32x4 nan:arithmetic nan:arithmetic 0 0)) |
| 160 | +(assert_return (invoke "f32x4.demote_f64x2_zero" (v128.const f64x2 0x1p-1022 0x1p-1022)) |
| 161 | + (v128.const f32x4 0.0 0.0 0 0)) |
| 162 | +(assert_return (invoke "f32x4.demote_f64x2_zero" (v128.const f64x2 -0x1p-1022 -0x1p-1022)) |
| 163 | + (v128.const f32x4 -0.0 -0.0 0 0)) |
| 164 | +(assert_return (invoke "f32x4.demote_f64x2_zero" (v128.const f64x2 0x1.0p-150 0x1.0p-150)) |
| 165 | + (v128.const f32x4 0.0 0.0 0 0)) |
| 166 | +(assert_return (invoke "f32x4.demote_f64x2_zero" (v128.const f64x2 -0x1.0p-150 -0x1.0p-150)) |
| 167 | + (v128.const f32x4 -0.0 -0.0 0 0)) |
| 168 | +(assert_return (invoke "f32x4.demote_f64x2_zero" (v128.const f64x2 0x1.0000000000001p-150 0x1.0000000000001p-150)) |
| 169 | + (v128.const f32x4 0x1p-149 0x1p-149 0 0)) |
| 170 | +(assert_return (invoke "f32x4.demote_f64x2_zero" (v128.const f64x2 -0x1.0000000000001p-150 -0x1.0000000000001p-150)) |
| 171 | + (v128.const f32x4 -0x1p-149 -0x1p-149 0 0)) |
| 172 | + |
21 | 173 |
|
22 | 174 | ;; Integer to floating point
|
23 | 175 | ;; f32x4.convert_i32x4_s
|
|
0 commit comments