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 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
312 function Float32x4SwizzleJS(a, c0, c1, c2, c3) { | 312 function Float32x4SwizzleJS(a, c0, c1, c2, c3) { |
313 return %Float32x4Swizzle(a, c0, c1, c2, c3); | 313 return %Float32x4Swizzle(a, c0, c1, c2, c3); |
314 } | 314 } |
315 | 315 |
316 | 316 |
317 function Float32x4ShuffleJS(a, b, c0, c1, c2, c3) { | 317 function Float32x4ShuffleJS(a, b, c0, c1, c2, c3) { |
318 return %Float32x4Shuffle(a, b, c0, c1, c2, c3); | 318 return %Float32x4Shuffle(a, b, c0, c1, c2, c3); |
319 } | 319 } |
320 | 320 |
321 | 321 |
322 function Float32x4LoadJS(tarray, index) { | |
323 return %Float32x4Load(tarray, index); | |
324 } | |
325 | |
326 | |
327 function Float32x4Load1JS(tarray, index) { | |
328 return %Float32x4Load1(tarray, index); | |
329 } | |
330 | |
331 | |
332 function Float32x4Load2JS(tarray, index) { | |
333 return %Float32x4Load2(tarray, index); | |
334 } | |
335 | |
336 | |
337 function Float32x4Load3JS(tarray, index) { | |
338 return %Float32x4Load3(tarray, index); | |
339 } | |
bbudge
2015/08/20 18:23:34
You should be able to use the V8 macro system on t
gdeepti
2015/08/20 22:09:24
Done.
| |
340 | |
341 | |
322 function Int32x4Constructor(c0, c1, c2, c3) { | 342 function Int32x4Constructor(c0, c1, c2, c3) { |
323 if (%_IsConstructCall()) throw MakeTypeError(kNotConstructor, "Int32x4"); | 343 if (%_IsConstructCall()) throw MakeTypeError(kNotConstructor, "Int32x4"); |
324 return %CreateInt32x4(TO_NUMBER_INLINE(c0), TO_NUMBER_INLINE(c1), | 344 return %CreateInt32x4(TO_NUMBER_INLINE(c0), TO_NUMBER_INLINE(c1), |
325 TO_NUMBER_INLINE(c2), TO_NUMBER_INLINE(c3)); | 345 TO_NUMBER_INLINE(c2), TO_NUMBER_INLINE(c3)); |
326 } | 346 } |
327 | 347 |
328 | 348 |
329 function Int32x4Splat(s) { | 349 function Int32x4Splat(s) { |
330 return %CreateInt32x4(s, s, s, s); | 350 return %CreateInt32x4(s, s, s, s); |
331 } | 351 } |
332 | 352 |
333 | 353 |
334 function Int32x4SwizzleJS(a, c0, c1, c2, c3) { | 354 function Int32x4SwizzleJS(a, c0, c1, c2, c3) { |
335 return %Int32x4Swizzle(a, c0, c1, c2, c3); | 355 return %Int32x4Swizzle(a, c0, c1, c2, c3); |
336 } | 356 } |
337 | 357 |
338 | 358 |
339 function Int32x4ShuffleJS(a, b, c0, c1, c2, c3) { | 359 function Int32x4ShuffleJS(a, b, c0, c1, c2, c3) { |
340 return %Int32x4Shuffle(a, b, c0, c1, c2, c3); | 360 return %Int32x4Shuffle(a, b, c0, c1, c2, c3); |
341 } | 361 } |
342 | 362 |
343 | 363 |
364 function Int32x4LoadJS(tarray, index) { | |
365 return %Int32x4Load(tarray, index); | |
366 } | |
367 | |
368 | |
369 function Int32x4Load1JS(tarray, index) { | |
370 return %Int32x4Load1(tarray, index); | |
371 } | |
372 | |
373 | |
374 function Int32x4Load2JS(tarray, index) { | |
375 return %Int32x4Load2(tarray, index); | |
376 } | |
377 | |
378 | |
379 function Int32x4Load3JS(tarray, index) { | |
380 return %Int32x4Load3(tarray, index); | |
381 } | |
382 | |
383 | |
344 function Bool32x4Constructor(c0, c1, c2, c3) { | 384 function Bool32x4Constructor(c0, c1, c2, c3) { |
345 if (%_IsConstructCall()) throw MakeTypeError(kNotConstructor, "Bool32x4"); | 385 if (%_IsConstructCall()) throw MakeTypeError(kNotConstructor, "Bool32x4"); |
346 return %CreateBool32x4(c0, c1, c2, c3); | 386 return %CreateBool32x4(c0, c1, c2, c3); |
347 } | 387 } |
348 | 388 |
349 | 389 |
350 function Bool32x4Splat(s) { | 390 function Bool32x4Splat(s) { |
351 return %CreateBool32x4(s, s, s, s); | 391 return %CreateBool32x4(s, s, s, s); |
352 } | 392 } |
353 | 393 |
(...skipping 24 matching lines...) Expand all Loading... | |
378 function Int16x8SwizzleJS(a, c0, c1, c2, c3, c4, c5, c6, c7) { | 418 function Int16x8SwizzleJS(a, c0, c1, c2, c3, c4, c5, c6, c7) { |
379 return %Int16x8Swizzle(a, c0, c1, c2, c3, c4, c5, c6, c7); | 419 return %Int16x8Swizzle(a, c0, c1, c2, c3, c4, c5, c6, c7); |
380 } | 420 } |
381 | 421 |
382 | 422 |
383 function Int16x8ShuffleJS(a, b, c0, c1, c2, c3, c4, c5, c6, c7) { | 423 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); | 424 return %Int16x8Shuffle(a, b, c0, c1, c2, c3, c4, c5, c6, c7); |
385 } | 425 } |
386 | 426 |
387 | 427 |
428 function Int16x8LoadJS(tarray, index) { | |
429 return %Int16x8Load(tarray, index); | |
430 } | |
431 | |
432 | |
433 function Int16x8Load1JS(tarray, index) { | |
434 return %Int16x8Load1(tarray, index); | |
435 } | |
436 | |
437 | |
438 function Int16x8Load2JS(tarray, index) { | |
439 return %Int16x8Load2(tarray, index); | |
440 } | |
441 | |
442 | |
443 function Int16x8Load3JS(tarray, index) { | |
444 return %Int16x8Load3(tarray, index); | |
445 } | |
446 | |
447 | |
388 function Bool16x8Constructor(c0, c1, c2, c3, c4, c5, c6, c7) { | 448 function Bool16x8Constructor(c0, c1, c2, c3, c4, c5, c6, c7) { |
389 if (%_IsConstructCall()) throw MakeTypeError(kNotConstructor, "Bool16x8"); | 449 if (%_IsConstructCall()) throw MakeTypeError(kNotConstructor, "Bool16x8"); |
390 return %CreateBool16x8(c0, c1, c2, c3, c4, c5, c6, c7); | 450 return %CreateBool16x8(c0, c1, c2, c3, c4, c5, c6, c7); |
391 } | 451 } |
392 | 452 |
393 | 453 |
394 function Bool16x8Splat(s) { | 454 function Bool16x8Splat(s) { |
395 return %CreateBool16x8(s, s, s, s, s, s, s, s); | 455 return %CreateBool16x8(s, s, s, s, s, s, s, s); |
396 } | 456 } |
397 | 457 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
432 } | 492 } |
433 | 493 |
434 | 494 |
435 function Int8x16ShuffleJS(a, b, c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, | 495 function Int8x16ShuffleJS(a, b, c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, |
436 c11, c12, c13, c14, c15) { | 496 c11, c12, c13, c14, c15) { |
437 return %Int8x16Shuffle(a, b, c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, | 497 return %Int8x16Shuffle(a, b, c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, |
438 c11, c12, c13, c14, c15); | 498 c11, c12, c13, c14, c15); |
439 } | 499 } |
440 | 500 |
441 | 501 |
502 function Int8x16LoadJS(tarray, index) { | |
503 return %Int8x16Load(tarray, index); | |
504 } | |
505 | |
506 | |
507 function Int8x16Load1JS(tarray, index) { | |
508 return %Int8x16Load1(tarray, index); | |
509 } | |
510 | |
511 | |
512 function Int8x16Load2JS(tarray, index) { | |
513 return %Int8x16Load2(tarray, index); | |
514 } | |
515 | |
516 | |
517 function Int8x16Load3JS(tarray, index) { | |
518 return %Int8x16Load3(tarray, index); | |
519 } | |
520 | |
521 | |
442 function Bool8x16Constructor(c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, | 522 function Bool8x16Constructor(c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, |
443 c12, c13, c14, c15) { | 523 c12, c13, c14, c15) { |
444 if (%_IsConstructCall()) throw MakeTypeError(kNotConstructor, "Bool8x16"); | 524 if (%_IsConstructCall()) throw MakeTypeError(kNotConstructor, "Bool8x16"); |
445 return %CreateBool8x16(c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, | 525 return %CreateBool8x16(c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, |
446 c13, c14, c15); | 526 c13, c14, c15); |
447 } | 527 } |
448 | 528 |
449 | 529 |
450 function Bool8x16Splat(s) { | 530 function Bool8x16Splat(s) { |
451 return %CreateBool8x16(s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s); | 531 return %CreateBool8x16(s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s); |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
510 'greaterThanOrEqual', Float32x4GreaterThanOrEqualJS, | 590 'greaterThanOrEqual', Float32x4GreaterThanOrEqualJS, |
511 'equal', Float32x4EqualJS, | 591 'equal', Float32x4EqualJS, |
512 'notEqual', Float32x4NotEqualJS, | 592 'notEqual', Float32x4NotEqualJS, |
513 'select', Float32x4SelectJS, | 593 'select', Float32x4SelectJS, |
514 'swizzle', Float32x4SwizzleJS, | 594 'swizzle', Float32x4SwizzleJS, |
515 'shuffle', Float32x4ShuffleJS, | 595 'shuffle', Float32x4ShuffleJS, |
516 'fromInt32x4', Float32x4FromInt32x4JS, | 596 'fromInt32x4', Float32x4FromInt32x4JS, |
517 'fromInt32x4Bits', Float32x4FromInt32x4BitsJS, | 597 'fromInt32x4Bits', Float32x4FromInt32x4BitsJS, |
518 'fromInt16x8Bits', Float32x4FromInt16x8BitsJS, | 598 'fromInt16x8Bits', Float32x4FromInt16x8BitsJS, |
519 'fromInt8x16Bits', Float32x4FromInt8x16BitsJS, | 599 'fromInt8x16Bits', Float32x4FromInt8x16BitsJS, |
600 'load', Float32x4LoadJS, | |
601 'load1', Float32x4Load1JS, | |
602 'load2', Float32x4Load2JS, | |
603 'load3', Float32x4Load3JS, | |
520 ]); | 604 ]); |
521 | 605 |
522 utils.InstallFunctions(GlobalInt32x4, DONT_ENUM, [ | 606 utils.InstallFunctions(GlobalInt32x4, DONT_ENUM, [ |
523 'splat', Int32x4Splat, | 607 'splat', Int32x4Splat, |
524 'check', Int32x4CheckJS, | 608 'check', Int32x4CheckJS, |
525 'extractLane', Int32x4ExtractLaneJS, | 609 'extractLane', Int32x4ExtractLaneJS, |
526 'replaceLane', Int32x4ReplaceLaneJS, | 610 'replaceLane', Int32x4ReplaceLaneJS, |
527 'neg', Int32x4NegJS, | 611 'neg', Int32x4NegJS, |
528 'add', Int32x4AddJS, | 612 'add', Int32x4AddJS, |
529 'sub', Int32x4SubJS, | 613 'sub', Int32x4SubJS, |
(...skipping 13 matching lines...) Expand all Loading... | |
543 'greaterThanOrEqual', Int32x4GreaterThanOrEqualJS, | 627 'greaterThanOrEqual', Int32x4GreaterThanOrEqualJS, |
544 'equal', Int32x4EqualJS, | 628 'equal', Int32x4EqualJS, |
545 'notEqual', Int32x4NotEqualJS, | 629 'notEqual', Int32x4NotEqualJS, |
546 'select', Int32x4SelectJS, | 630 'select', Int32x4SelectJS, |
547 'swizzle', Int32x4SwizzleJS, | 631 'swizzle', Int32x4SwizzleJS, |
548 'shuffle', Int32x4ShuffleJS, | 632 'shuffle', Int32x4ShuffleJS, |
549 'fromFloat32x4', Int32x4FromFloat32x4JS, | 633 'fromFloat32x4', Int32x4FromFloat32x4JS, |
550 'fromFloat32x4Bits', Int32x4FromFloat32x4BitsJS, | 634 'fromFloat32x4Bits', Int32x4FromFloat32x4BitsJS, |
551 'fromInt16x8Bits', Int32x4FromInt16x8BitsJS, | 635 'fromInt16x8Bits', Int32x4FromInt16x8BitsJS, |
552 'fromInt8x16Bits', Int32x4FromInt8x16BitsJS, | 636 'fromInt8x16Bits', Int32x4FromInt8x16BitsJS, |
637 'load', Int32x4LoadJS, | |
638 'load1', Int32x4Load1JS, | |
639 'load2', Int32x4Load2JS, | |
640 'load3', Int32x4Load3JS, | |
553 ]); | 641 ]); |
554 | 642 |
555 utils.InstallFunctions(GlobalBool32x4, DONT_ENUM, [ | 643 utils.InstallFunctions(GlobalBool32x4, DONT_ENUM, [ |
556 'splat', Bool32x4Splat, | 644 'splat', Bool32x4Splat, |
557 'check', Bool32x4CheckJS, | 645 'check', Bool32x4CheckJS, |
558 'extractLane', Bool32x4ExtractLaneJS, | 646 'extractLane', Bool32x4ExtractLaneJS, |
559 'replaceLane', Bool32x4ReplaceLaneJS, | 647 'replaceLane', Bool32x4ReplaceLaneJS, |
560 'and', Bool32x4AndJS, | 648 'and', Bool32x4AndJS, |
561 'or', Bool32x4OrJS, | 649 'or', Bool32x4OrJS, |
562 'xor', Bool32x4XorJS, | 650 'xor', Bool32x4XorJS, |
(...skipping 30 matching lines...) Expand all Loading... | |
593 'greaterThan', Int16x8GreaterThanJS, | 681 'greaterThan', Int16x8GreaterThanJS, |
594 'greaterThanOrEqual', Int16x8GreaterThanOrEqualJS, | 682 'greaterThanOrEqual', Int16x8GreaterThanOrEqualJS, |
595 'equal', Int16x8EqualJS, | 683 'equal', Int16x8EqualJS, |
596 'notEqual', Int16x8NotEqualJS, | 684 'notEqual', Int16x8NotEqualJS, |
597 'select', Int16x8SelectJS, | 685 'select', Int16x8SelectJS, |
598 'swizzle', Int16x8SwizzleJS, | 686 'swizzle', Int16x8SwizzleJS, |
599 'shuffle', Int16x8ShuffleJS, | 687 'shuffle', Int16x8ShuffleJS, |
600 'fromFloat32x4Bits', Int16x8FromFloat32x4BitsJS, | 688 'fromFloat32x4Bits', Int16x8FromFloat32x4BitsJS, |
601 'fromInt32x4Bits', Int16x8FromInt32x4BitsJS, | 689 'fromInt32x4Bits', Int16x8FromInt32x4BitsJS, |
602 'fromInt8x16Bits', Int16x8FromInt8x16BitsJS, | 690 'fromInt8x16Bits', Int16x8FromInt8x16BitsJS, |
691 'load', Int16x8LoadJS, | |
692 'load1', Int16x8Load1JS, | |
693 'load2', Int16x8Load2JS, | |
694 'load3', Int16x8Load3JS, | |
603 ]); | 695 ]); |
604 | 696 |
605 utils.InstallFunctions(GlobalBool16x8, DONT_ENUM, [ | 697 utils.InstallFunctions(GlobalBool16x8, DONT_ENUM, [ |
606 'splat', Bool16x8Splat, | 698 'splat', Bool16x8Splat, |
607 'check', Bool16x8CheckJS, | 699 'check', Bool16x8CheckJS, |
608 'extractLane', Bool16x8ExtractLaneJS, | 700 'extractLane', Bool16x8ExtractLaneJS, |
609 'replaceLane', Bool16x8ReplaceLaneJS, | 701 'replaceLane', Bool16x8ReplaceLaneJS, |
610 'and', Bool16x8AndJS, | 702 'and', Bool16x8AndJS, |
611 'or', Bool16x8OrJS, | 703 'or', Bool16x8OrJS, |
612 'xor', Bool16x8XorJS, | 704 'xor', Bool16x8XorJS, |
(...skipping 30 matching lines...) Expand all Loading... | |
643 'greaterThan', Int8x16GreaterThanJS, | 735 'greaterThan', Int8x16GreaterThanJS, |
644 'greaterThanOrEqual', Int8x16GreaterThanOrEqualJS, | 736 'greaterThanOrEqual', Int8x16GreaterThanOrEqualJS, |
645 'equal', Int8x16EqualJS, | 737 'equal', Int8x16EqualJS, |
646 'notEqual', Int8x16NotEqualJS, | 738 'notEqual', Int8x16NotEqualJS, |
647 'select', Int8x16SelectJS, | 739 'select', Int8x16SelectJS, |
648 'swizzle', Int8x16SwizzleJS, | 740 'swizzle', Int8x16SwizzleJS, |
649 'shuffle', Int8x16ShuffleJS, | 741 'shuffle', Int8x16ShuffleJS, |
650 'fromFloat32x4Bits', Int8x16FromFloat32x4BitsJS, | 742 'fromFloat32x4Bits', Int8x16FromFloat32x4BitsJS, |
651 'fromInt32x4Bits', Int8x16FromInt32x4BitsJS, | 743 'fromInt32x4Bits', Int8x16FromInt32x4BitsJS, |
652 'fromInt16x8Bits', Int8x16FromInt16x8BitsJS, | 744 'fromInt16x8Bits', Int8x16FromInt16x8BitsJS, |
745 'load', Int8x16LoadJS, | |
746 'load1', Int8x16Load1JS, | |
747 'load2', Int8x16Load2JS, | |
748 'load3', Int8x16Load3JS, | |
653 ]); | 749 ]); |
654 | 750 |
655 utils.InstallFunctions(GlobalBool8x16, DONT_ENUM, [ | 751 utils.InstallFunctions(GlobalBool8x16, DONT_ENUM, [ |
656 'splat', Bool8x16Splat, | 752 'splat', Bool8x16Splat, |
657 'check', Bool8x16CheckJS, | 753 'check', Bool8x16CheckJS, |
658 'extractLane', Bool8x16ExtractLaneJS, | 754 'extractLane', Bool8x16ExtractLaneJS, |
659 'replaceLane', Bool8x16ReplaceLaneJS, | 755 'replaceLane', Bool8x16ReplaceLaneJS, |
660 'and', Bool8x16AndJS, | 756 'and', Bool8x16AndJS, |
661 'or', Bool8x16OrJS, | 757 'or', Bool8x16OrJS, |
662 'xor', Bool8x16XorJS, | 758 'xor', Bool8x16XorJS, |
(...skipping 10 matching lines...) Expand all Loading... | |
673 to.Float32x4ToString = Float32x4ToString; | 769 to.Float32x4ToString = Float32x4ToString; |
674 to.Int32x4ToString = Int32x4ToString; | 770 to.Int32x4ToString = Int32x4ToString; |
675 to.Bool32x4ToString = Bool32x4ToString; | 771 to.Bool32x4ToString = Bool32x4ToString; |
676 to.Int16x8ToString = Int16x8ToString; | 772 to.Int16x8ToString = Int16x8ToString; |
677 to.Bool16x8ToString = Bool16x8ToString; | 773 to.Bool16x8ToString = Bool16x8ToString; |
678 to.Int8x16ToString = Int8x16ToString; | 774 to.Int8x16ToString = Int8x16ToString; |
679 to.Bool8x16ToString = Bool8x16ToString; | 775 to.Bool8x16ToString = Bool8x16ToString; |
680 }); | 776 }); |
681 | 777 |
682 }) | 778 }) |
OLD | NEW |