OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 (function(global, utils) { | 5 (function(global, utils) { |
6 | 6 |
7 "use strict"; | 7 "use strict"; |
8 | 8 |
9 %CheckIsBootstrapping(); | 9 %CheckIsBootstrapping(); |
10 | 10 |
11 // ------------------------------------------------------------------- | 11 // ------------------------------------------------------------------- |
12 // Imports | 12 // Imports |
13 | 13 |
14 var GlobalSIMD = global.SIMD; | 14 var GlobalSIMD = global.SIMD; |
15 | 15 |
16 macro SIMD_FLOAT_TYPES(FUNCTION) | 16 macro SIMD_FLOAT_TYPES(FUNCTION) |
17 FUNCTION(Float32x4, float32x4, 4) | 17 FUNCTION(Float32x4, float32x4, 4) |
18 endmacro | 18 endmacro |
19 | 19 |
20 macro SIMD_INT_TYPES(FUNCTION) | 20 macro SIMD_INT_TYPES(FUNCTION) |
21 FUNCTION(Int32x4, int32x4, 4) | 21 FUNCTION(Int32x4, int32x4, 4) |
22 FUNCTION(Int16x8, int16x8, 8) | 22 FUNCTION(Int16x8, int16x8, 8) |
23 FUNCTION(Int8x16, int8x16, 16) | 23 FUNCTION(Int8x16, int8x16, 16) |
24 endmacro | 24 endmacro |
25 | 25 |
| 26 macro SIMD_UINT_TYPES(FUNCTION) |
| 27 FUNCTION(Uint32x4, uint32x4, 4) |
| 28 FUNCTION(Uint16x8, uint16x8, 8) |
| 29 FUNCTION(Uint8x16, uint8x16, 16) |
| 30 endmacro |
| 31 |
26 macro SIMD_BOOL_TYPES(FUNCTION) | 32 macro SIMD_BOOL_TYPES(FUNCTION) |
27 FUNCTION(Bool32x4, bool32x4, 4) | 33 FUNCTION(Bool32x4, bool32x4, 4) |
28 FUNCTION(Bool16x8, bool16x8, 8) | 34 FUNCTION(Bool16x8, bool16x8, 8) |
29 FUNCTION(Bool8x16, bool8x16, 16) | 35 FUNCTION(Bool8x16, bool8x16, 16) |
30 endmacro | 36 endmacro |
31 | 37 |
32 macro SIMD_ALL_TYPES(FUNCTION) | 38 macro SIMD_ALL_TYPES(FUNCTION) |
33 SIMD_FLOAT_TYPES(FUNCTION) | 39 SIMD_FLOAT_TYPES(FUNCTION) |
34 SIMD_INT_TYPES(FUNCTION) | 40 SIMD_INT_TYPES(FUNCTION) |
| 41 SIMD_UINT_TYPES(FUNCTION) |
35 SIMD_BOOL_TYPES(FUNCTION) | 42 SIMD_BOOL_TYPES(FUNCTION) |
36 endmacro | 43 endmacro |
37 | 44 |
38 macro DECLARE_GLOBALS(NAME, TYPE, LANES) | 45 macro DECLARE_GLOBALS(NAME, TYPE, LANES) |
39 var GlobalNAME = GlobalSIMD.NAME; | 46 var GlobalNAME = GlobalSIMD.NAME; |
40 endmacro | 47 endmacro |
41 | 48 |
42 SIMD_ALL_TYPES(DECLARE_GLOBALS) | 49 SIMD_ALL_TYPES(DECLARE_GLOBALS) |
43 | 50 |
44 macro DECLARE_COMMON_FUNCTIONS(NAME, TYPE, LANES) | 51 macro DECLARE_COMMON_FUNCTIONS(NAME, TYPE, LANES) |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 if (typeof(this) !== 'TYPE' && %_ClassOf(this) !== 'NAME') { | 85 if (typeof(this) !== 'TYPE' && %_ClassOf(this) !== 'NAME') { |
79 throw MakeTypeError(kIncompatibleMethodReceiver, | 86 throw MakeTypeError(kIncompatibleMethodReceiver, |
80 "NAME.prototype.valueOf", this); | 87 "NAME.prototype.valueOf", this); |
81 } | 88 } |
82 return %_ValueOf(this); | 89 return %_ValueOf(this); |
83 } | 90 } |
84 | 91 |
85 function NAMEExtractLaneJS(instance, lane) { | 92 function NAMEExtractLaneJS(instance, lane) { |
86 return %NAMEExtractLane(instance, lane); | 93 return %NAMEExtractLane(instance, lane); |
87 } | 94 } |
88 | |
89 function NAMEEqualJS(a, b) { | |
90 return %NAMEEqual(a, b); | |
91 } | |
92 | |
93 function NAMENotEqualJS(a, b) { | |
94 return %NAMENotEqual(a, b); | |
95 } | |
96 endmacro | 95 endmacro |
97 | 96 |
98 SIMD_ALL_TYPES(DECLARE_COMMON_FUNCTIONS) | 97 SIMD_ALL_TYPES(DECLARE_COMMON_FUNCTIONS) |
99 | 98 |
100 macro DECLARE_INT_FUNCTIONS(NAME, TYPE, LANES) | 99 macro DECLARE_INT_FUNCTIONS(NAME, TYPE, LANES) |
101 function NAMEShiftLeftByScalarJS(instance, shift) { | 100 function NAMEShiftLeftByScalarJS(instance, shift) { |
102 return %NAMEShiftLeftByScalar(instance, shift); | 101 return %NAMEShiftLeftByScalar(instance, shift); |
103 } | 102 } |
| 103 |
| 104 function NAMEShiftRightArithmeticByScalarJS(instance, shift) { |
| 105 return %NAMEShiftRightArithmeticByScalar(instance, shift); |
| 106 } |
| 107 endmacro |
| 108 |
| 109 SIMD_INT_TYPES(DECLARE_INT_FUNCTIONS) |
| 110 |
| 111 macro DECLARE_UINT_FUNCTIONS(NAME, TYPE, LANES) |
| 112 function NAMEShiftLeftByScalarJS(instance, shift) { |
| 113 return %NAMEShiftLeftByScalar(instance, shift); |
| 114 } |
104 | 115 |
105 function NAMEShiftRightLogicalByScalarJS(instance, shift) { | 116 function NAMEShiftRightLogicalByScalarJS(instance, shift) { |
106 return %NAMEShiftRightLogicalByScalar(instance, shift); | 117 return %NAMEShiftRightLogicalByScalar(instance, shift); |
107 } | 118 } |
108 | 119 |
109 function NAMEShiftRightArithmeticByScalarJS(instance, shift) { | 120 function NAMEHorizontalSumJS(instance) { |
110 return %NAMEShiftRightArithmeticByScalar(instance, shift); | 121 return %NAMEHorizontalSum(instance); |
111 } | 122 } |
112 endmacro | 123 endmacro |
113 | 124 |
114 SIMD_INT_TYPES(DECLARE_INT_FUNCTIONS) | 125 SIMD_UINT_TYPES(DECLARE_UINT_FUNCTIONS) |
| 126 |
| 127 macro SIMD_SMALL_INT_TYPES(FUNCTION) |
| 128 FUNCTION(Int16x8) |
| 129 FUNCTION(Int8x16) |
| 130 FUNCTION(Uint8x16) |
| 131 FUNCTION(Uint16x8) |
| 132 endmacro |
| 133 |
| 134 macro DECLARE_SMALL_INT_FUNCTIONS(NAME) |
| 135 function NAMEAddSaturateJS(a, b) { |
| 136 return %NAMEAddSaturate(a, b); |
| 137 } |
| 138 |
| 139 function NAMESubSaturateJS(a, b) { |
| 140 return %NAMESubSaturate(a, b); |
| 141 } |
| 142 endmacro |
| 143 |
| 144 SIMD_SMALL_INT_TYPES(DECLARE_SMALL_INT_FUNCTIONS) |
| 145 |
| 146 macro SIMD_SMALL_UINT_TYPES(FUNCTION) |
| 147 FUNCTION(Uint8x16) |
| 148 FUNCTION(Uint16x8) |
| 149 endmacro |
| 150 |
| 151 macro DECLARE_SMALL_UINT_FUNCTIONS(NAME) |
| 152 function NAMEAbsoluteDifferenceJS(a, b) { |
| 153 return %NAMEAbsoluteDifference(a, b); |
| 154 } |
| 155 |
| 156 function NAMEWidenedAbsoluteDifferenceJS(a, b) { |
| 157 return %NAMEWidenedAbsoluteDifference(a, b); |
| 158 } |
| 159 endmacro |
| 160 |
| 161 SIMD_SMALL_UINT_TYPES(DECLARE_SMALL_UINT_FUNCTIONS) |
| 162 |
| 163 macro DECLARE_SIGNED_FUNCTIONS(NAME, TYPE, LANES) |
| 164 function NAMENegJS(a) { |
| 165 return %NAMENeg(a); |
| 166 } |
| 167 endmacro |
| 168 |
| 169 SIMD_FLOAT_TYPES(DECLARE_SIGNED_FUNCTIONS) |
| 170 SIMD_INT_TYPES(DECLARE_SIGNED_FUNCTIONS) |
115 | 171 |
116 macro DECLARE_BOOL_FUNCTIONS(NAME, TYPE, LANES) | 172 macro DECLARE_BOOL_FUNCTIONS(NAME, TYPE, LANES) |
117 function NAMEReplaceLaneJS(instance, lane, value) { | 173 function NAMEReplaceLaneJS(instance, lane, value) { |
118 return %NAMEReplaceLane(instance, lane, value); | 174 return %NAMEReplaceLane(instance, lane, value); |
119 } | 175 } |
120 | 176 |
121 function NAMEAnyTrueJS(s) { | 177 function NAMEAnyTrueJS(s) { |
122 return %NAMEAnyTrue(s); | 178 return %NAMEAnyTrue(s); |
123 } | 179 } |
124 | 180 |
125 function NAMEAllTrueJS(s) { | 181 function NAMEAllTrueJS(s) { |
126 return %NAMEAllTrue(s); | 182 return %NAMEAllTrue(s); |
127 } | 183 } |
128 endmacro | 184 endmacro |
129 | 185 |
130 SIMD_BOOL_TYPES(DECLARE_BOOL_FUNCTIONS) | 186 SIMD_BOOL_TYPES(DECLARE_BOOL_FUNCTIONS) |
131 | 187 |
132 macro SIMD_UNSIGNED_INT_TYPES(FUNCTION) | |
133 FUNCTION(Int16x8) | |
134 FUNCTION(Int8x16) | |
135 endmacro | |
136 | |
137 macro DECLARE_UNSIGNED_INT_FUNCTIONS(NAME) | |
138 function NAMEUnsignedExtractLaneJS(instance, lane) { | |
139 return %NAMEUnsignedExtractLane(instance, lane); | |
140 } | |
141 endmacro | |
142 | |
143 SIMD_UNSIGNED_INT_TYPES(DECLARE_UNSIGNED_INT_FUNCTIONS) | |
144 | |
145 macro SIMD_NUMERIC_TYPES(FUNCTION) | 188 macro SIMD_NUMERIC_TYPES(FUNCTION) |
146 SIMD_FLOAT_TYPES(FUNCTION) | 189 SIMD_FLOAT_TYPES(FUNCTION) |
147 SIMD_INT_TYPES(FUNCTION) | 190 SIMD_INT_TYPES(FUNCTION) |
| 191 SIMD_UINT_TYPES(FUNCTION) |
148 endmacro | 192 endmacro |
149 | 193 |
150 macro DECLARE_NUMERIC_FUNCTIONS(NAME, TYPE, LANES) | 194 macro DECLARE_NUMERIC_FUNCTIONS(NAME, TYPE, LANES) |
151 function NAMEReplaceLaneJS(instance, lane, value) { | 195 function NAMEReplaceLaneJS(instance, lane, value) { |
152 return %NAMEReplaceLane(instance, lane, TO_NUMBER_INLINE(value)); | 196 return %NAMEReplaceLane(instance, lane, TO_NUMBER_INLINE(value)); |
153 } | 197 } |
154 | 198 |
155 function NAMESelectJS(selector, a, b) { | 199 function NAMESelectJS(selector, a, b) { |
156 return %NAMESelect(selector, a, b); | 200 return %NAMESelect(selector, a, b); |
157 } | 201 } |
158 | 202 |
159 function NAMENegJS(a) { | |
160 return %NAMENeg(a); | |
161 } | |
162 | |
163 function NAMEAddJS(a, b) { | 203 function NAMEAddJS(a, b) { |
164 return %NAMEAdd(a, b); | 204 return %NAMEAdd(a, b); |
165 } | 205 } |
166 | 206 |
167 function NAMESubJS(a, b) { | 207 function NAMESubJS(a, b) { |
168 return %NAMESub(a, b); | 208 return %NAMESub(a, b); |
169 } | 209 } |
170 | 210 |
171 function NAMEMulJS(a, b) { | 211 function NAMEMulJS(a, b) { |
172 return %NAMEMul(a, b); | 212 return %NAMEMul(a, b); |
173 } | 213 } |
174 | 214 |
175 function NAMEMinJS(a, b) { | 215 function NAMEMinJS(a, b) { |
176 return %NAMEMin(a, b); | 216 return %NAMEMin(a, b); |
177 } | 217 } |
178 | 218 |
179 function NAMEMaxJS(a, b) { | 219 function NAMEMaxJS(a, b) { |
180 return %NAMEMax(a, b); | 220 return %NAMEMax(a, b); |
181 } | 221 } |
182 | 222 |
| 223 function NAMEEqualJS(a, b) { |
| 224 return %NAMEEqual(a, b); |
| 225 } |
| 226 |
| 227 function NAMENotEqualJS(a, b) { |
| 228 return %NAMENotEqual(a, b); |
| 229 } |
| 230 |
183 function NAMELessThanJS(a, b) { | 231 function NAMELessThanJS(a, b) { |
184 return %NAMELessThan(a, b); | 232 return %NAMELessThan(a, b); |
185 } | 233 } |
186 | 234 |
187 function NAMELessThanOrEqualJS(a, b) { | 235 function NAMELessThanOrEqualJS(a, b) { |
188 return %NAMELessThanOrEqual(a, b); | 236 return %NAMELessThanOrEqual(a, b); |
189 } | 237 } |
190 | 238 |
191 function NAMEGreaterThanJS(a, b) { | 239 function NAMEGreaterThanJS(a, b) { |
192 return %NAMEGreaterThan(a, b); | 240 return %NAMEGreaterThan(a, b); |
193 } | 241 } |
194 | 242 |
195 function NAMEGreaterThanOrEqualJS(a, b) { | 243 function NAMEGreaterThanOrEqualJS(a, b) { |
196 return %NAMEGreaterThanOrEqual(a, b); | 244 return %NAMEGreaterThanOrEqual(a, b); |
197 } | 245 } |
198 endmacro | 246 endmacro |
199 | 247 |
200 SIMD_NUMERIC_TYPES(DECLARE_NUMERIC_FUNCTIONS) | 248 SIMD_NUMERIC_TYPES(DECLARE_NUMERIC_FUNCTIONS) |
201 | 249 |
202 macro SIMD_LOGICAL_TYPES(FUNCTION) | 250 macro SIMD_LOGICAL_TYPES(FUNCTION) |
203 SIMD_INT_TYPES(FUNCTION) | 251 SIMD_INT_TYPES(FUNCTION) |
| 252 SIMD_UINT_TYPES(FUNCTION) |
204 SIMD_BOOL_TYPES(FUNCTION) | 253 SIMD_BOOL_TYPES(FUNCTION) |
205 endmacro | 254 endmacro |
206 | 255 |
207 macro DECLARE_LOGICAL_FUNCTIONS(NAME, TYPE, LANES) | 256 macro DECLARE_LOGICAL_FUNCTIONS(NAME, TYPE, LANES) |
208 function NAMEAndJS(a, b) { | 257 function NAMEAndJS(a, b) { |
209 return %NAMEAnd(a, b); | 258 return %NAMEAnd(a, b); |
210 } | 259 } |
211 | 260 |
212 function NAMEOrJS(a, b) { | 261 function NAMEOrJS(a, b) { |
213 return %NAMEOr(a, b); | 262 return %NAMEOr(a, b); |
214 } | 263 } |
215 | 264 |
216 function NAMEXorJS(a, b) { | 265 function NAMEXorJS(a, b) { |
217 return %NAMEXor(a, b); | 266 return %NAMEXor(a, b); |
218 } | 267 } |
219 | 268 |
220 function NAMENotJS(a) { | 269 function NAMENotJS(a) { |
221 return %NAMENot(a); | 270 return %NAMENot(a); |
222 } | 271 } |
223 endmacro | 272 endmacro |
224 | 273 |
225 SIMD_LOGICAL_TYPES(DECLARE_LOGICAL_FUNCTIONS) | 274 SIMD_LOGICAL_TYPES(DECLARE_LOGICAL_FUNCTIONS) |
226 | 275 |
227 macro SIMD_FROM_TYPES(FUNCTION) | 276 macro SIMD_FROM_TYPES(FUNCTION) |
228 FUNCTION(Float32x4, Int32x4) | 277 FUNCTION(Float32x4, Int32x4) |
| 278 FUNCTION(Float32x4, Uint32x4) |
229 FUNCTION(Int32x4, Float32x4) | 279 FUNCTION(Int32x4, Float32x4) |
| 280 FUNCTION(Int32x4, Uint32x4) |
| 281 FUNCTION(Uint32x4, Float32x4) |
| 282 FUNCTION(Uint32x4, Int32x4) |
| 283 FUNCTION(Int16x8, Uint16x8) |
| 284 FUNCTION(Uint16x8, Int16x8) |
| 285 FUNCTION(Int8x16, Uint8x16) |
| 286 FUNCTION(Uint8x16, Int8x16) |
230 endmacro | 287 endmacro |
231 | 288 |
232 macro DECLARE_FROM_FUNCTIONS(TO, FROM) | 289 macro DECLARE_FROM_FUNCTIONS(TO, FROM) |
233 function TOFromFROMJS(a) { | 290 function TOFromFROMJS(a) { |
234 return %TOFromFROM(a); | 291 return %TOFromFROM(a); |
235 } | 292 } |
236 endmacro | 293 endmacro |
237 | 294 |
238 SIMD_FROM_TYPES(DECLARE_FROM_FUNCTIONS) | 295 SIMD_FROM_TYPES(DECLARE_FROM_FUNCTIONS) |
239 | 296 |
240 macro SIMD_FROM_BITS_TYPES(FUNCTION) | 297 macro SIMD_FROM_BITS_TYPES(FUNCTION) |
241 FUNCTION(Float32x4, Int32x4) | 298 FUNCTION(Float32x4, Int32x4) |
| 299 FUNCTION(Float32x4, Uint32x4) |
242 FUNCTION(Float32x4, Int16x8) | 300 FUNCTION(Float32x4, Int16x8) |
| 301 FUNCTION(Float32x4, Uint16x8) |
243 FUNCTION(Float32x4, Int8x16) | 302 FUNCTION(Float32x4, Int8x16) |
| 303 FUNCTION(Float32x4, Uint8x16) |
244 FUNCTION(Int32x4, Float32x4) | 304 FUNCTION(Int32x4, Float32x4) |
| 305 FUNCTION(Int32x4, Uint32x4) |
245 FUNCTION(Int32x4, Int16x8) | 306 FUNCTION(Int32x4, Int16x8) |
| 307 FUNCTION(Int32x4, Uint16x8) |
246 FUNCTION(Int32x4, Int8x16) | 308 FUNCTION(Int32x4, Int8x16) |
| 309 FUNCTION(Int32x4, Uint8x16) |
| 310 FUNCTION(Uint32x4, Float32x4) |
| 311 FUNCTION(Uint32x4, Int32x4) |
| 312 FUNCTION(Uint32x4, Int16x8) |
| 313 FUNCTION(Uint32x4, Uint16x8) |
| 314 FUNCTION(Uint32x4, Int8x16) |
| 315 FUNCTION(Uint32x4, Uint8x16) |
247 FUNCTION(Int16x8, Float32x4) | 316 FUNCTION(Int16x8, Float32x4) |
248 FUNCTION(Int16x8, Int32x4) | 317 FUNCTION(Int16x8, Int32x4) |
| 318 FUNCTION(Int16x8, Uint32x4) |
| 319 FUNCTION(Int16x8, Uint16x8) |
249 FUNCTION(Int16x8, Int8x16) | 320 FUNCTION(Int16x8, Int8x16) |
| 321 FUNCTION(Int16x8, Uint8x16) |
| 322 FUNCTION(Uint16x8, Float32x4) |
| 323 FUNCTION(Uint16x8, Int32x4) |
| 324 FUNCTION(Uint16x8, Uint32x4) |
| 325 FUNCTION(Uint16x8, Int16x8) |
| 326 FUNCTION(Uint16x8, Int8x16) |
| 327 FUNCTION(Uint16x8, Uint8x16) |
250 FUNCTION(Int8x16, Float32x4) | 328 FUNCTION(Int8x16, Float32x4) |
251 FUNCTION(Int8x16, Int32x4) | 329 FUNCTION(Int8x16, Int32x4) |
| 330 FUNCTION(Int8x16, Uint32x4) |
252 FUNCTION(Int8x16, Int16x8) | 331 FUNCTION(Int8x16, Int16x8) |
| 332 FUNCTION(Int8x16, Uint16x8) |
| 333 FUNCTION(Int8x16, Uint8x16) |
| 334 FUNCTION(Uint8x16, Float32x4) |
| 335 FUNCTION(Uint8x16, Int32x4) |
| 336 FUNCTION(Uint8x16, Uint32x4) |
| 337 FUNCTION(Uint8x16, Int16x8) |
| 338 FUNCTION(Uint8x16, Uint16x8) |
| 339 FUNCTION(Uint8x16, Int8x16) |
253 endmacro | 340 endmacro |
254 | 341 |
255 macro DECLARE_FROM_BITS_FUNCTIONS(TO, FROM) | 342 macro DECLARE_FROM_BITS_FUNCTIONS(TO, FROM) |
256 function TOFromFROMBitsJS(a) { | 343 function TOFromFROMBitsJS(a) { |
257 return %TOFromFROMBits(a); | 344 return %TOFromFROMBits(a); |
258 } | 345 } |
259 endmacro | 346 endmacro |
260 | 347 |
261 SIMD_FROM_BITS_TYPES(DECLARE_FROM_BITS_FUNCTIONS) | 348 SIMD_FROM_BITS_TYPES(DECLARE_FROM_BITS_FUNCTIONS) |
262 | 349 |
263 //------------------------------------------------------------------- | 350 //------------------------------------------------------------------- |
264 | 351 |
| 352 macro SIMD_X4_TYPES(FUNCTION) |
| 353 FUNCTION(Float32x4) |
| 354 FUNCTION(Int32x4) |
| 355 FUNCTION(Uint32x4) |
| 356 FUNCTION(Bool32x4) |
| 357 endmacro |
| 358 |
| 359 macro DECLARE_X4_FUNCTIONS(NAME) |
| 360 function NAMESplat(s) { |
| 361 return %CreateNAME(s, s, s, s); |
| 362 } |
| 363 |
| 364 function NAMESwizzleJS(a, c0, c1, c2, c3) { |
| 365 return %NAMESwizzle(a, c0, c1, c2, c3); |
| 366 } |
| 367 |
| 368 function NAMEShuffleJS(a, b, c0, c1, c2, c3) { |
| 369 return %NAMEShuffle(a, b, c0, c1, c2, c3); |
| 370 } |
| 371 endmacro |
| 372 |
| 373 SIMD_X4_TYPES(DECLARE_X4_FUNCTIONS) |
| 374 |
| 375 macro SIMD_X8_TYPES(FUNCTION) |
| 376 FUNCTION(Int16x8) |
| 377 FUNCTION(Uint16x8) |
| 378 FUNCTION(Bool16x8) |
| 379 endmacro |
| 380 |
| 381 macro DECLARE_X8_FUNCTIONS(NAME) |
| 382 function NAMESplat(s) { |
| 383 return %CreateNAME(s, s, s, s, s, s, s, s); |
| 384 } |
| 385 |
| 386 function NAMESwizzleJS(a, c0, c1, c2, c3, c4, c5, c6, c7) { |
| 387 return %NAMESwizzle(a, c0, c1, c2, c3, c4, c5, c6, c7); |
| 388 } |
| 389 |
| 390 function NAMEShuffleJS(a, b, c0, c1, c2, c3, c4, c5, c6, c7) { |
| 391 return %NAMEShuffle(a, b, c0, c1, c2, c3, c4, c5, c6, c7); |
| 392 } |
| 393 endmacro |
| 394 |
| 395 SIMD_X8_TYPES(DECLARE_X8_FUNCTIONS) |
| 396 |
| 397 macro SIMD_X16_TYPES(FUNCTION) |
| 398 FUNCTION(Int8x16) |
| 399 FUNCTION(Uint8x16) |
| 400 FUNCTION(Bool8x16) |
| 401 endmacro |
| 402 |
| 403 macro DECLARE_X16_FUNCTIONS(NAME) |
| 404 function NAMESplat(s) { |
| 405 return %CreateNAME(s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s); |
| 406 } |
| 407 |
| 408 function NAMESwizzleJS(a, c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, |
| 409 c12, c13, c14, c15) { |
| 410 return %NAMESwizzle(a, c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, |
| 411 c12, c13, c14, c15); |
| 412 } |
| 413 |
| 414 function NAMEShuffleJS(a, b, c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, |
| 415 c11, c12, c13, c14, c15) { |
| 416 return %NAMEShuffle(a, b, c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, |
| 417 c11, c12, c13, c14, c15); |
| 418 } |
| 419 endmacro |
| 420 |
| 421 SIMD_X16_TYPES(DECLARE_X16_FUNCTIONS) |
| 422 |
| 423 //------------------------------------------------------------------- |
| 424 |
265 function Float32x4Constructor(c0, c1, c2, c3) { | 425 function Float32x4Constructor(c0, c1, c2, c3) { |
266 if (%_IsConstructCall()) throw MakeTypeError(kNotConstructor, "Float32x4"); | 426 if (%_IsConstructCall()) throw MakeTypeError(kNotConstructor, "Float32x4"); |
267 return %CreateFloat32x4(TO_NUMBER_INLINE(c0), TO_NUMBER_INLINE(c1), | 427 return %CreateFloat32x4(TO_NUMBER_INLINE(c0), TO_NUMBER_INLINE(c1), |
268 TO_NUMBER_INLINE(c2), TO_NUMBER_INLINE(c3)); | 428 TO_NUMBER_INLINE(c2), TO_NUMBER_INLINE(c3)); |
269 } | 429 } |
270 | 430 |
271 | 431 |
272 function Float32x4Splat(s) { | |
273 return %CreateFloat32x4(s, s, s, s); | |
274 } | |
275 | |
276 | |
277 function Float32x4AbsJS(a) { | |
278 return %Float32x4Abs(a); | |
279 } | |
280 | |
281 | |
282 function Float32x4SqrtJS(a) { | |
283 return %Float32x4Sqrt(a); | |
284 } | |
285 | |
286 | |
287 function Float32x4RecipApproxJS(a) { | |
288 return %Float32x4RecipApprox(a); | |
289 } | |
290 | |
291 | |
292 function Float32x4RecipSqrtApproxJS(a) { | |
293 return %Float32x4RecipSqrtApprox(a); | |
294 } | |
295 | |
296 | |
297 function Float32x4DivJS(a, b) { | |
298 return %Float32x4Div(a, b); | |
299 } | |
300 | |
301 | |
302 function Float32x4MinNumJS(a, b) { | |
303 return %Float32x4MinNum(a, b); | |
304 } | |
305 | |
306 | |
307 function Float32x4MaxNumJS(a, b) { | |
308 return %Float32x4MaxNum(a, b); | |
309 } | |
310 | |
311 | |
312 function Float32x4SwizzleJS(a, c0, c1, c2, c3) { | |
313 return %Float32x4Swizzle(a, c0, c1, c2, c3); | |
314 } | |
315 | |
316 | |
317 function Float32x4ShuffleJS(a, b, c0, c1, c2, c3) { | |
318 return %Float32x4Shuffle(a, b, c0, c1, c2, c3); | |
319 } | |
320 | |
321 | |
322 function Int32x4Constructor(c0, c1, c2, c3) { | 432 function Int32x4Constructor(c0, c1, c2, c3) { |
323 if (%_IsConstructCall()) throw MakeTypeError(kNotConstructor, "Int32x4"); | 433 if (%_IsConstructCall()) throw MakeTypeError(kNotConstructor, "Int32x4"); |
324 return %CreateInt32x4(TO_NUMBER_INLINE(c0), TO_NUMBER_INLINE(c1), | 434 return %CreateInt32x4(TO_NUMBER_INLINE(c0), TO_NUMBER_INLINE(c1), |
325 TO_NUMBER_INLINE(c2), TO_NUMBER_INLINE(c3)); | 435 TO_NUMBER_INLINE(c2), TO_NUMBER_INLINE(c3)); |
326 } | 436 } |
327 | 437 |
328 | 438 |
329 function Int32x4Splat(s) { | 439 function Uint32x4Constructor(c0, c1, c2, c3) { |
330 return %CreateInt32x4(s, s, s, s); | 440 if (%_IsConstructCall()) throw MakeTypeError(kNotConstructor, "Uint32x4"); |
| 441 return %CreateUint32x4(TO_NUMBER_INLINE(c0), TO_NUMBER_INLINE(c1), |
| 442 TO_NUMBER_INLINE(c2), TO_NUMBER_INLINE(c3)); |
331 } | 443 } |
332 | 444 |
333 | 445 |
334 function Int32x4SwizzleJS(a, c0, c1, c2, c3) { | |
335 return %Int32x4Swizzle(a, c0, c1, c2, c3); | |
336 } | |
337 | |
338 | |
339 function Int32x4ShuffleJS(a, b, c0, c1, c2, c3) { | |
340 return %Int32x4Shuffle(a, b, c0, c1, c2, c3); | |
341 } | |
342 | |
343 | |
344 function Bool32x4Constructor(c0, c1, c2, c3) { | 446 function Bool32x4Constructor(c0, c1, c2, c3) { |
345 if (%_IsConstructCall()) throw MakeTypeError(kNotConstructor, "Bool32x4"); | 447 if (%_IsConstructCall()) throw MakeTypeError(kNotConstructor, "Bool32x4"); |
346 return %CreateBool32x4(c0, c1, c2, c3); | 448 return %CreateBool32x4(c0, c1, c2, c3); |
347 } | 449 } |
348 | 450 |
349 | 451 |
350 function Bool32x4Splat(s) { | |
351 return %CreateBool32x4(s, s, s, s); | |
352 } | |
353 | |
354 function Bool32x4SwizzleJS(a, c0, c1, c2, c3) { | |
355 return %Bool32x4Swizzle(a, c0, c1, c2, c3); | |
356 } | |
357 | |
358 | |
359 function Bool32x4ShuffleJS(a, b, c0, c1, c2, c3) { | |
360 return %Bool32x4Shuffle(a, b, c0, c1, c2, c3); | |
361 } | |
362 | |
363 | |
364 function Int16x8Constructor(c0, c1, c2, c3, c4, c5, c6, c7) { | 452 function Int16x8Constructor(c0, c1, c2, c3, c4, c5, c6, c7) { |
365 if (%_IsConstructCall()) throw MakeTypeError(kNotConstructor, "Int16x8"); | 453 if (%_IsConstructCall()) throw MakeTypeError(kNotConstructor, "Int16x8"); |
366 return %CreateInt16x8(TO_NUMBER_INLINE(c0), TO_NUMBER_INLINE(c1), | 454 return %CreateInt16x8(TO_NUMBER_INLINE(c0), TO_NUMBER_INLINE(c1), |
367 TO_NUMBER_INLINE(c2), TO_NUMBER_INLINE(c3), | 455 TO_NUMBER_INLINE(c2), TO_NUMBER_INLINE(c3), |
368 TO_NUMBER_INLINE(c4), TO_NUMBER_INLINE(c5), | 456 TO_NUMBER_INLINE(c4), TO_NUMBER_INLINE(c5), |
369 TO_NUMBER_INLINE(c6), TO_NUMBER_INLINE(c7)); | 457 TO_NUMBER_INLINE(c6), TO_NUMBER_INLINE(c7)); |
370 } | 458 } |
371 | 459 |
372 | 460 |
373 function Int16x8Splat(s) { | 461 function Uint16x8Constructor(c0, c1, c2, c3, c4, c5, c6, c7) { |
374 return %CreateInt16x8(s, s, s, s, s, s, s, s); | 462 if (%_IsConstructCall()) throw MakeTypeError(kNotConstructor, "Uint16x8"); |
| 463 return %CreateUint16x8(TO_NUMBER_INLINE(c0), TO_NUMBER_INLINE(c1), |
| 464 TO_NUMBER_INLINE(c2), TO_NUMBER_INLINE(c3), |
| 465 TO_NUMBER_INLINE(c4), TO_NUMBER_INLINE(c5), |
| 466 TO_NUMBER_INLINE(c6), TO_NUMBER_INLINE(c7)); |
375 } | 467 } |
376 | 468 |
377 | 469 |
378 function Int16x8SwizzleJS(a, c0, c1, c2, c3, c4, c5, c6, c7) { | |
379 return %Int16x8Swizzle(a, c0, c1, c2, c3, c4, c5, c6, c7); | |
380 } | |
381 | |
382 | |
383 function Int16x8ShuffleJS(a, b, c0, c1, c2, c3, c4, c5, c6, c7) { | |
384 return %Int16x8Shuffle(a, b, c0, c1, c2, c3, c4, c5, c6, c7); | |
385 } | |
386 | |
387 | |
388 function Bool16x8Constructor(c0, c1, c2, c3, c4, c5, c6, c7) { | 470 function Bool16x8Constructor(c0, c1, c2, c3, c4, c5, c6, c7) { |
389 if (%_IsConstructCall()) throw MakeTypeError(kNotConstructor, "Bool16x8"); | 471 if (%_IsConstructCall()) throw MakeTypeError(kNotConstructor, "Bool16x8"); |
390 return %CreateBool16x8(c0, c1, c2, c3, c4, c5, c6, c7); | 472 return %CreateBool16x8(c0, c1, c2, c3, c4, c5, c6, c7); |
391 } | 473 } |
392 | 474 |
393 | 475 |
394 function Bool16x8Splat(s) { | |
395 return %CreateBool16x8(s, s, s, s, s, s, s, s); | |
396 } | |
397 | |
398 | |
399 function Bool16x8SwizzleJS(a, c0, c1, c2, c3, c4, c5, c6, c7) { | |
400 return %Bool16x8Swizzle(a, c0, c1, c2, c3, c4, c5, c6, c7); | |
401 } | |
402 | |
403 | |
404 function Bool16x8ShuffleJS(a, b, c0, c1, c2, c3, c4, c5, c6, c7) { | |
405 return %Bool16x8Shuffle(a, b, c0, c1, c2, c3, c4, c5, c6, c7); | |
406 } | |
407 | |
408 | |
409 function Int8x16Constructor(c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, | 476 function Int8x16Constructor(c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, |
410 c12, c13, c14, c15) { | 477 c12, c13, c14, c15) { |
411 if (%_IsConstructCall()) throw MakeTypeError(kNotConstructor, "Int8x16"); | 478 if (%_IsConstructCall()) throw MakeTypeError(kNotConstructor, "Int8x16"); |
412 return %CreateInt8x16(TO_NUMBER_INLINE(c0), TO_NUMBER_INLINE(c1), | 479 return %CreateInt8x16(TO_NUMBER_INLINE(c0), TO_NUMBER_INLINE(c1), |
413 TO_NUMBER_INLINE(c2), TO_NUMBER_INLINE(c3), | 480 TO_NUMBER_INLINE(c2), TO_NUMBER_INLINE(c3), |
414 TO_NUMBER_INLINE(c4), TO_NUMBER_INLINE(c5), | 481 TO_NUMBER_INLINE(c4), TO_NUMBER_INLINE(c5), |
415 TO_NUMBER_INLINE(c6), TO_NUMBER_INLINE(c7), | 482 TO_NUMBER_INLINE(c6), TO_NUMBER_INLINE(c7), |
416 TO_NUMBER_INLINE(c8), TO_NUMBER_INLINE(c9), | 483 TO_NUMBER_INLINE(c8), TO_NUMBER_INLINE(c9), |
417 TO_NUMBER_INLINE(c10), TO_NUMBER_INLINE(c11), | 484 TO_NUMBER_INLINE(c10), TO_NUMBER_INLINE(c11), |
418 TO_NUMBER_INLINE(c12), TO_NUMBER_INLINE(c13), | 485 TO_NUMBER_INLINE(c12), TO_NUMBER_INLINE(c13), |
419 TO_NUMBER_INLINE(c14), TO_NUMBER_INLINE(c15)); | 486 TO_NUMBER_INLINE(c14), TO_NUMBER_INLINE(c15)); |
420 } | 487 } |
421 | 488 |
422 | 489 |
423 function Int8x16Splat(s) { | 490 function Uint8x16Constructor(c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, |
424 return %CreateInt8x16(s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s); | 491 c12, c13, c14, c15) { |
425 } | 492 if (%_IsConstructCall()) throw MakeTypeError(kNotConstructor, "Uint8x16"); |
426 | 493 return %CreateUint8x16(TO_NUMBER_INLINE(c0), TO_NUMBER_INLINE(c1), |
427 | 494 TO_NUMBER_INLINE(c2), TO_NUMBER_INLINE(c3), |
428 function Int8x16SwizzleJS(a, c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, | 495 TO_NUMBER_INLINE(c4), TO_NUMBER_INLINE(c5), |
429 c12, c13, c14, c15) { | 496 TO_NUMBER_INLINE(c6), TO_NUMBER_INLINE(c7), |
430 return %Int8x16Swizzle(a, c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, | 497 TO_NUMBER_INLINE(c8), TO_NUMBER_INLINE(c9), |
431 c12, c13, c14, c15); | 498 TO_NUMBER_INLINE(c10), TO_NUMBER_INLINE(c11), |
432 } | 499 TO_NUMBER_INLINE(c12), TO_NUMBER_INLINE(c13), |
433 | 500 TO_NUMBER_INLINE(c14), TO_NUMBER_INLINE(c15)); |
434 | |
435 function Int8x16ShuffleJS(a, b, c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, | |
436 c11, c12, c13, c14, c15) { | |
437 return %Int8x16Shuffle(a, b, c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, | |
438 c11, c12, c13, c14, c15); | |
439 } | 501 } |
440 | 502 |
441 | 503 |
442 function Bool8x16Constructor(c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, | 504 function Bool8x16Constructor(c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, |
443 c12, c13, c14, c15) { | 505 c12, c13, c14, c15) { |
444 if (%_IsConstructCall()) throw MakeTypeError(kNotConstructor, "Bool8x16"); | 506 if (%_IsConstructCall()) throw MakeTypeError(kNotConstructor, "Bool8x16"); |
445 return %CreateBool8x16(c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, | 507 return %CreateBool8x16(c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, |
446 c13, c14, c15); | 508 c13, c14, c15); |
447 } | 509 } |
448 | 510 |
449 | 511 |
450 function Bool8x16Splat(s) { | 512 function Float32x4AbsJS(a) { |
451 return %CreateBool8x16(s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s); | 513 return %Float32x4Abs(a); |
452 } | 514 } |
453 | 515 |
454 | 516 |
455 function Bool8x16SwizzleJS(a, c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, | 517 function Float32x4SqrtJS(a) { |
456 c12, c13, c14, c15) { | 518 return %Float32x4Sqrt(a); |
457 return %Bool8x16Swizzle(a, c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, | |
458 c12, c13, c14, c15); | |
459 } | 519 } |
460 | 520 |
461 | 521 |
462 function Bool8x16ShuffleJS(a, b, c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, | 522 function Float32x4RecipApproxJS(a) { |
463 c11, c12, c13, c14, c15) { | 523 return %Float32x4RecipApprox(a); |
464 return %Bool8x16Shuffle(a, b, c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, | |
465 c11, c12, c13, c14, c15); | |
466 } | 524 } |
467 | 525 |
468 | 526 |
| 527 function Float32x4RecipSqrtApproxJS(a) { |
| 528 return %Float32x4RecipSqrtApprox(a); |
| 529 } |
| 530 |
| 531 |
| 532 function Float32x4DivJS(a, b) { |
| 533 return %Float32x4Div(a, b); |
| 534 } |
| 535 |
| 536 |
| 537 function Float32x4MinNumJS(a, b) { |
| 538 return %Float32x4MinNum(a, b); |
| 539 } |
| 540 |
| 541 |
| 542 function Float32x4MaxNumJS(a, b) { |
| 543 return %Float32x4MaxNum(a, b); |
| 544 } |
| 545 |
| 546 |
469 %AddNamedProperty(GlobalSIMD, symbolToStringTag, 'SIMD', READ_ONLY | DONT_ENUM); | 547 %AddNamedProperty(GlobalSIMD, symbolToStringTag, 'SIMD', READ_ONLY | DONT_ENUM); |
470 | 548 |
471 macro SETUP_SIMD_TYPE(NAME, TYPE, LANES) | 549 macro SETUP_SIMD_TYPE(NAME, TYPE, LANES) |
472 %SetCode(GlobalNAME, NAMEConstructor); | 550 %SetCode(GlobalNAME, NAMEConstructor); |
473 %FunctionSetPrototype(GlobalNAME, {}); | 551 %FunctionSetPrototype(GlobalNAME, {}); |
474 %AddNamedProperty(GlobalNAME.prototype, 'constructor', GlobalNAME, | 552 %AddNamedProperty(GlobalNAME.prototype, 'constructor', GlobalNAME, |
475 DONT_ENUM); | 553 DONT_ENUM); |
476 %AddNamedProperty(GlobalNAME.prototype, symbolToStringTag, 'NAME', | 554 %AddNamedProperty(GlobalNAME.prototype, symbolToStringTag, 'NAME', |
477 DONT_ENUM | READ_ONLY); | 555 DONT_ENUM | READ_ONLY); |
478 utils.InstallFunctions(GlobalNAME.prototype, DONT_ENUM, [ | 556 utils.InstallFunctions(GlobalNAME.prototype, DONT_ENUM, [ |
(...skipping 28 matching lines...) Expand all Loading... |
507 'lessThan', Float32x4LessThanJS, | 585 'lessThan', Float32x4LessThanJS, |
508 'lessThanOrEqual', Float32x4LessThanOrEqualJS, | 586 'lessThanOrEqual', Float32x4LessThanOrEqualJS, |
509 'greaterThan', Float32x4GreaterThanJS, | 587 'greaterThan', Float32x4GreaterThanJS, |
510 'greaterThanOrEqual', Float32x4GreaterThanOrEqualJS, | 588 'greaterThanOrEqual', Float32x4GreaterThanOrEqualJS, |
511 'equal', Float32x4EqualJS, | 589 'equal', Float32x4EqualJS, |
512 'notEqual', Float32x4NotEqualJS, | 590 'notEqual', Float32x4NotEqualJS, |
513 'select', Float32x4SelectJS, | 591 'select', Float32x4SelectJS, |
514 'swizzle', Float32x4SwizzleJS, | 592 'swizzle', Float32x4SwizzleJS, |
515 'shuffle', Float32x4ShuffleJS, | 593 'shuffle', Float32x4ShuffleJS, |
516 'fromInt32x4', Float32x4FromInt32x4JS, | 594 'fromInt32x4', Float32x4FromInt32x4JS, |
| 595 'fromUint32x4', Float32x4FromUint32x4JS, |
517 'fromInt32x4Bits', Float32x4FromInt32x4BitsJS, | 596 'fromInt32x4Bits', Float32x4FromInt32x4BitsJS, |
| 597 'fromUint32x4Bits', Float32x4FromUint32x4BitsJS, |
518 'fromInt16x8Bits', Float32x4FromInt16x8BitsJS, | 598 'fromInt16x8Bits', Float32x4FromInt16x8BitsJS, |
| 599 'fromUint16x8Bits', Float32x4FromUint16x8BitsJS, |
519 'fromInt8x16Bits', Float32x4FromInt8x16BitsJS, | 600 'fromInt8x16Bits', Float32x4FromInt8x16BitsJS, |
| 601 'fromUint8x16Bits', Float32x4FromUint8x16BitsJS, |
520 ]); | 602 ]); |
521 | 603 |
522 utils.InstallFunctions(GlobalInt32x4, DONT_ENUM, [ | 604 utils.InstallFunctions(GlobalInt32x4, DONT_ENUM, [ |
523 'splat', Int32x4Splat, | 605 'splat', Int32x4Splat, |
524 'check', Int32x4CheckJS, | 606 'check', Int32x4CheckJS, |
525 'extractLane', Int32x4ExtractLaneJS, | 607 'extractLane', Int32x4ExtractLaneJS, |
526 'replaceLane', Int32x4ReplaceLaneJS, | 608 'replaceLane', Int32x4ReplaceLaneJS, |
527 'neg', Int32x4NegJS, | 609 'neg', Int32x4NegJS, |
528 'add', Int32x4AddJS, | 610 'add', Int32x4AddJS, |
529 'sub', Int32x4SubJS, | 611 'sub', Int32x4SubJS, |
530 'mul', Int32x4MulJS, | 612 'mul', Int32x4MulJS, |
531 'min', Int32x4MinJS, | 613 'min', Int32x4MinJS, |
532 'max', Int32x4MaxJS, | 614 'max', Int32x4MaxJS, |
533 'and', Int32x4AndJS, | 615 'and', Int32x4AndJS, |
534 'or', Int32x4OrJS, | 616 'or', Int32x4OrJS, |
535 'xor', Int32x4XorJS, | 617 'xor', Int32x4XorJS, |
536 'not', Int32x4NotJS, | 618 'not', Int32x4NotJS, |
537 'shiftLeftByScalar', Int32x4ShiftLeftByScalarJS, | 619 'shiftLeftByScalar', Int32x4ShiftLeftByScalarJS, |
538 'shiftRightLogicalByScalar', Int32x4ShiftRightLogicalByScalarJS, | |
539 'shiftRightArithmeticByScalar', Int32x4ShiftRightArithmeticByScalarJS, | 620 'shiftRightArithmeticByScalar', Int32x4ShiftRightArithmeticByScalarJS, |
540 'lessThan', Int32x4LessThanJS, | 621 'lessThan', Int32x4LessThanJS, |
541 'lessThanOrEqual', Int32x4LessThanOrEqualJS, | 622 'lessThanOrEqual', Int32x4LessThanOrEqualJS, |
542 'greaterThan', Int32x4GreaterThanJS, | 623 'greaterThan', Int32x4GreaterThanJS, |
543 'greaterThanOrEqual', Int32x4GreaterThanOrEqualJS, | 624 'greaterThanOrEqual', Int32x4GreaterThanOrEqualJS, |
544 'equal', Int32x4EqualJS, | 625 'equal', Int32x4EqualJS, |
545 'notEqual', Int32x4NotEqualJS, | 626 'notEqual', Int32x4NotEqualJS, |
546 'select', Int32x4SelectJS, | 627 'select', Int32x4SelectJS, |
547 'swizzle', Int32x4SwizzleJS, | 628 'swizzle', Int32x4SwizzleJS, |
548 'shuffle', Int32x4ShuffleJS, | 629 'shuffle', Int32x4ShuffleJS, |
549 'fromFloat32x4', Int32x4FromFloat32x4JS, | 630 'fromFloat32x4', Int32x4FromFloat32x4JS, |
| 631 'fromUint32x4', Int32x4FromUint32x4JS, |
550 'fromFloat32x4Bits', Int32x4FromFloat32x4BitsJS, | 632 'fromFloat32x4Bits', Int32x4FromFloat32x4BitsJS, |
| 633 'fromUint32x4Bits', Int32x4FromUint32x4BitsJS, |
551 'fromInt16x8Bits', Int32x4FromInt16x8BitsJS, | 634 'fromInt16x8Bits', Int32x4FromInt16x8BitsJS, |
| 635 'fromUint16x8Bits', Int32x4FromUint16x8BitsJS, |
552 'fromInt8x16Bits', Int32x4FromInt8x16BitsJS, | 636 'fromInt8x16Bits', Int32x4FromInt8x16BitsJS, |
| 637 'fromUint8x16Bits', Int32x4FromUint8x16BitsJS, |
| 638 ]); |
| 639 |
| 640 utils.InstallFunctions(GlobalUint32x4, DONT_ENUM, [ |
| 641 'splat', Uint32x4Splat, |
| 642 'check', Uint32x4CheckJS, |
| 643 'extractLane', Uint32x4ExtractLaneJS, |
| 644 'replaceLane', Uint32x4ReplaceLaneJS, |
| 645 'add', Uint32x4AddJS, |
| 646 'sub', Uint32x4SubJS, |
| 647 'mul', Uint32x4MulJS, |
| 648 'min', Uint32x4MinJS, |
| 649 'max', Uint32x4MaxJS, |
| 650 'and', Uint32x4AndJS, |
| 651 'or', Uint32x4OrJS, |
| 652 'xor', Uint32x4XorJS, |
| 653 'not', Uint32x4NotJS, |
| 654 'shiftLeftByScalar', Uint32x4ShiftLeftByScalarJS, |
| 655 'shiftRightLogicalByScalar', Uint32x4ShiftRightLogicalByScalarJS, |
| 656 'horizontalSum', Uint32x4HorizontalSumJS, |
| 657 'lessThan', Uint32x4LessThanJS, |
| 658 'lessThanOrEqual', Uint32x4LessThanOrEqualJS, |
| 659 'greaterThan', Uint32x4GreaterThanJS, |
| 660 'greaterThanOrEqual', Uint32x4GreaterThanOrEqualJS, |
| 661 'equal', Uint32x4EqualJS, |
| 662 'notEqual', Uint32x4NotEqualJS, |
| 663 'select', Uint32x4SelectJS, |
| 664 'swizzle', Uint32x4SwizzleJS, |
| 665 'shuffle', Uint32x4ShuffleJS, |
| 666 'fromFloat32x4', Uint32x4FromFloat32x4JS, |
| 667 'fromInt32x4', Uint32x4FromInt32x4JS, |
| 668 'fromFloat32x4Bits', Uint32x4FromFloat32x4BitsJS, |
| 669 'fromInt32x4Bits', Uint32x4FromInt32x4BitsJS, |
| 670 'fromInt16x8Bits', Uint32x4FromInt16x8BitsJS, |
| 671 'fromUint16x8Bits', Uint32x4FromUint16x8BitsJS, |
| 672 'fromInt8x16Bits', Uint32x4FromInt8x16BitsJS, |
| 673 'fromUint8x16Bits', Uint32x4FromUint8x16BitsJS, |
553 ]); | 674 ]); |
554 | 675 |
555 utils.InstallFunctions(GlobalBool32x4, DONT_ENUM, [ | 676 utils.InstallFunctions(GlobalBool32x4, DONT_ENUM, [ |
556 'splat', Bool32x4Splat, | 677 'splat', Bool32x4Splat, |
557 'check', Bool32x4CheckJS, | 678 'check', Bool32x4CheckJS, |
558 'extractLane', Bool32x4ExtractLaneJS, | 679 'extractLane', Bool32x4ExtractLaneJS, |
559 'replaceLane', Bool32x4ReplaceLaneJS, | 680 'replaceLane', Bool32x4ReplaceLaneJS, |
560 'and', Bool32x4AndJS, | 681 'and', Bool32x4AndJS, |
561 'or', Bool32x4OrJS, | 682 'or', Bool32x4OrJS, |
562 'xor', Bool32x4XorJS, | 683 'xor', Bool32x4XorJS, |
563 'not', Bool32x4NotJS, | 684 'not', Bool32x4NotJS, |
564 'anyTrue', Bool32x4AnyTrueJS, | 685 'anyTrue', Bool32x4AnyTrueJS, |
565 'allTrue', Bool32x4AllTrueJS, | 686 'allTrue', Bool32x4AllTrueJS, |
566 'equal', Bool32x4EqualJS, | |
567 'notEqual', Bool32x4NotEqualJS, | |
568 'swizzle', Bool32x4SwizzleJS, | 687 'swizzle', Bool32x4SwizzleJS, |
569 'shuffle', Bool32x4ShuffleJS, | 688 'shuffle', Bool32x4ShuffleJS, |
570 ]); | 689 ]); |
571 | 690 |
572 utils.InstallFunctions(GlobalInt16x8, DONT_ENUM, [ | 691 utils.InstallFunctions(GlobalInt16x8, DONT_ENUM, [ |
573 'splat', Int16x8Splat, | 692 'splat', Int16x8Splat, |
574 'check', Int16x8CheckJS, | 693 'check', Int16x8CheckJS, |
575 'extractLane', Int16x8ExtractLaneJS, | 694 'extractLane', Int16x8ExtractLaneJS, |
576 'unsignedExtractLane', Int16x8UnsignedExtractLaneJS, | |
577 'replaceLane', Int16x8ReplaceLaneJS, | 695 'replaceLane', Int16x8ReplaceLaneJS, |
578 'neg', Int16x8NegJS, | 696 'neg', Int16x8NegJS, |
579 'add', Int16x8AddJS, | 697 'add', Int16x8AddJS, |
580 'sub', Int16x8SubJS, | 698 'sub', Int16x8SubJS, |
| 699 'addSaturate', Int16x8AddSaturateJS, |
| 700 'subSaturate', Int16x8SubSaturateJS, |
581 'mul', Int16x8MulJS, | 701 'mul', Int16x8MulJS, |
582 'min', Int16x8MinJS, | 702 'min', Int16x8MinJS, |
583 'max', Int16x8MaxJS, | 703 'max', Int16x8MaxJS, |
584 'and', Int16x8AndJS, | 704 'and', Int16x8AndJS, |
585 'or', Int16x8OrJS, | 705 'or', Int16x8OrJS, |
586 'xor', Int16x8XorJS, | 706 'xor', Int16x8XorJS, |
587 'not', Int16x8NotJS, | 707 'not', Int16x8NotJS, |
588 'shiftLeftByScalar', Int16x8ShiftLeftByScalarJS, | 708 'shiftLeftByScalar', Int16x8ShiftLeftByScalarJS, |
589 'shiftRightLogicalByScalar', Int16x8ShiftRightLogicalByScalarJS, | |
590 'shiftRightArithmeticByScalar', Int16x8ShiftRightArithmeticByScalarJS, | 709 'shiftRightArithmeticByScalar', Int16x8ShiftRightArithmeticByScalarJS, |
591 'lessThan', Int16x8LessThanJS, | 710 'lessThan', Int16x8LessThanJS, |
592 'lessThanOrEqual', Int16x8LessThanOrEqualJS, | 711 'lessThanOrEqual', Int16x8LessThanOrEqualJS, |
593 'greaterThan', Int16x8GreaterThanJS, | 712 'greaterThan', Int16x8GreaterThanJS, |
594 'greaterThanOrEqual', Int16x8GreaterThanOrEqualJS, | 713 'greaterThanOrEqual', Int16x8GreaterThanOrEqualJS, |
595 'equal', Int16x8EqualJS, | 714 'equal', Int16x8EqualJS, |
596 'notEqual', Int16x8NotEqualJS, | 715 'notEqual', Int16x8NotEqualJS, |
597 'select', Int16x8SelectJS, | 716 'select', Int16x8SelectJS, |
598 'swizzle', Int16x8SwizzleJS, | 717 'swizzle', Int16x8SwizzleJS, |
599 'shuffle', Int16x8ShuffleJS, | 718 'shuffle', Int16x8ShuffleJS, |
| 719 'fromUint16x8', Int16x8FromUint16x8JS, |
600 'fromFloat32x4Bits', Int16x8FromFloat32x4BitsJS, | 720 'fromFloat32x4Bits', Int16x8FromFloat32x4BitsJS, |
601 'fromInt32x4Bits', Int16x8FromInt32x4BitsJS, | 721 'fromInt32x4Bits', Int16x8FromInt32x4BitsJS, |
| 722 'fromUint32x4Bits', Int16x8FromUint32x4BitsJS, |
| 723 'fromUint16x8Bits', Int16x8FromUint16x8BitsJS, |
602 'fromInt8x16Bits', Int16x8FromInt8x16BitsJS, | 724 'fromInt8x16Bits', Int16x8FromInt8x16BitsJS, |
| 725 'fromUint8x16Bits', Int16x8FromUint8x16BitsJS, |
| 726 ]); |
| 727 |
| 728 utils.InstallFunctions(GlobalUint16x8, DONT_ENUM, [ |
| 729 'splat', Uint16x8Splat, |
| 730 'check', Uint16x8CheckJS, |
| 731 'extractLane', Uint16x8ExtractLaneJS, |
| 732 'replaceLane', Uint16x8ReplaceLaneJS, |
| 733 'add', Uint16x8AddJS, |
| 734 'sub', Uint16x8SubJS, |
| 735 'addSaturate', Uint16x8AddSaturateJS, |
| 736 'subSaturate', Uint16x8SubSaturateJS, |
| 737 'mul', Uint16x8MulJS, |
| 738 'min', Uint16x8MinJS, |
| 739 'max', Uint16x8MaxJS, |
| 740 'and', Uint16x8AndJS, |
| 741 'or', Uint16x8OrJS, |
| 742 'xor', Uint16x8XorJS, |
| 743 'not', Uint16x8NotJS, |
| 744 'shiftLeftByScalar', Uint16x8ShiftLeftByScalarJS, |
| 745 'shiftRightLogicalByScalar', Uint16x8ShiftRightLogicalByScalarJS, |
| 746 'horizontalSum', Uint16x8HorizontalSumJS, |
| 747 'absoluteDifference', Uint16x8AbsoluteDifferenceJS, |
| 748 'widenedAbsoluteDifference', Uint16x8WidenedAbsoluteDifferenceJS, |
| 749 'lessThan', Uint16x8LessThanJS, |
| 750 'lessThanOrEqual', Uint16x8LessThanOrEqualJS, |
| 751 'greaterThan', Uint16x8GreaterThanJS, |
| 752 'greaterThanOrEqual', Uint16x8GreaterThanOrEqualJS, |
| 753 'equal', Uint16x8EqualJS, |
| 754 'notEqual', Uint16x8NotEqualJS, |
| 755 'select', Uint16x8SelectJS, |
| 756 'swizzle', Uint16x8SwizzleJS, |
| 757 'shuffle', Uint16x8ShuffleJS, |
| 758 'fromInt16x8', Uint16x8FromInt16x8JS, |
| 759 'fromFloat32x4Bits', Uint16x8FromFloat32x4BitsJS, |
| 760 'fromInt32x4Bits', Uint16x8FromInt32x4BitsJS, |
| 761 'fromUint32x4Bits', Uint16x8FromUint32x4BitsJS, |
| 762 'fromInt16x8Bits', Uint16x8FromInt16x8BitsJS, |
| 763 'fromInt8x16Bits', Uint16x8FromInt8x16BitsJS, |
| 764 'fromUint8x16Bits', Uint16x8FromUint8x16BitsJS, |
603 ]); | 765 ]); |
604 | 766 |
605 utils.InstallFunctions(GlobalBool16x8, DONT_ENUM, [ | 767 utils.InstallFunctions(GlobalBool16x8, DONT_ENUM, [ |
606 'splat', Bool16x8Splat, | 768 'splat', Bool16x8Splat, |
607 'check', Bool16x8CheckJS, | 769 'check', Bool16x8CheckJS, |
608 'extractLane', Bool16x8ExtractLaneJS, | 770 'extractLane', Bool16x8ExtractLaneJS, |
609 'replaceLane', Bool16x8ReplaceLaneJS, | 771 'replaceLane', Bool16x8ReplaceLaneJS, |
610 'and', Bool16x8AndJS, | 772 'and', Bool16x8AndJS, |
611 'or', Bool16x8OrJS, | 773 'or', Bool16x8OrJS, |
612 'xor', Bool16x8XorJS, | 774 'xor', Bool16x8XorJS, |
613 'not', Bool16x8NotJS, | 775 'not', Bool16x8NotJS, |
614 'anyTrue', Bool16x8AnyTrueJS, | 776 'anyTrue', Bool16x8AnyTrueJS, |
615 'allTrue', Bool16x8AllTrueJS, | 777 'allTrue', Bool16x8AllTrueJS, |
616 'equal', Bool16x8EqualJS, | |
617 'notEqual', Bool16x8NotEqualJS, | |
618 'swizzle', Bool16x8SwizzleJS, | 778 'swizzle', Bool16x8SwizzleJS, |
619 'shuffle', Bool16x8ShuffleJS, | 779 'shuffle', Bool16x8ShuffleJS, |
620 ]); | 780 ]); |
621 | 781 |
622 utils.InstallFunctions(GlobalInt8x16, DONT_ENUM, [ | 782 utils.InstallFunctions(GlobalInt8x16, DONT_ENUM, [ |
623 'splat', Int8x16Splat, | 783 'splat', Int8x16Splat, |
624 'check', Int8x16CheckJS, | 784 'check', Int8x16CheckJS, |
625 'extractLane', Int8x16ExtractLaneJS, | 785 'extractLane', Int8x16ExtractLaneJS, |
626 'unsignedExtractLane', Int8x16UnsignedExtractLaneJS, | |
627 'replaceLane', Int8x16ReplaceLaneJS, | 786 'replaceLane', Int8x16ReplaceLaneJS, |
628 'neg', Int8x16NegJS, | 787 'neg', Int8x16NegJS, |
629 'add', Int8x16AddJS, | 788 'add', Int8x16AddJS, |
630 'sub', Int8x16SubJS, | 789 'sub', Int8x16SubJS, |
| 790 'addSaturate', Int8x16AddSaturateJS, |
| 791 'subSaturate', Int8x16SubSaturateJS, |
631 'mul', Int8x16MulJS, | 792 'mul', Int8x16MulJS, |
632 'min', Int8x16MinJS, | 793 'min', Int8x16MinJS, |
633 'max', Int8x16MaxJS, | 794 'max', Int8x16MaxJS, |
634 'and', Int8x16AndJS, | 795 'and', Int8x16AndJS, |
635 'or', Int8x16OrJS, | 796 'or', Int8x16OrJS, |
636 'xor', Int8x16XorJS, | 797 'xor', Int8x16XorJS, |
637 'not', Int8x16NotJS, | 798 'not', Int8x16NotJS, |
638 'shiftLeftByScalar', Int8x16ShiftLeftByScalarJS, | 799 'shiftLeftByScalar', Int8x16ShiftLeftByScalarJS, |
639 'shiftRightLogicalByScalar', Int8x16ShiftRightLogicalByScalarJS, | |
640 'shiftRightArithmeticByScalar', Int8x16ShiftRightArithmeticByScalarJS, | 800 'shiftRightArithmeticByScalar', Int8x16ShiftRightArithmeticByScalarJS, |
641 'lessThan', Int8x16LessThanJS, | 801 'lessThan', Int8x16LessThanJS, |
642 'lessThanOrEqual', Int8x16LessThanOrEqualJS, | 802 'lessThanOrEqual', Int8x16LessThanOrEqualJS, |
643 'greaterThan', Int8x16GreaterThanJS, | 803 'greaterThan', Int8x16GreaterThanJS, |
644 'greaterThanOrEqual', Int8x16GreaterThanOrEqualJS, | 804 'greaterThanOrEqual', Int8x16GreaterThanOrEqualJS, |
645 'equal', Int8x16EqualJS, | 805 'equal', Int8x16EqualJS, |
646 'notEqual', Int8x16NotEqualJS, | 806 'notEqual', Int8x16NotEqualJS, |
647 'select', Int8x16SelectJS, | 807 'select', Int8x16SelectJS, |
648 'swizzle', Int8x16SwizzleJS, | 808 'swizzle', Int8x16SwizzleJS, |
649 'shuffle', Int8x16ShuffleJS, | 809 'shuffle', Int8x16ShuffleJS, |
| 810 'fromUint8x16', Int8x16FromUint8x16JS, |
650 'fromFloat32x4Bits', Int8x16FromFloat32x4BitsJS, | 811 'fromFloat32x4Bits', Int8x16FromFloat32x4BitsJS, |
651 'fromInt32x4Bits', Int8x16FromInt32x4BitsJS, | 812 'fromInt32x4Bits', Int8x16FromInt32x4BitsJS, |
| 813 'fromUint32x4Bits', Int8x16FromUint32x4BitsJS, |
652 'fromInt16x8Bits', Int8x16FromInt16x8BitsJS, | 814 'fromInt16x8Bits', Int8x16FromInt16x8BitsJS, |
| 815 'fromUint16x8Bits', Int8x16FromUint16x8BitsJS, |
| 816 'fromUint8x16Bits', Int8x16FromUint8x16BitsJS, |
| 817 ]); |
| 818 |
| 819 utils.InstallFunctions(GlobalUint8x16, DONT_ENUM, [ |
| 820 'splat', Uint8x16Splat, |
| 821 'check', Uint8x16CheckJS, |
| 822 'extractLane', Uint8x16ExtractLaneJS, |
| 823 'replaceLane', Uint8x16ReplaceLaneJS, |
| 824 'add', Uint8x16AddJS, |
| 825 'sub', Uint8x16SubJS, |
| 826 'addSaturate', Uint8x16AddSaturateJS, |
| 827 'subSaturate', Uint8x16SubSaturateJS, |
| 828 'mul', Uint8x16MulJS, |
| 829 'min', Uint8x16MinJS, |
| 830 'max', Uint8x16MaxJS, |
| 831 'and', Uint8x16AndJS, |
| 832 'or', Uint8x16OrJS, |
| 833 'xor', Uint8x16XorJS, |
| 834 'not', Uint8x16NotJS, |
| 835 'shiftLeftByScalar', Uint8x16ShiftLeftByScalarJS, |
| 836 'shiftRightLogicalByScalar', Uint8x16ShiftRightLogicalByScalarJS, |
| 837 'horizontalSum', Uint8x16HorizontalSumJS, |
| 838 'absoluteDifference', Uint8x16AbsoluteDifferenceJS, |
| 839 'widenedAbsoluteDifference', Uint8x16WidenedAbsoluteDifferenceJS, |
| 840 'lessThan', Uint8x16LessThanJS, |
| 841 'lessThanOrEqual', Uint8x16LessThanOrEqualJS, |
| 842 'greaterThan', Uint8x16GreaterThanJS, |
| 843 'greaterThanOrEqual', Uint8x16GreaterThanOrEqualJS, |
| 844 'equal', Uint8x16EqualJS, |
| 845 'notEqual', Uint8x16NotEqualJS, |
| 846 'select', Uint8x16SelectJS, |
| 847 'swizzle', Uint8x16SwizzleJS, |
| 848 'shuffle', Uint8x16ShuffleJS, |
| 849 'fromInt8x16', Uint8x16FromInt8x16JS, |
| 850 'fromFloat32x4Bits', Uint8x16FromFloat32x4BitsJS, |
| 851 'fromInt32x4Bits', Uint8x16FromInt32x4BitsJS, |
| 852 'fromUint32x4Bits', Uint8x16FromUint32x4BitsJS, |
| 853 'fromInt16x8Bits', Uint8x16FromInt16x8BitsJS, |
| 854 'fromUint16x8Bits', Uint8x16FromUint16x8BitsJS, |
| 855 'fromInt8x16Bits', Uint8x16FromInt8x16BitsJS, |
653 ]); | 856 ]); |
654 | 857 |
655 utils.InstallFunctions(GlobalBool8x16, DONT_ENUM, [ | 858 utils.InstallFunctions(GlobalBool8x16, DONT_ENUM, [ |
656 'splat', Bool8x16Splat, | 859 'splat', Bool8x16Splat, |
657 'check', Bool8x16CheckJS, | 860 'check', Bool8x16CheckJS, |
658 'extractLane', Bool8x16ExtractLaneJS, | 861 'extractLane', Bool8x16ExtractLaneJS, |
659 'replaceLane', Bool8x16ReplaceLaneJS, | 862 'replaceLane', Bool8x16ReplaceLaneJS, |
660 'and', Bool8x16AndJS, | 863 'and', Bool8x16AndJS, |
661 'or', Bool8x16OrJS, | 864 'or', Bool8x16OrJS, |
662 'xor', Bool8x16XorJS, | 865 'xor', Bool8x16XorJS, |
663 'not', Bool8x16NotJS, | 866 'not', Bool8x16NotJS, |
664 'anyTrue', Bool8x16AnyTrueJS, | 867 'anyTrue', Bool8x16AnyTrueJS, |
665 'allTrue', Bool8x16AllTrueJS, | 868 'allTrue', Bool8x16AllTrueJS, |
666 'equal', Bool8x16EqualJS, | |
667 'notEqual', Bool8x16NotEqualJS, | |
668 'swizzle', Bool8x16SwizzleJS, | 869 'swizzle', Bool8x16SwizzleJS, |
669 'shuffle', Bool8x16ShuffleJS, | 870 'shuffle', Bool8x16ShuffleJS, |
670 ]); | 871 ]); |
671 | 872 |
672 utils.Export(function(to) { | 873 utils.Export(function(to) { |
673 to.Float32x4ToString = Float32x4ToString; | 874 to.Float32x4ToString = Float32x4ToString; |
674 to.Int32x4ToString = Int32x4ToString; | 875 to.Int32x4ToString = Int32x4ToString; |
| 876 to.Uint32x4ToString = Uint32x4ToString; |
675 to.Bool32x4ToString = Bool32x4ToString; | 877 to.Bool32x4ToString = Bool32x4ToString; |
676 to.Int16x8ToString = Int16x8ToString; | 878 to.Int16x8ToString = Int16x8ToString; |
| 879 to.Uint16x8ToString = Uint16x8ToString; |
677 to.Bool16x8ToString = Bool16x8ToString; | 880 to.Bool16x8ToString = Bool16x8ToString; |
678 to.Int8x16ToString = Int8x16ToString; | 881 to.Int8x16ToString = Int8x16ToString; |
| 882 to.Uint8x16ToString = Uint8x16ToString; |
679 to.Bool8x16ToString = Bool8x16ToString; | 883 to.Bool8x16ToString = Bool8x16ToString; |
680 }); | 884 }); |
681 | 885 |
682 }) | 886 }) |
OLD | NEW |