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 |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 SIMD_BOOL_TYPES(DECLARE_BOOL_FUNCTIONS) | 155 SIMD_BOOL_TYPES(DECLARE_BOOL_FUNCTIONS) |
156 | 156 |
157 macro SIMD_NUMERIC_TYPES(FUNCTION) | 157 macro SIMD_NUMERIC_TYPES(FUNCTION) |
158 SIMD_FLOAT_TYPES(FUNCTION) | 158 SIMD_FLOAT_TYPES(FUNCTION) |
159 SIMD_INT_TYPES(FUNCTION) | 159 SIMD_INT_TYPES(FUNCTION) |
160 SIMD_UINT_TYPES(FUNCTION) | 160 SIMD_UINT_TYPES(FUNCTION) |
161 endmacro | 161 endmacro |
162 | 162 |
163 macro DECLARE_NUMERIC_FUNCTIONS(NAME, TYPE, LANES) | 163 macro DECLARE_NUMERIC_FUNCTIONS(NAME, TYPE, LANES) |
164 function NAMEReplaceLaneJS(instance, lane, value) { | 164 function NAMEReplaceLaneJS(instance, lane, value) { |
165 return %NAMEReplaceLane(instance, lane, TO_NUMBER_INLINE(value)); | 165 return %NAMEReplaceLane(instance, lane, TO_NUMBER(value)); |
166 } | 166 } |
167 | 167 |
168 function NAMESelectJS(selector, a, b) { | 168 function NAMESelectJS(selector, a, b) { |
169 return %NAMESelect(selector, a, b); | 169 return %NAMESelect(selector, a, b); |
170 } | 170 } |
171 | 171 |
172 function NAMEAddJS(a, b) { | 172 function NAMEAddJS(a, b) { |
173 return %NAMEAdd(a, b); | 173 return %NAMEAdd(a, b); |
174 } | 174 } |
175 | 175 |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
419 c11, c12, c13, c14, c15); | 419 c11, c12, c13, c14, c15); |
420 } | 420 } |
421 endmacro | 421 endmacro |
422 | 422 |
423 SIMD_X16_TYPES(DECLARE_X16_FUNCTIONS) | 423 SIMD_X16_TYPES(DECLARE_X16_FUNCTIONS) |
424 | 424 |
425 //------------------------------------------------------------------- | 425 //------------------------------------------------------------------- |
426 | 426 |
427 function Float32x4Constructor(c0, c1, c2, c3) { | 427 function Float32x4Constructor(c0, c1, c2, c3) { |
428 if (%_IsConstructCall()) throw MakeTypeError(kNotConstructor, "Float32x4"); | 428 if (%_IsConstructCall()) throw MakeTypeError(kNotConstructor, "Float32x4"); |
429 return %CreateFloat32x4(TO_NUMBER_INLINE(c0), TO_NUMBER_INLINE(c1), | 429 return %CreateFloat32x4(TO_NUMBER(c0), TO_NUMBER(c1), |
430 TO_NUMBER_INLINE(c2), TO_NUMBER_INLINE(c3)); | 430 TO_NUMBER(c2), TO_NUMBER(c3)); |
431 } | 431 } |
432 | 432 |
433 | 433 |
434 function Int32x4Constructor(c0, c1, c2, c3) { | 434 function Int32x4Constructor(c0, c1, c2, c3) { |
435 if (%_IsConstructCall()) throw MakeTypeError(kNotConstructor, "Int32x4"); | 435 if (%_IsConstructCall()) throw MakeTypeError(kNotConstructor, "Int32x4"); |
436 return %CreateInt32x4(TO_NUMBER_INLINE(c0), TO_NUMBER_INLINE(c1), | 436 return %CreateInt32x4(TO_NUMBER(c0), TO_NUMBER(c1), |
437 TO_NUMBER_INLINE(c2), TO_NUMBER_INLINE(c3)); | 437 TO_NUMBER(c2), TO_NUMBER(c3)); |
438 } | 438 } |
439 | 439 |
440 | 440 |
441 function Uint32x4Constructor(c0, c1, c2, c3) { | 441 function Uint32x4Constructor(c0, c1, c2, c3) { |
442 if (%_IsConstructCall()) throw MakeTypeError(kNotConstructor, "Uint32x4"); | 442 if (%_IsConstructCall()) throw MakeTypeError(kNotConstructor, "Uint32x4"); |
443 return %CreateUint32x4(TO_NUMBER_INLINE(c0), TO_NUMBER_INLINE(c1), | 443 return %CreateUint32x4(TO_NUMBER(c0), TO_NUMBER(c1), |
444 TO_NUMBER_INLINE(c2), TO_NUMBER_INLINE(c3)); | 444 TO_NUMBER(c2), TO_NUMBER(c3)); |
445 } | 445 } |
446 | 446 |
447 | 447 |
448 function Bool32x4Constructor(c0, c1, c2, c3) { | 448 function Bool32x4Constructor(c0, c1, c2, c3) { |
449 if (%_IsConstructCall()) throw MakeTypeError(kNotConstructor, "Bool32x4"); | 449 if (%_IsConstructCall()) throw MakeTypeError(kNotConstructor, "Bool32x4"); |
450 return %CreateBool32x4(c0, c1, c2, c3); | 450 return %CreateBool32x4(c0, c1, c2, c3); |
451 } | 451 } |
452 | 452 |
453 | 453 |
454 function Int16x8Constructor(c0, c1, c2, c3, c4, c5, c6, c7) { | 454 function Int16x8Constructor(c0, c1, c2, c3, c4, c5, c6, c7) { |
455 if (%_IsConstructCall()) throw MakeTypeError(kNotConstructor, "Int16x8"); | 455 if (%_IsConstructCall()) throw MakeTypeError(kNotConstructor, "Int16x8"); |
456 return %CreateInt16x8(TO_NUMBER_INLINE(c0), TO_NUMBER_INLINE(c1), | 456 return %CreateInt16x8(TO_NUMBER(c0), TO_NUMBER(c1), |
457 TO_NUMBER_INLINE(c2), TO_NUMBER_INLINE(c3), | 457 TO_NUMBER(c2), TO_NUMBER(c3), |
458 TO_NUMBER_INLINE(c4), TO_NUMBER_INLINE(c5), | 458 TO_NUMBER(c4), TO_NUMBER(c5), |
459 TO_NUMBER_INLINE(c6), TO_NUMBER_INLINE(c7)); | 459 TO_NUMBER(c6), TO_NUMBER(c7)); |
460 } | 460 } |
461 | 461 |
462 | 462 |
463 function Uint16x8Constructor(c0, c1, c2, c3, c4, c5, c6, c7) { | 463 function Uint16x8Constructor(c0, c1, c2, c3, c4, c5, c6, c7) { |
464 if (%_IsConstructCall()) throw MakeTypeError(kNotConstructor, "Uint16x8"); | 464 if (%_IsConstructCall()) throw MakeTypeError(kNotConstructor, "Uint16x8"); |
465 return %CreateUint16x8(TO_NUMBER_INLINE(c0), TO_NUMBER_INLINE(c1), | 465 return %CreateUint16x8(TO_NUMBER(c0), TO_NUMBER(c1), |
466 TO_NUMBER_INLINE(c2), TO_NUMBER_INLINE(c3), | 466 TO_NUMBER(c2), TO_NUMBER(c3), |
467 TO_NUMBER_INLINE(c4), TO_NUMBER_INLINE(c5), | 467 TO_NUMBER(c4), TO_NUMBER(c5), |
468 TO_NUMBER_INLINE(c6), TO_NUMBER_INLINE(c7)); | 468 TO_NUMBER(c6), TO_NUMBER(c7)); |
469 } | 469 } |
470 | 470 |
471 | 471 |
472 function Bool16x8Constructor(c0, c1, c2, c3, c4, c5, c6, c7) { | 472 function Bool16x8Constructor(c0, c1, c2, c3, c4, c5, c6, c7) { |
473 if (%_IsConstructCall()) throw MakeTypeError(kNotConstructor, "Bool16x8"); | 473 if (%_IsConstructCall()) throw MakeTypeError(kNotConstructor, "Bool16x8"); |
474 return %CreateBool16x8(c0, c1, c2, c3, c4, c5, c6, c7); | 474 return %CreateBool16x8(c0, c1, c2, c3, c4, c5, c6, c7); |
475 } | 475 } |
476 | 476 |
477 | 477 |
478 function Int8x16Constructor(c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, | 478 function Int8x16Constructor(c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, |
479 c12, c13, c14, c15) { | 479 c12, c13, c14, c15) { |
480 if (%_IsConstructCall()) throw MakeTypeError(kNotConstructor, "Int8x16"); | 480 if (%_IsConstructCall()) throw MakeTypeError(kNotConstructor, "Int8x16"); |
481 return %CreateInt8x16(TO_NUMBER_INLINE(c0), TO_NUMBER_INLINE(c1), | 481 return %CreateInt8x16(TO_NUMBER(c0), TO_NUMBER(c1), |
482 TO_NUMBER_INLINE(c2), TO_NUMBER_INLINE(c3), | 482 TO_NUMBER(c2), TO_NUMBER(c3), |
483 TO_NUMBER_INLINE(c4), TO_NUMBER_INLINE(c5), | 483 TO_NUMBER(c4), TO_NUMBER(c5), |
484 TO_NUMBER_INLINE(c6), TO_NUMBER_INLINE(c7), | 484 TO_NUMBER(c6), TO_NUMBER(c7), |
485 TO_NUMBER_INLINE(c8), TO_NUMBER_INLINE(c9), | 485 TO_NUMBER(c8), TO_NUMBER(c9), |
486 TO_NUMBER_INLINE(c10), TO_NUMBER_INLINE(c11), | 486 TO_NUMBER(c10), TO_NUMBER(c11), |
487 TO_NUMBER_INLINE(c12), TO_NUMBER_INLINE(c13), | 487 TO_NUMBER(c12), TO_NUMBER(c13), |
488 TO_NUMBER_INLINE(c14), TO_NUMBER_INLINE(c15)); | 488 TO_NUMBER(c14), TO_NUMBER(c15)); |
489 } | 489 } |
490 | 490 |
491 | 491 |
492 function Uint8x16Constructor(c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, | 492 function Uint8x16Constructor(c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, |
493 c12, c13, c14, c15) { | 493 c12, c13, c14, c15) { |
494 if (%_IsConstructCall()) throw MakeTypeError(kNotConstructor, "Uint8x16"); | 494 if (%_IsConstructCall()) throw MakeTypeError(kNotConstructor, "Uint8x16"); |
495 return %CreateUint8x16(TO_NUMBER_INLINE(c0), TO_NUMBER_INLINE(c1), | 495 return %CreateUint8x16(TO_NUMBER(c0), TO_NUMBER(c1), |
496 TO_NUMBER_INLINE(c2), TO_NUMBER_INLINE(c3), | 496 TO_NUMBER(c2), TO_NUMBER(c3), |
497 TO_NUMBER_INLINE(c4), TO_NUMBER_INLINE(c5), | 497 TO_NUMBER(c4), TO_NUMBER(c5), |
498 TO_NUMBER_INLINE(c6), TO_NUMBER_INLINE(c7), | 498 TO_NUMBER(c6), TO_NUMBER(c7), |
499 TO_NUMBER_INLINE(c8), TO_NUMBER_INLINE(c9), | 499 TO_NUMBER(c8), TO_NUMBER(c9), |
500 TO_NUMBER_INLINE(c10), TO_NUMBER_INLINE(c11), | 500 TO_NUMBER(c10), TO_NUMBER(c11), |
501 TO_NUMBER_INLINE(c12), TO_NUMBER_INLINE(c13), | 501 TO_NUMBER(c12), TO_NUMBER(c13), |
502 TO_NUMBER_INLINE(c14), TO_NUMBER_INLINE(c15)); | 502 TO_NUMBER(c14), TO_NUMBER(c15)); |
503 } | 503 } |
504 | 504 |
505 | 505 |
506 function Bool8x16Constructor(c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, | 506 function Bool8x16Constructor(c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, |
507 c12, c13, c14, c15) { | 507 c12, c13, c14, c15) { |
508 if (%_IsConstructCall()) throw MakeTypeError(kNotConstructor, "Bool8x16"); | 508 if (%_IsConstructCall()) throw MakeTypeError(kNotConstructor, "Bool8x16"); |
509 return %CreateBool8x16(c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, | 509 return %CreateBool8x16(c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, |
510 c13, c14, c15); | 510 c13, c14, c15); |
511 } | 511 } |
512 | 512 |
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
904 to.Bool32x4ToString = Bool32x4ToString; | 904 to.Bool32x4ToString = Bool32x4ToString; |
905 to.Int16x8ToString = Int16x8ToString; | 905 to.Int16x8ToString = Int16x8ToString; |
906 to.Uint16x8ToString = Uint16x8ToString; | 906 to.Uint16x8ToString = Uint16x8ToString; |
907 to.Bool16x8ToString = Bool16x8ToString; | 907 to.Bool16x8ToString = Bool16x8ToString; |
908 to.Int8x16ToString = Int8x16ToString; | 908 to.Int8x16ToString = Int8x16ToString; |
909 to.Uint8x16ToString = Uint8x16ToString; | 909 to.Uint8x16ToString = Uint8x16ToString; |
910 to.Bool8x16ToString = Bool8x16ToString; | 910 to.Bool8x16ToString = Bool8x16ToString; |
911 }); | 911 }); |
912 | 912 |
913 }) | 913 }) |
OLD | NEW |