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