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
3 // found in the LICENSE file.
5 (function(global, utils) {
9 %CheckIsBootstrapping();
11 // -------------------------------------------------------------------
14 var GlobalSIMD = global.SIMD;
16 macro SIMD_FLOAT_TYPES(FUNCTION)
17 FUNCTION(Float32x4, float32x4, 4)
20 macro SIMD_INT_TYPES(FUNCTION)
21 FUNCTION(Int32x4, int32x4, 4)
22 FUNCTION(Int16x8, int16x8, 8)
23 FUNCTION(Int8x16, int8x16, 16)
26 macro SIMD_UINT_TYPES(FUNCTION)
27 FUNCTION(Uint32x4, uint32x4, 4)
28 FUNCTION(Uint16x8, uint16x8, 8)
29 FUNCTION(Uint8x16, uint8x16, 16)
32 macro SIMD_BOOL_TYPES(FUNCTION)
33 FUNCTION(Bool32x4, bool32x4, 4)
34 FUNCTION(Bool16x8, bool16x8, 8)
35 FUNCTION(Bool8x16, bool8x16, 16)
38 macro SIMD_ALL_TYPES(FUNCTION)
39 SIMD_FLOAT_TYPES(FUNCTION)
40 SIMD_INT_TYPES(FUNCTION)
41 SIMD_UINT_TYPES(FUNCTION)
42 SIMD_BOOL_TYPES(FUNCTION)
45 macro DECLARE_GLOBALS(NAME, TYPE, LANES)
46 var GlobalNAME = GlobalSIMD.NAME;
49 SIMD_ALL_TYPES(DECLARE_GLOBALS)
51 macro DECLARE_COMMON_FUNCTIONS(NAME, TYPE, LANES)
52 function NAMECheckJS(a) {
56 function NAMEToString() {
57 if (typeof(this) !== 'TYPE' && %_ClassOf(this) !== 'NAME') {
58 throw MakeTypeError(kIncompatibleMethodReceiver,
59 "NAME.prototype.toString", this);
61 var value = %_ValueOf(this);
62 var str = "SIMD.NAME(";
63 str += %NAMEExtractLane(value, 0);
64 for (var i = 1; i < LANES; i++) {
65 str += ", " + %NAMEExtractLane(value, i);
70 function NAMEToLocaleString() {
71 if (typeof(this) !== 'TYPE' && %_ClassOf(this) !== 'NAME') {
72 throw MakeTypeError(kIncompatibleMethodReceiver,
73 "NAME.prototype.toLocaleString", this);
75 var value = %_ValueOf(this);
76 var str = "SIMD.NAME(";
77 str += %NAMEExtractLane(value, 0).toLocaleString();
78 for (var i = 1; i < LANES; i++) {
79 str += ", " + %NAMEExtractLane(value, i).toLocaleString();
84 function NAMEValueOf() {
85 if (typeof(this) !== 'TYPE' && %_ClassOf(this) !== 'NAME') {
86 throw MakeTypeError(kIncompatibleMethodReceiver,
87 "NAME.prototype.valueOf", this);
89 return %_ValueOf(this);
92 function NAMEExtractLaneJS(instance, lane) {
93 return %NAMEExtractLane(instance, lane);
97 SIMD_ALL_TYPES(DECLARE_COMMON_FUNCTIONS)
99 macro DECLARE_INT_FUNCTIONS(NAME, TYPE, LANES)
100 function NAMEShiftLeftByScalarJS(instance, shift) {
101 return %NAMEShiftLeftByScalar(instance, shift);
104 function NAMEShiftRightArithmeticByScalarJS(instance, shift) {
105 return %NAMEShiftRightArithmeticByScalar(instance, shift);
109 SIMD_INT_TYPES(DECLARE_INT_FUNCTIONS)
111 macro DECLARE_UINT_FUNCTIONS(NAME, TYPE, LANES)
112 function NAMEShiftLeftByScalarJS(instance, shift) {
113 return %NAMEShiftLeftByScalar(instance, shift);
116 function NAMEShiftRightLogicalByScalarJS(instance, shift) {
117 return %NAMEShiftRightLogicalByScalar(instance, shift);
120 function NAMEHorizontalSumJS(instance) {
121 return %NAMEHorizontalSum(instance);
125 SIMD_UINT_TYPES(DECLARE_UINT_FUNCTIONS)
127 macro SIMD_SMALL_INT_TYPES(FUNCTION)
134 macro DECLARE_SMALL_INT_FUNCTIONS(NAME)
135 function NAMEAddSaturateJS(a, b) {
136 return %NAMEAddSaturate(a, b);
139 function NAMESubSaturateJS(a, b) {
140 return %NAMESubSaturate(a, b);
144 SIMD_SMALL_INT_TYPES(DECLARE_SMALL_INT_FUNCTIONS)
146 macro SIMD_SMALL_UINT_TYPES(FUNCTION)
151 macro DECLARE_SMALL_UINT_FUNCTIONS(NAME)
152 function NAMEAbsoluteDifferenceJS(a, b) {
153 return %NAMEAbsoluteDifference(a, b);
156 function NAMEWidenedAbsoluteDifferenceJS(a, b) {
157 return %NAMEWidenedAbsoluteDifference(a, b);
161 SIMD_SMALL_UINT_TYPES(DECLARE_SMALL_UINT_FUNCTIONS)
163 macro DECLARE_SIGNED_FUNCTIONS(NAME, TYPE, LANES)
164 function NAMENegJS(a) {
169 SIMD_FLOAT_TYPES(DECLARE_SIGNED_FUNCTIONS)
170 SIMD_INT_TYPES(DECLARE_SIGNED_FUNCTIONS)
172 macro DECLARE_BOOL_FUNCTIONS(NAME, TYPE, LANES)
173 function NAMEReplaceLaneJS(instance, lane, value) {
174 return %NAMEReplaceLane(instance, lane, value);
177 function NAMEAnyTrueJS(s) {
178 return %NAMEAnyTrue(s);
181 function NAMEAllTrueJS(s) {
182 return %NAMEAllTrue(s);
186 SIMD_BOOL_TYPES(DECLARE_BOOL_FUNCTIONS)
188 macro SIMD_NUMERIC_TYPES(FUNCTION)
189 SIMD_FLOAT_TYPES(FUNCTION)
190 SIMD_INT_TYPES(FUNCTION)
191 SIMD_UINT_TYPES(FUNCTION)
194 macro DECLARE_NUMERIC_FUNCTIONS(NAME, TYPE, LANES)
195 function NAMEReplaceLaneJS(instance, lane, value) {
196 return %NAMEReplaceLane(instance, lane, TO_NUMBER_INLINE(value));
199 function NAMESelectJS(selector, a, b) {
200 return %NAMESelect(selector, a, b);
203 function NAMEAddJS(a, b) {
204 return %NAMEAdd(a, b);
207 function NAMESubJS(a, b) {
208 return %NAMESub(a, b);
211 function NAMEMulJS(a, b) {
212 return %NAMEMul(a, b);
215 function NAMEMinJS(a, b) {
216 return %NAMEMin(a, b);
219 function NAMEMaxJS(a, b) {
220 return %NAMEMax(a, b);
223 function NAMEEqualJS(a, b) {
224 return %NAMEEqual(a, b);
227 function NAMENotEqualJS(a, b) {
228 return %NAMENotEqual(a, b);
231 function NAMELessThanJS(a, b) {
232 return %NAMELessThan(a, b);
235 function NAMELessThanOrEqualJS(a, b) {
236 return %NAMELessThanOrEqual(a, b);
239 function NAMEGreaterThanJS(a, b) {
240 return %NAMEGreaterThan(a, b);
243 function NAMEGreaterThanOrEqualJS(a, b) {
244 return %NAMEGreaterThanOrEqual(a, b);
248 SIMD_NUMERIC_TYPES(DECLARE_NUMERIC_FUNCTIONS)
250 macro SIMD_LOGICAL_TYPES(FUNCTION)
251 SIMD_INT_TYPES(FUNCTION)
252 SIMD_UINT_TYPES(FUNCTION)
253 SIMD_BOOL_TYPES(FUNCTION)
256 macro DECLARE_LOGICAL_FUNCTIONS(NAME, TYPE, LANES)
257 function NAMEAndJS(a, b) {
258 return %NAMEAnd(a, b);
261 function NAMEOrJS(a, b) {
262 return %NAMEOr(a, b);
265 function NAMEXorJS(a, b) {
266 return %NAMEXor(a, b);
269 function NAMENotJS(a) {
274 SIMD_LOGICAL_TYPES(DECLARE_LOGICAL_FUNCTIONS)
276 macro SIMD_FROM_TYPES(FUNCTION)
277 FUNCTION(Float32x4, Int32x4)
278 FUNCTION(Float32x4, Uint32x4)
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)
289 macro DECLARE_FROM_FUNCTIONS(TO, FROM)
290 function TOFromFROMJS(a) {
291 return %TOFromFROM(a);
295 SIMD_FROM_TYPES(DECLARE_FROM_FUNCTIONS)
297 macro SIMD_FROM_BITS_TYPES(FUNCTION)
298 FUNCTION(Float32x4, Int32x4)
299 FUNCTION(Float32x4, Uint32x4)
300 FUNCTION(Float32x4, Int16x8)
301 FUNCTION(Float32x4, Uint16x8)
302 FUNCTION(Float32x4, Int8x16)
303 FUNCTION(Float32x4, Uint8x16)
304 FUNCTION(Int32x4, Float32x4)
305 FUNCTION(Int32x4, Uint32x4)
306 FUNCTION(Int32x4, Int16x8)
307 FUNCTION(Int32x4, Uint16x8)
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)
316 FUNCTION(Int16x8, Float32x4)
317 FUNCTION(Int16x8, Int32x4)
318 FUNCTION(Int16x8, Uint32x4)
319 FUNCTION(Int16x8, Uint16x8)
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)
328 FUNCTION(Int8x16, Float32x4)
329 FUNCTION(Int8x16, Int32x4)
330 FUNCTION(Int8x16, Uint32x4)
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)
342 macro DECLARE_FROM_BITS_FUNCTIONS(TO, FROM)
343 function TOFromFROMBitsJS(a) {
344 return %TOFromFROMBits(a);
348 SIMD_FROM_BITS_TYPES(DECLARE_FROM_BITS_FUNCTIONS)
350 //-------------------------------------------------------------------
352 macro SIMD_X4_TYPES(FUNCTION)
359 macro DECLARE_X4_FUNCTIONS(NAME)
360 function NAMESplat(s) {
361 return %CreateNAME(s, s, s, s);
364 function NAMESwizzleJS(a, c0, c1, c2, c3) {
365 return %NAMESwizzle(a, c0, c1, c2, c3);
368 function NAMEShuffleJS(a, b, c0, c1, c2, c3) {
369 return %NAMEShuffle(a, b, c0, c1, c2, c3);
373 SIMD_X4_TYPES(DECLARE_X4_FUNCTIONS)
375 macro SIMD_X8_TYPES(FUNCTION)
381 macro DECLARE_X8_FUNCTIONS(NAME)
382 function NAMESplat(s) {
383 return %CreateNAME(s, s, s, s, s, s, s, s);
386 function NAMESwizzleJS(a, c0, c1, c2, c3, c4, c5, c6, c7) {
387 return %NAMESwizzle(a, c0, c1, c2, c3, c4, c5, c6, c7);
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);
395 SIMD_X8_TYPES(DECLARE_X8_FUNCTIONS)
397 macro SIMD_X16_TYPES(FUNCTION)
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);
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,
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);
421 SIMD_X16_TYPES(DECLARE_X16_FUNCTIONS)
423 //-------------------------------------------------------------------
425 function Float32x4Constructor(c0, c1, c2, c3) {
426 if (%_IsConstructCall()) throw MakeTypeError(kNotConstructor, "Float32x4");
427 return %CreateFloat32x4(TO_NUMBER_INLINE(c0), TO_NUMBER_INLINE(c1),
428 TO_NUMBER_INLINE(c2), TO_NUMBER_INLINE(c3));
432 function Int32x4Constructor(c0, c1, c2, c3) {
433 if (%_IsConstructCall()) throw MakeTypeError(kNotConstructor, "Int32x4");
434 return %CreateInt32x4(TO_NUMBER_INLINE(c0), TO_NUMBER_INLINE(c1),
435 TO_NUMBER_INLINE(c2), TO_NUMBER_INLINE(c3));
439 function Uint32x4Constructor(c0, c1, c2, c3) {
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));
446 function Bool32x4Constructor(c0, c1, c2, c3) {
447 if (%_IsConstructCall()) throw MakeTypeError(kNotConstructor, "Bool32x4");
448 return %CreateBool32x4(c0, c1, c2, c3);
452 function Int16x8Constructor(c0, c1, c2, c3, c4, c5, c6, c7) {
453 if (%_IsConstructCall()) throw MakeTypeError(kNotConstructor, "Int16x8");
454 return %CreateInt16x8(TO_NUMBER_INLINE(c0), TO_NUMBER_INLINE(c1),
455 TO_NUMBER_INLINE(c2), TO_NUMBER_INLINE(c3),
456 TO_NUMBER_INLINE(c4), TO_NUMBER_INLINE(c5),
457 TO_NUMBER_INLINE(c6), TO_NUMBER_INLINE(c7));
461 function Uint16x8Constructor(c0, c1, c2, c3, c4, c5, c6, c7) {
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));
470 function Bool16x8Constructor(c0, c1, c2, c3, c4, c5, c6, c7) {
471 if (%_IsConstructCall()) throw MakeTypeError(kNotConstructor, "Bool16x8");
472 return %CreateBool16x8(c0, c1, c2, c3, c4, c5, c6, c7);
476 function Int8x16Constructor(c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11,
477 c12, c13, c14, c15) {
478 if (%_IsConstructCall()) throw MakeTypeError(kNotConstructor, "Int8x16");
479 return %CreateInt8x16(TO_NUMBER_INLINE(c0), TO_NUMBER_INLINE(c1),
480 TO_NUMBER_INLINE(c2), TO_NUMBER_INLINE(c3),
481 TO_NUMBER_INLINE(c4), TO_NUMBER_INLINE(c5),
482 TO_NUMBER_INLINE(c6), TO_NUMBER_INLINE(c7),
483 TO_NUMBER_INLINE(c8), TO_NUMBER_INLINE(c9),
484 TO_NUMBER_INLINE(c10), TO_NUMBER_INLINE(c11),
485 TO_NUMBER_INLINE(c12), TO_NUMBER_INLINE(c13),
486 TO_NUMBER_INLINE(c14), TO_NUMBER_INLINE(c15));
490 function Uint8x16Constructor(c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11,
491 c12, c13, c14, c15) {
492 if (%_IsConstructCall()) throw MakeTypeError(kNotConstructor, "Uint8x16");
493 return %CreateUint8x16(TO_NUMBER_INLINE(c0), TO_NUMBER_INLINE(c1),
494 TO_NUMBER_INLINE(c2), TO_NUMBER_INLINE(c3),
495 TO_NUMBER_INLINE(c4), TO_NUMBER_INLINE(c5),
496 TO_NUMBER_INLINE(c6), TO_NUMBER_INLINE(c7),
497 TO_NUMBER_INLINE(c8), TO_NUMBER_INLINE(c9),
498 TO_NUMBER_INLINE(c10), TO_NUMBER_INLINE(c11),
499 TO_NUMBER_INLINE(c12), TO_NUMBER_INLINE(c13),
500 TO_NUMBER_INLINE(c14), TO_NUMBER_INLINE(c15));
504 function Bool8x16Constructor(c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11,
505 c12, c13, c14, c15) {
506 if (%_IsConstructCall()) throw MakeTypeError(kNotConstructor, "Bool8x16");
507 return %CreateBool8x16(c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12,
512 function Float32x4AbsJS(a) {
513 return %Float32x4Abs(a);
517 function Float32x4SqrtJS(a) {
518 return %Float32x4Sqrt(a);
522 function Float32x4RecipApproxJS(a) {
523 return %Float32x4RecipApprox(a);
527 function Float32x4RecipSqrtApproxJS(a) {
528 return %Float32x4RecipSqrtApprox(a);
532 function Float32x4DivJS(a, b) {
533 return %Float32x4Div(a, b);
537 function Float32x4MinNumJS(a, b) {
538 return %Float32x4MinNum(a, b);
542 function Float32x4MaxNumJS(a, b) {
543 return %Float32x4MaxNum(a, b);
547 %AddNamedProperty(GlobalSIMD, symbolToStringTag, 'SIMD', READ_ONLY | DONT_ENUM);
549 macro SETUP_SIMD_TYPE(NAME, TYPE, LANES)
550 %SetCode(GlobalNAME, NAMEConstructor);
551 %FunctionSetPrototype(GlobalNAME, {});
552 %AddNamedProperty(GlobalNAME.prototype, 'constructor', GlobalNAME,
554 %AddNamedProperty(GlobalNAME.prototype, symbolToStringTag, 'NAME',
555 DONT_ENUM | READ_ONLY);
556 utils.InstallFunctions(GlobalNAME.prototype, DONT_ENUM, [
557 'toLocaleString', NAMEToLocaleString,
558 'toString', NAMEToString,
559 'valueOf', NAMEValueOf,
563 SIMD_ALL_TYPES(SETUP_SIMD_TYPE)
565 //-------------------------------------------------------------------
567 utils.InstallFunctions(GlobalFloat32x4, DONT_ENUM, [
568 'splat', Float32x4Splat,
569 'check', Float32x4CheckJS,
570 'extractLane', Float32x4ExtractLaneJS,
571 'replaceLane', Float32x4ReplaceLaneJS,
572 'neg', Float32x4NegJS,
573 'abs', Float32x4AbsJS,
574 'sqrt', Float32x4SqrtJS,
575 'reciprocalApproximation', Float32x4RecipApproxJS,
576 'reciprocalSqrtApproximation', Float32x4RecipSqrtApproxJS,
577 'add', Float32x4AddJS,
578 'sub', Float32x4SubJS,
579 'mul', Float32x4MulJS,
580 'div', Float32x4DivJS,
581 'min', Float32x4MinJS,
582 'max', Float32x4MaxJS,
583 'minNum', Float32x4MinNumJS,
584 'maxNum', Float32x4MaxNumJS,
585 'lessThan', Float32x4LessThanJS,
586 'lessThanOrEqual', Float32x4LessThanOrEqualJS,
587 'greaterThan', Float32x4GreaterThanJS,
588 'greaterThanOrEqual', Float32x4GreaterThanOrEqualJS,
589 'equal', Float32x4EqualJS,
590 'notEqual', Float32x4NotEqualJS,
591 'select', Float32x4SelectJS,
592 'swizzle', Float32x4SwizzleJS,
593 'shuffle', Float32x4ShuffleJS,
594 'fromInt32x4', Float32x4FromInt32x4JS,
595 'fromUint32x4', Float32x4FromUint32x4JS,
596 'fromInt32x4Bits', Float32x4FromInt32x4BitsJS,
597 'fromUint32x4Bits', Float32x4FromUint32x4BitsJS,
598 'fromInt16x8Bits', Float32x4FromInt16x8BitsJS,
599 'fromUint16x8Bits', Float32x4FromUint16x8BitsJS,
600 'fromInt8x16Bits', Float32x4FromInt8x16BitsJS,
601 'fromUint8x16Bits', Float32x4FromUint8x16BitsJS,
604 utils.InstallFunctions(GlobalInt32x4, DONT_ENUM, [
605 'splat', Int32x4Splat,
606 'check', Int32x4CheckJS,
607 'extractLane', Int32x4ExtractLaneJS,
608 'replaceLane', Int32x4ReplaceLaneJS,
619 'shiftLeftByScalar', Int32x4ShiftLeftByScalarJS,
620 'shiftRightArithmeticByScalar', Int32x4ShiftRightArithmeticByScalarJS,
621 'lessThan', Int32x4LessThanJS,
622 'lessThanOrEqual', Int32x4LessThanOrEqualJS,
623 'greaterThan', Int32x4GreaterThanJS,
624 'greaterThanOrEqual', Int32x4GreaterThanOrEqualJS,
625 'equal', Int32x4EqualJS,
626 'notEqual', Int32x4NotEqualJS,
627 'select', Int32x4SelectJS,
628 'swizzle', Int32x4SwizzleJS,
629 'shuffle', Int32x4ShuffleJS,
630 'fromFloat32x4', Int32x4FromFloat32x4JS,
631 'fromUint32x4', Int32x4FromUint32x4JS,
632 'fromFloat32x4Bits', Int32x4FromFloat32x4BitsJS,
633 'fromUint32x4Bits', Int32x4FromUint32x4BitsJS,
634 'fromInt16x8Bits', Int32x4FromInt16x8BitsJS,
635 'fromUint16x8Bits', Int32x4FromUint16x8BitsJS,
636 'fromInt8x16Bits', Int32x4FromInt8x16BitsJS,
637 'fromUint8x16Bits', Int32x4FromUint8x16BitsJS,
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,
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,
676 utils.InstallFunctions(GlobalBool32x4, DONT_ENUM, [
677 'splat', Bool32x4Splat,
678 'check', Bool32x4CheckJS,
679 'extractLane', Bool32x4ExtractLaneJS,
680 'replaceLane', Bool32x4ReplaceLaneJS,
681 'and', Bool32x4AndJS,
683 'xor', Bool32x4XorJS,
684 'not', Bool32x4NotJS,
685 'anyTrue', Bool32x4AnyTrueJS,
686 'allTrue', Bool32x4AllTrueJS,
687 'swizzle', Bool32x4SwizzleJS,
688 'shuffle', Bool32x4ShuffleJS,
691 utils.InstallFunctions(GlobalInt16x8, DONT_ENUM, [
692 'splat', Int16x8Splat,
693 'check', Int16x8CheckJS,
694 'extractLane', Int16x8ExtractLaneJS,
695 'replaceLane', Int16x8ReplaceLaneJS,
699 'addSaturate', Int16x8AddSaturateJS,
700 'subSaturate', Int16x8SubSaturateJS,
708 'shiftLeftByScalar', Int16x8ShiftLeftByScalarJS,
709 'shiftRightArithmeticByScalar', Int16x8ShiftRightArithmeticByScalarJS,
710 'lessThan', Int16x8LessThanJS,
711 'lessThanOrEqual', Int16x8LessThanOrEqualJS,
712 'greaterThan', Int16x8GreaterThanJS,
713 'greaterThanOrEqual', Int16x8GreaterThanOrEqualJS,
714 'equal', Int16x8EqualJS,
715 'notEqual', Int16x8NotEqualJS,
716 'select', Int16x8SelectJS,
717 'swizzle', Int16x8SwizzleJS,
718 'shuffle', Int16x8ShuffleJS,
719 'fromUint16x8', Int16x8FromUint16x8JS,
720 'fromFloat32x4Bits', Int16x8FromFloat32x4BitsJS,
721 'fromInt32x4Bits', Int16x8FromInt32x4BitsJS,
722 'fromUint32x4Bits', Int16x8FromUint32x4BitsJS,
723 'fromUint16x8Bits', Int16x8FromUint16x8BitsJS,
724 'fromInt8x16Bits', Int16x8FromInt8x16BitsJS,
725 'fromUint8x16Bits', Int16x8FromUint8x16BitsJS,
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,
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,
767 utils.InstallFunctions(GlobalBool16x8, DONT_ENUM, [
768 'splat', Bool16x8Splat,
769 'check', Bool16x8CheckJS,
770 'extractLane', Bool16x8ExtractLaneJS,
771 'replaceLane', Bool16x8ReplaceLaneJS,
772 'and', Bool16x8AndJS,
774 'xor', Bool16x8XorJS,
775 'not', Bool16x8NotJS,
776 'anyTrue', Bool16x8AnyTrueJS,
777 'allTrue', Bool16x8AllTrueJS,
778 'swizzle', Bool16x8SwizzleJS,
779 'shuffle', Bool16x8ShuffleJS,
782 utils.InstallFunctions(GlobalInt8x16, DONT_ENUM, [
783 'splat', Int8x16Splat,
784 'check', Int8x16CheckJS,
785 'extractLane', Int8x16ExtractLaneJS,
786 'replaceLane', Int8x16ReplaceLaneJS,
790 'addSaturate', Int8x16AddSaturateJS,
791 'subSaturate', Int8x16SubSaturateJS,
799 'shiftLeftByScalar', Int8x16ShiftLeftByScalarJS,
800 'shiftRightArithmeticByScalar', Int8x16ShiftRightArithmeticByScalarJS,
801 'lessThan', Int8x16LessThanJS,
802 'lessThanOrEqual', Int8x16LessThanOrEqualJS,
803 'greaterThan', Int8x16GreaterThanJS,
804 'greaterThanOrEqual', Int8x16GreaterThanOrEqualJS,
805 'equal', Int8x16EqualJS,
806 'notEqual', Int8x16NotEqualJS,
807 'select', Int8x16SelectJS,
808 'swizzle', Int8x16SwizzleJS,
809 'shuffle', Int8x16ShuffleJS,
810 'fromUint8x16', Int8x16FromUint8x16JS,
811 'fromFloat32x4Bits', Int8x16FromFloat32x4BitsJS,
812 'fromInt32x4Bits', Int8x16FromInt32x4BitsJS,
813 'fromUint32x4Bits', Int8x16FromUint32x4BitsJS,
814 'fromInt16x8Bits', Int8x16FromInt16x8BitsJS,
815 'fromUint16x8Bits', Int8x16FromUint16x8BitsJS,
816 'fromUint8x16Bits', Int8x16FromUint8x16BitsJS,
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,
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,
858 utils.InstallFunctions(GlobalBool8x16, DONT_ENUM, [
859 'splat', Bool8x16Splat,
860 'check', Bool8x16CheckJS,
861 'extractLane', Bool8x16ExtractLaneJS,
862 'replaceLane', Bool8x16ReplaceLaneJS,
863 'and', Bool8x16AndJS,
865 'xor', Bool8x16XorJS,
866 'not', Bool8x16NotJS,
867 'anyTrue', Bool8x16AnyTrueJS,
868 'allTrue', Bool8x16AllTrueJS,
869 'swizzle', Bool8x16SwizzleJS,
870 'shuffle', Bool8x16ShuffleJS,
873 utils.Export(function(to) {
874 to.Float32x4ToString = Float32x4ToString;
875 to.Int32x4ToString = Int32x4ToString;
876 to.Uint32x4ToString = Uint32x4ToString;
877 to.Bool32x4ToString = Bool32x4ToString;
878 to.Int16x8ToString = Int16x8ToString;
879 to.Uint16x8ToString = Uint16x8ToString;
880 to.Bool16x8ToString = Bool16x8ToString;
881 to.Int8x16ToString = Int8x16ToString;
882 to.Uint8x16ToString = Uint8x16ToString;
883 to.Bool8x16ToString = Bool8x16ToString;