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 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 return %NAMELessThanOrEqual(a, b); | 236 return %NAMELessThanOrEqual(a, b); |
237 } | 237 } |
238 | 238 |
239 function NAMEGreaterThanJS(a, b) { | 239 function NAMEGreaterThanJS(a, b) { |
240 return %NAMEGreaterThan(a, b); | 240 return %NAMEGreaterThan(a, b); |
241 } | 241 } |
242 | 242 |
243 function NAMEGreaterThanOrEqualJS(a, b) { | 243 function NAMEGreaterThanOrEqualJS(a, b) { |
244 return %NAMEGreaterThanOrEqual(a, b); | 244 return %NAMEGreaterThanOrEqual(a, b); |
245 } | 245 } |
| 246 |
| 247 function NAMELoadJS(tarray, index) { |
| 248 return %NAMELoad(tarray, index); |
| 249 } |
246 endmacro | 250 endmacro |
247 | 251 |
248 SIMD_NUMERIC_TYPES(DECLARE_NUMERIC_FUNCTIONS) | 252 SIMD_NUMERIC_TYPES(DECLARE_NUMERIC_FUNCTIONS) |
249 | 253 |
250 macro SIMD_LOGICAL_TYPES(FUNCTION) | 254 macro SIMD_LOGICAL_TYPES(FUNCTION) |
251 SIMD_INT_TYPES(FUNCTION) | 255 SIMD_INT_TYPES(FUNCTION) |
252 SIMD_UINT_TYPES(FUNCTION) | 256 SIMD_UINT_TYPES(FUNCTION) |
253 SIMD_BOOL_TYPES(FUNCTION) | 257 SIMD_BOOL_TYPES(FUNCTION) |
254 endmacro | 258 endmacro |
255 | 259 |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
340 endmacro | 344 endmacro |
341 | 345 |
342 macro DECLARE_FROM_BITS_FUNCTIONS(TO, FROM) | 346 macro DECLARE_FROM_BITS_FUNCTIONS(TO, FROM) |
343 function TOFromFROMBitsJS(a) { | 347 function TOFromFROMBitsJS(a) { |
344 return %TOFromFROMBits(a); | 348 return %TOFromFROMBits(a); |
345 } | 349 } |
346 endmacro | 350 endmacro |
347 | 351 |
348 SIMD_FROM_BITS_TYPES(DECLARE_FROM_BITS_FUNCTIONS) | 352 SIMD_FROM_BITS_TYPES(DECLARE_FROM_BITS_FUNCTIONS) |
349 | 353 |
| 354 |
| 355 macro SIMD_LOADN_STOREN_TYPES(FUNCTION) |
| 356 FUNCTION(Float32x4, 1) |
| 357 FUNCTION(Float32x4, 2) |
| 358 FUNCTION(Float32x4, 3) |
| 359 FUNCTION(Int32x4, 1) |
| 360 FUNCTION(Int32x4, 2) |
| 361 FUNCTION(Int32x4, 3) |
| 362 FUNCTION(Uint32x4, 1) |
| 363 FUNCTION(Uint32x4, 2) |
| 364 FUNCTION(Uint32x4, 3) |
| 365 endmacro |
| 366 |
| 367 macro DECLARE_LOADN_STOREN_FUNCTIONS(NAME, COUNT) |
| 368 function NAMELoadCOUNTJS(tarray, index) { |
| 369 return %NAMELoadCOUNT(tarray, index); |
| 370 } |
| 371 endmacro |
| 372 |
| 373 SIMD_LOADN_STOREN_TYPES(DECLARE_LOADN_STOREN_FUNCTIONS) |
| 374 |
350 //------------------------------------------------------------------- | 375 //------------------------------------------------------------------- |
351 | 376 |
352 macro SIMD_X4_TYPES(FUNCTION) | 377 macro SIMD_X4_TYPES(FUNCTION) |
353 FUNCTION(Float32x4) | 378 FUNCTION(Float32x4) |
354 FUNCTION(Int32x4) | 379 FUNCTION(Int32x4) |
355 FUNCTION(Uint32x4) | 380 FUNCTION(Uint32x4) |
356 FUNCTION(Bool32x4) | 381 FUNCTION(Bool32x4) |
357 endmacro | 382 endmacro |
358 | 383 |
359 macro DECLARE_X4_FUNCTIONS(NAME) | 384 macro DECLARE_X4_FUNCTIONS(NAME) |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
592 'swizzle', Float32x4SwizzleJS, | 617 'swizzle', Float32x4SwizzleJS, |
593 'shuffle', Float32x4ShuffleJS, | 618 'shuffle', Float32x4ShuffleJS, |
594 'fromInt32x4', Float32x4FromInt32x4JS, | 619 'fromInt32x4', Float32x4FromInt32x4JS, |
595 'fromUint32x4', Float32x4FromUint32x4JS, | 620 'fromUint32x4', Float32x4FromUint32x4JS, |
596 'fromInt32x4Bits', Float32x4FromInt32x4BitsJS, | 621 'fromInt32x4Bits', Float32x4FromInt32x4BitsJS, |
597 'fromUint32x4Bits', Float32x4FromUint32x4BitsJS, | 622 'fromUint32x4Bits', Float32x4FromUint32x4BitsJS, |
598 'fromInt16x8Bits', Float32x4FromInt16x8BitsJS, | 623 'fromInt16x8Bits', Float32x4FromInt16x8BitsJS, |
599 'fromUint16x8Bits', Float32x4FromUint16x8BitsJS, | 624 'fromUint16x8Bits', Float32x4FromUint16x8BitsJS, |
600 'fromInt8x16Bits', Float32x4FromInt8x16BitsJS, | 625 'fromInt8x16Bits', Float32x4FromInt8x16BitsJS, |
601 'fromUint8x16Bits', Float32x4FromUint8x16BitsJS, | 626 'fromUint8x16Bits', Float32x4FromUint8x16BitsJS, |
| 627 'load', Float32x4LoadJS, |
| 628 'load1', Float32x4Load1JS, |
| 629 'load2', Float32x4Load2JS, |
| 630 'load3', Float32x4Load3JS, |
602 ]); | 631 ]); |
603 | 632 |
604 utils.InstallFunctions(GlobalInt32x4, DONT_ENUM, [ | 633 utils.InstallFunctions(GlobalInt32x4, DONT_ENUM, [ |
605 'splat', Int32x4Splat, | 634 'splat', Int32x4Splat, |
606 'check', Int32x4CheckJS, | 635 'check', Int32x4CheckJS, |
607 'extractLane', Int32x4ExtractLaneJS, | 636 'extractLane', Int32x4ExtractLaneJS, |
608 'replaceLane', Int32x4ReplaceLaneJS, | 637 'replaceLane', Int32x4ReplaceLaneJS, |
609 'neg', Int32x4NegJS, | 638 'neg', Int32x4NegJS, |
610 'add', Int32x4AddJS, | 639 'add', Int32x4AddJS, |
611 'sub', Int32x4SubJS, | 640 'sub', Int32x4SubJS, |
(...skipping 16 matching lines...) Expand all Loading... |
628 'swizzle', Int32x4SwizzleJS, | 657 'swizzle', Int32x4SwizzleJS, |
629 'shuffle', Int32x4ShuffleJS, | 658 'shuffle', Int32x4ShuffleJS, |
630 'fromFloat32x4', Int32x4FromFloat32x4JS, | 659 'fromFloat32x4', Int32x4FromFloat32x4JS, |
631 'fromUint32x4', Int32x4FromUint32x4JS, | 660 'fromUint32x4', Int32x4FromUint32x4JS, |
632 'fromFloat32x4Bits', Int32x4FromFloat32x4BitsJS, | 661 'fromFloat32x4Bits', Int32x4FromFloat32x4BitsJS, |
633 'fromUint32x4Bits', Int32x4FromUint32x4BitsJS, | 662 'fromUint32x4Bits', Int32x4FromUint32x4BitsJS, |
634 'fromInt16x8Bits', Int32x4FromInt16x8BitsJS, | 663 'fromInt16x8Bits', Int32x4FromInt16x8BitsJS, |
635 'fromUint16x8Bits', Int32x4FromUint16x8BitsJS, | 664 'fromUint16x8Bits', Int32x4FromUint16x8BitsJS, |
636 'fromInt8x16Bits', Int32x4FromInt8x16BitsJS, | 665 'fromInt8x16Bits', Int32x4FromInt8x16BitsJS, |
637 'fromUint8x16Bits', Int32x4FromUint8x16BitsJS, | 666 'fromUint8x16Bits', Int32x4FromUint8x16BitsJS, |
| 667 'load', Int32x4LoadJS, |
| 668 'load1', Int32x4Load1JS, |
| 669 'load2', Int32x4Load2JS, |
| 670 'load3', Int32x4Load3JS, |
638 ]); | 671 ]); |
639 | 672 |
640 utils.InstallFunctions(GlobalUint32x4, DONT_ENUM, [ | 673 utils.InstallFunctions(GlobalUint32x4, DONT_ENUM, [ |
641 'splat', Uint32x4Splat, | 674 'splat', Uint32x4Splat, |
642 'check', Uint32x4CheckJS, | 675 'check', Uint32x4CheckJS, |
643 'extractLane', Uint32x4ExtractLaneJS, | 676 'extractLane', Uint32x4ExtractLaneJS, |
644 'replaceLane', Uint32x4ReplaceLaneJS, | 677 'replaceLane', Uint32x4ReplaceLaneJS, |
645 'add', Uint32x4AddJS, | 678 'add', Uint32x4AddJS, |
646 'sub', Uint32x4SubJS, | 679 'sub', Uint32x4SubJS, |
647 'mul', Uint32x4MulJS, | 680 'mul', Uint32x4MulJS, |
(...skipping 16 matching lines...) Expand all Loading... |
664 'swizzle', Uint32x4SwizzleJS, | 697 'swizzle', Uint32x4SwizzleJS, |
665 'shuffle', Uint32x4ShuffleJS, | 698 'shuffle', Uint32x4ShuffleJS, |
666 'fromFloat32x4', Uint32x4FromFloat32x4JS, | 699 'fromFloat32x4', Uint32x4FromFloat32x4JS, |
667 'fromInt32x4', Uint32x4FromInt32x4JS, | 700 'fromInt32x4', Uint32x4FromInt32x4JS, |
668 'fromFloat32x4Bits', Uint32x4FromFloat32x4BitsJS, | 701 'fromFloat32x4Bits', Uint32x4FromFloat32x4BitsJS, |
669 'fromInt32x4Bits', Uint32x4FromInt32x4BitsJS, | 702 'fromInt32x4Bits', Uint32x4FromInt32x4BitsJS, |
670 'fromInt16x8Bits', Uint32x4FromInt16x8BitsJS, | 703 'fromInt16x8Bits', Uint32x4FromInt16x8BitsJS, |
671 'fromUint16x8Bits', Uint32x4FromUint16x8BitsJS, | 704 'fromUint16x8Bits', Uint32x4FromUint16x8BitsJS, |
672 'fromInt8x16Bits', Uint32x4FromInt8x16BitsJS, | 705 'fromInt8x16Bits', Uint32x4FromInt8x16BitsJS, |
673 'fromUint8x16Bits', Uint32x4FromUint8x16BitsJS, | 706 'fromUint8x16Bits', Uint32x4FromUint8x16BitsJS, |
| 707 'load', Uint32x4LoadJS, |
| 708 'load1', Uint32x4Load1JS, |
| 709 'load2', Uint32x4Load2JS, |
| 710 'load3', Uint32x4Load3JS, |
674 ]); | 711 ]); |
675 | 712 |
676 utils.InstallFunctions(GlobalBool32x4, DONT_ENUM, [ | 713 utils.InstallFunctions(GlobalBool32x4, DONT_ENUM, [ |
677 'splat', Bool32x4Splat, | 714 'splat', Bool32x4Splat, |
678 'check', Bool32x4CheckJS, | 715 'check', Bool32x4CheckJS, |
679 'extractLane', Bool32x4ExtractLaneJS, | 716 'extractLane', Bool32x4ExtractLaneJS, |
680 'replaceLane', Bool32x4ReplaceLaneJS, | 717 'replaceLane', Bool32x4ReplaceLaneJS, |
681 'and', Bool32x4AndJS, | 718 'and', Bool32x4AndJS, |
682 'or', Bool32x4OrJS, | 719 'or', Bool32x4OrJS, |
683 'xor', Bool32x4XorJS, | 720 'xor', Bool32x4XorJS, |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
716 'select', Int16x8SelectJS, | 753 'select', Int16x8SelectJS, |
717 'swizzle', Int16x8SwizzleJS, | 754 'swizzle', Int16x8SwizzleJS, |
718 'shuffle', Int16x8ShuffleJS, | 755 'shuffle', Int16x8ShuffleJS, |
719 'fromUint16x8', Int16x8FromUint16x8JS, | 756 'fromUint16x8', Int16x8FromUint16x8JS, |
720 'fromFloat32x4Bits', Int16x8FromFloat32x4BitsJS, | 757 'fromFloat32x4Bits', Int16x8FromFloat32x4BitsJS, |
721 'fromInt32x4Bits', Int16x8FromInt32x4BitsJS, | 758 'fromInt32x4Bits', Int16x8FromInt32x4BitsJS, |
722 'fromUint32x4Bits', Int16x8FromUint32x4BitsJS, | 759 'fromUint32x4Bits', Int16x8FromUint32x4BitsJS, |
723 'fromUint16x8Bits', Int16x8FromUint16x8BitsJS, | 760 'fromUint16x8Bits', Int16x8FromUint16x8BitsJS, |
724 'fromInt8x16Bits', Int16x8FromInt8x16BitsJS, | 761 'fromInt8x16Bits', Int16x8FromInt8x16BitsJS, |
725 'fromUint8x16Bits', Int16x8FromUint8x16BitsJS, | 762 'fromUint8x16Bits', Int16x8FromUint8x16BitsJS, |
| 763 'load', Int16x8LoadJS, |
726 ]); | 764 ]); |
727 | 765 |
728 utils.InstallFunctions(GlobalUint16x8, DONT_ENUM, [ | 766 utils.InstallFunctions(GlobalUint16x8, DONT_ENUM, [ |
729 'splat', Uint16x8Splat, | 767 'splat', Uint16x8Splat, |
730 'check', Uint16x8CheckJS, | 768 'check', Uint16x8CheckJS, |
731 'extractLane', Uint16x8ExtractLaneJS, | 769 'extractLane', Uint16x8ExtractLaneJS, |
732 'replaceLane', Uint16x8ReplaceLaneJS, | 770 'replaceLane', Uint16x8ReplaceLaneJS, |
733 'add', Uint16x8AddJS, | 771 'add', Uint16x8AddJS, |
734 'sub', Uint16x8SubJS, | 772 'sub', Uint16x8SubJS, |
735 'addSaturate', Uint16x8AddSaturateJS, | 773 'addSaturate', Uint16x8AddSaturateJS, |
(...skipping 19 matching lines...) Expand all Loading... |
755 'select', Uint16x8SelectJS, | 793 'select', Uint16x8SelectJS, |
756 'swizzle', Uint16x8SwizzleJS, | 794 'swizzle', Uint16x8SwizzleJS, |
757 'shuffle', Uint16x8ShuffleJS, | 795 'shuffle', Uint16x8ShuffleJS, |
758 'fromInt16x8', Uint16x8FromInt16x8JS, | 796 'fromInt16x8', Uint16x8FromInt16x8JS, |
759 'fromFloat32x4Bits', Uint16x8FromFloat32x4BitsJS, | 797 'fromFloat32x4Bits', Uint16x8FromFloat32x4BitsJS, |
760 'fromInt32x4Bits', Uint16x8FromInt32x4BitsJS, | 798 'fromInt32x4Bits', Uint16x8FromInt32x4BitsJS, |
761 'fromUint32x4Bits', Uint16x8FromUint32x4BitsJS, | 799 'fromUint32x4Bits', Uint16x8FromUint32x4BitsJS, |
762 'fromInt16x8Bits', Uint16x8FromInt16x8BitsJS, | 800 'fromInt16x8Bits', Uint16x8FromInt16x8BitsJS, |
763 'fromInt8x16Bits', Uint16x8FromInt8x16BitsJS, | 801 'fromInt8x16Bits', Uint16x8FromInt8x16BitsJS, |
764 'fromUint8x16Bits', Uint16x8FromUint8x16BitsJS, | 802 'fromUint8x16Bits', Uint16x8FromUint8x16BitsJS, |
| 803 'load', Uint16x8LoadJS, |
765 ]); | 804 ]); |
766 | 805 |
767 utils.InstallFunctions(GlobalBool16x8, DONT_ENUM, [ | 806 utils.InstallFunctions(GlobalBool16x8, DONT_ENUM, [ |
768 'splat', Bool16x8Splat, | 807 'splat', Bool16x8Splat, |
769 'check', Bool16x8CheckJS, | 808 'check', Bool16x8CheckJS, |
770 'extractLane', Bool16x8ExtractLaneJS, | 809 'extractLane', Bool16x8ExtractLaneJS, |
771 'replaceLane', Bool16x8ReplaceLaneJS, | 810 'replaceLane', Bool16x8ReplaceLaneJS, |
772 'and', Bool16x8AndJS, | 811 'and', Bool16x8AndJS, |
773 'or', Bool16x8OrJS, | 812 'or', Bool16x8OrJS, |
774 'xor', Bool16x8XorJS, | 813 'xor', Bool16x8XorJS, |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
807 'select', Int8x16SelectJS, | 846 'select', Int8x16SelectJS, |
808 'swizzle', Int8x16SwizzleJS, | 847 'swizzle', Int8x16SwizzleJS, |
809 'shuffle', Int8x16ShuffleJS, | 848 'shuffle', Int8x16ShuffleJS, |
810 'fromUint8x16', Int8x16FromUint8x16JS, | 849 'fromUint8x16', Int8x16FromUint8x16JS, |
811 'fromFloat32x4Bits', Int8x16FromFloat32x4BitsJS, | 850 'fromFloat32x4Bits', Int8x16FromFloat32x4BitsJS, |
812 'fromInt32x4Bits', Int8x16FromInt32x4BitsJS, | 851 'fromInt32x4Bits', Int8x16FromInt32x4BitsJS, |
813 'fromUint32x4Bits', Int8x16FromUint32x4BitsJS, | 852 'fromUint32x4Bits', Int8x16FromUint32x4BitsJS, |
814 'fromInt16x8Bits', Int8x16FromInt16x8BitsJS, | 853 'fromInt16x8Bits', Int8x16FromInt16x8BitsJS, |
815 'fromUint16x8Bits', Int8x16FromUint16x8BitsJS, | 854 'fromUint16x8Bits', Int8x16FromUint16x8BitsJS, |
816 'fromUint8x16Bits', Int8x16FromUint8x16BitsJS, | 855 'fromUint8x16Bits', Int8x16FromUint8x16BitsJS, |
| 856 'load', Int8x16LoadJS, |
817 ]); | 857 ]); |
818 | 858 |
819 utils.InstallFunctions(GlobalUint8x16, DONT_ENUM, [ | 859 utils.InstallFunctions(GlobalUint8x16, DONT_ENUM, [ |
820 'splat', Uint8x16Splat, | 860 'splat', Uint8x16Splat, |
821 'check', Uint8x16CheckJS, | 861 'check', Uint8x16CheckJS, |
822 'extractLane', Uint8x16ExtractLaneJS, | 862 'extractLane', Uint8x16ExtractLaneJS, |
823 'replaceLane', Uint8x16ReplaceLaneJS, | 863 'replaceLane', Uint8x16ReplaceLaneJS, |
824 'add', Uint8x16AddJS, | 864 'add', Uint8x16AddJS, |
825 'sub', Uint8x16SubJS, | 865 'sub', Uint8x16SubJS, |
826 'addSaturate', Uint8x16AddSaturateJS, | 866 'addSaturate', Uint8x16AddSaturateJS, |
(...skipping 19 matching lines...) Expand all Loading... |
846 'select', Uint8x16SelectJS, | 886 'select', Uint8x16SelectJS, |
847 'swizzle', Uint8x16SwizzleJS, | 887 'swizzle', Uint8x16SwizzleJS, |
848 'shuffle', Uint8x16ShuffleJS, | 888 'shuffle', Uint8x16ShuffleJS, |
849 'fromInt8x16', Uint8x16FromInt8x16JS, | 889 'fromInt8x16', Uint8x16FromInt8x16JS, |
850 'fromFloat32x4Bits', Uint8x16FromFloat32x4BitsJS, | 890 'fromFloat32x4Bits', Uint8x16FromFloat32x4BitsJS, |
851 'fromInt32x4Bits', Uint8x16FromInt32x4BitsJS, | 891 'fromInt32x4Bits', Uint8x16FromInt32x4BitsJS, |
852 'fromUint32x4Bits', Uint8x16FromUint32x4BitsJS, | 892 'fromUint32x4Bits', Uint8x16FromUint32x4BitsJS, |
853 'fromInt16x8Bits', Uint8x16FromInt16x8BitsJS, | 893 'fromInt16x8Bits', Uint8x16FromInt16x8BitsJS, |
854 'fromUint16x8Bits', Uint8x16FromUint16x8BitsJS, | 894 'fromUint16x8Bits', Uint8x16FromUint16x8BitsJS, |
855 'fromInt8x16Bits', Uint8x16FromInt8x16BitsJS, | 895 'fromInt8x16Bits', Uint8x16FromInt8x16BitsJS, |
| 896 'load', Uint8x16LoadJS, |
856 ]); | 897 ]); |
857 | 898 |
858 utils.InstallFunctions(GlobalBool8x16, DONT_ENUM, [ | 899 utils.InstallFunctions(GlobalBool8x16, DONT_ENUM, [ |
859 'splat', Bool8x16Splat, | 900 'splat', Bool8x16Splat, |
860 'check', Bool8x16CheckJS, | 901 'check', Bool8x16CheckJS, |
861 'extractLane', Bool8x16ExtractLaneJS, | 902 'extractLane', Bool8x16ExtractLaneJS, |
862 'replaceLane', Bool8x16ReplaceLaneJS, | 903 'replaceLane', Bool8x16ReplaceLaneJS, |
863 'and', Bool8x16AndJS, | 904 'and', Bool8x16AndJS, |
864 'or', Bool8x16OrJS, | 905 'or', Bool8x16OrJS, |
865 'xor', Bool8x16XorJS, | 906 'xor', Bool8x16XorJS, |
(...skipping 11 matching lines...) Expand all Loading... |
877 to.Bool32x4ToString = Bool32x4ToString; | 918 to.Bool32x4ToString = Bool32x4ToString; |
878 to.Int16x8ToString = Int16x8ToString; | 919 to.Int16x8ToString = Int16x8ToString; |
879 to.Uint16x8ToString = Uint16x8ToString; | 920 to.Uint16x8ToString = Uint16x8ToString; |
880 to.Bool16x8ToString = Bool16x8ToString; | 921 to.Bool16x8ToString = Bool16x8ToString; |
881 to.Int8x16ToString = Int8x16ToString; | 922 to.Int8x16ToString = Int8x16ToString; |
882 to.Uint8x16ToString = Uint8x16ToString; | 923 to.Uint8x16ToString = Uint8x16ToString; |
883 to.Bool8x16ToString = Bool8x16ToString; | 924 to.Bool8x16ToString = Bool8x16ToString; |
884 }); | 925 }); |
885 | 926 |
886 }) | 927 }) |
OLD | NEW |