Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(51)

Side by Side Diff: src/harmony-simd.js

Issue 1304183004: [simd.js] Add SIMD store functions for Phase 1. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Re-enabling polyfill Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/parser.h » ('j') | src/parser.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 NAMEStoreJS(tarray, index, a) {
248 return %NAMEStore(tarray, index, a);
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 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
413 417
414 function NAMEShuffleJS(a, b, c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, 418 function NAMEShuffleJS(a, b, c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10,
415 c11, c12, c13, c14, c15) { 419 c11, c12, c13, c14, c15) {
416 return %NAMEShuffle(a, b, c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, 420 return %NAMEShuffle(a, b, c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10,
417 c11, c12, c13, c14, c15); 421 c11, c12, c13, c14, c15);
418 } 422 }
419 endmacro 423 endmacro
420 424
421 SIMD_X16_TYPES(DECLARE_X16_FUNCTIONS) 425 SIMD_X16_TYPES(DECLARE_X16_FUNCTIONS)
422 426
427 macro SIMD_LOADN_STOREN_TYPES(FUNCTION)
428 FUNCTION(Float32x4, 1)
429 FUNCTION(Float32x4, 2)
430 FUNCTION(Float32x4, 3)
431 FUNCTION(Int32x4, 1)
432 FUNCTION(Int32x4, 2)
433 FUNCTION(Int32x4, 3)
434 FUNCTION(Uint32x4, 1)
435 FUNCTION(Uint32x4, 2)
436 FUNCTION(Uint32x4, 3)
437 endmacro
438
439 macro DECLARE_LOADN_STOREN_FUNCTIONS(NAME, COUNT)
440 function NAMEStoreCOUNTJS(tarray, index, a) {
441 return %NAMEStoreCOUNT(tarray, index, a);
442 }
443 endmacro
444
445 SIMD_LOADN_STOREN_TYPES(DECLARE_LOADN_STOREN_FUNCTIONS)
446
423 //------------------------------------------------------------------- 447 //-------------------------------------------------------------------
424 448
425 function Float32x4Constructor(c0, c1, c2, c3) { 449 function Float32x4Constructor(c0, c1, c2, c3) {
426 if (%_IsConstructCall()) throw MakeTypeError(kNotConstructor, "Float32x4"); 450 if (%_IsConstructCall()) throw MakeTypeError(kNotConstructor, "Float32x4");
427 return %CreateFloat32x4(TO_NUMBER_INLINE(c0), TO_NUMBER_INLINE(c1), 451 return %CreateFloat32x4(TO_NUMBER_INLINE(c0), TO_NUMBER_INLINE(c1),
428 TO_NUMBER_INLINE(c2), TO_NUMBER_INLINE(c3)); 452 TO_NUMBER_INLINE(c2), TO_NUMBER_INLINE(c3));
429 } 453 }
430 454
431 455
432 function Int32x4Constructor(c0, c1, c2, c3) { 456 function Int32x4Constructor(c0, c1, c2, c3) {
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
592 'swizzle', Float32x4SwizzleJS, 616 'swizzle', Float32x4SwizzleJS,
593 'shuffle', Float32x4ShuffleJS, 617 'shuffle', Float32x4ShuffleJS,
594 'fromInt32x4', Float32x4FromInt32x4JS, 618 'fromInt32x4', Float32x4FromInt32x4JS,
595 'fromUint32x4', Float32x4FromUint32x4JS, 619 'fromUint32x4', Float32x4FromUint32x4JS,
596 'fromInt32x4Bits', Float32x4FromInt32x4BitsJS, 620 'fromInt32x4Bits', Float32x4FromInt32x4BitsJS,
597 'fromUint32x4Bits', Float32x4FromUint32x4BitsJS, 621 'fromUint32x4Bits', Float32x4FromUint32x4BitsJS,
598 'fromInt16x8Bits', Float32x4FromInt16x8BitsJS, 622 'fromInt16x8Bits', Float32x4FromInt16x8BitsJS,
599 'fromUint16x8Bits', Float32x4FromUint16x8BitsJS, 623 'fromUint16x8Bits', Float32x4FromUint16x8BitsJS,
600 'fromInt8x16Bits', Float32x4FromInt8x16BitsJS, 624 'fromInt8x16Bits', Float32x4FromInt8x16BitsJS,
601 'fromUint8x16Bits', Float32x4FromUint8x16BitsJS, 625 'fromUint8x16Bits', Float32x4FromUint8x16BitsJS,
626 'store', Float32x4StoreJS,
627 'store1', Float32x4Store1JS,
628 'store2', Float32x4Store2JS,
629 'store3', Float32x4Store3JS,
602 ]); 630 ]);
603 631
604 utils.InstallFunctions(GlobalInt32x4, DONT_ENUM, [ 632 utils.InstallFunctions(GlobalInt32x4, DONT_ENUM, [
605 'splat', Int32x4Splat, 633 'splat', Int32x4Splat,
606 'check', Int32x4CheckJS, 634 'check', Int32x4CheckJS,
607 'extractLane', Int32x4ExtractLaneJS, 635 'extractLane', Int32x4ExtractLaneJS,
608 'replaceLane', Int32x4ReplaceLaneJS, 636 'replaceLane', Int32x4ReplaceLaneJS,
609 'neg', Int32x4NegJS, 637 'neg', Int32x4NegJS,
610 'add', Int32x4AddJS, 638 'add', Int32x4AddJS,
611 'sub', Int32x4SubJS, 639 'sub', Int32x4SubJS,
(...skipping 16 matching lines...) Expand all
628 'swizzle', Int32x4SwizzleJS, 656 'swizzle', Int32x4SwizzleJS,
629 'shuffle', Int32x4ShuffleJS, 657 'shuffle', Int32x4ShuffleJS,
630 'fromFloat32x4', Int32x4FromFloat32x4JS, 658 'fromFloat32x4', Int32x4FromFloat32x4JS,
631 'fromUint32x4', Int32x4FromUint32x4JS, 659 'fromUint32x4', Int32x4FromUint32x4JS,
632 'fromFloat32x4Bits', Int32x4FromFloat32x4BitsJS, 660 'fromFloat32x4Bits', Int32x4FromFloat32x4BitsJS,
633 'fromUint32x4Bits', Int32x4FromUint32x4BitsJS, 661 'fromUint32x4Bits', Int32x4FromUint32x4BitsJS,
634 'fromInt16x8Bits', Int32x4FromInt16x8BitsJS, 662 'fromInt16x8Bits', Int32x4FromInt16x8BitsJS,
635 'fromUint16x8Bits', Int32x4FromUint16x8BitsJS, 663 'fromUint16x8Bits', Int32x4FromUint16x8BitsJS,
636 'fromInt8x16Bits', Int32x4FromInt8x16BitsJS, 664 'fromInt8x16Bits', Int32x4FromInt8x16BitsJS,
637 'fromUint8x16Bits', Int32x4FromUint8x16BitsJS, 665 'fromUint8x16Bits', Int32x4FromUint8x16BitsJS,
666 'store', Int32x4StoreJS,
667 'store1', Int32x4Store1JS,
668 'store2', Int32x4Store2JS,
669 'store3', Int32x4Store3JS,
638 ]); 670 ]);
639 671
640 utils.InstallFunctions(GlobalUint32x4, DONT_ENUM, [ 672 utils.InstallFunctions(GlobalUint32x4, DONT_ENUM, [
641 'splat', Uint32x4Splat, 673 'splat', Uint32x4Splat,
642 'check', Uint32x4CheckJS, 674 'check', Uint32x4CheckJS,
643 'extractLane', Uint32x4ExtractLaneJS, 675 'extractLane', Uint32x4ExtractLaneJS,
644 'replaceLane', Uint32x4ReplaceLaneJS, 676 'replaceLane', Uint32x4ReplaceLaneJS,
645 'add', Uint32x4AddJS, 677 'add', Uint32x4AddJS,
646 'sub', Uint32x4SubJS, 678 'sub', Uint32x4SubJS,
647 'mul', Uint32x4MulJS, 679 'mul', Uint32x4MulJS,
(...skipping 16 matching lines...) Expand all
664 'swizzle', Uint32x4SwizzleJS, 696 'swizzle', Uint32x4SwizzleJS,
665 'shuffle', Uint32x4ShuffleJS, 697 'shuffle', Uint32x4ShuffleJS,
666 'fromFloat32x4', Uint32x4FromFloat32x4JS, 698 'fromFloat32x4', Uint32x4FromFloat32x4JS,
667 'fromInt32x4', Uint32x4FromInt32x4JS, 699 'fromInt32x4', Uint32x4FromInt32x4JS,
668 'fromFloat32x4Bits', Uint32x4FromFloat32x4BitsJS, 700 'fromFloat32x4Bits', Uint32x4FromFloat32x4BitsJS,
669 'fromInt32x4Bits', Uint32x4FromInt32x4BitsJS, 701 'fromInt32x4Bits', Uint32x4FromInt32x4BitsJS,
670 'fromInt16x8Bits', Uint32x4FromInt16x8BitsJS, 702 'fromInt16x8Bits', Uint32x4FromInt16x8BitsJS,
671 'fromUint16x8Bits', Uint32x4FromUint16x8BitsJS, 703 'fromUint16x8Bits', Uint32x4FromUint16x8BitsJS,
672 'fromInt8x16Bits', Uint32x4FromInt8x16BitsJS, 704 'fromInt8x16Bits', Uint32x4FromInt8x16BitsJS,
673 'fromUint8x16Bits', Uint32x4FromUint8x16BitsJS, 705 'fromUint8x16Bits', Uint32x4FromUint8x16BitsJS,
706 'store', Uint32x4StoreJS,
707 'store1', Uint32x4Store1JS,
708 'store2', Uint32x4Store2JS,
709 'store3', Uint32x4Store3JS,
674 ]); 710 ]);
675 711
676 utils.InstallFunctions(GlobalBool32x4, DONT_ENUM, [ 712 utils.InstallFunctions(GlobalBool32x4, DONT_ENUM, [
677 'splat', Bool32x4Splat, 713 'splat', Bool32x4Splat,
678 'check', Bool32x4CheckJS, 714 'check', Bool32x4CheckJS,
679 'extractLane', Bool32x4ExtractLaneJS, 715 'extractLane', Bool32x4ExtractLaneJS,
680 'replaceLane', Bool32x4ReplaceLaneJS, 716 'replaceLane', Bool32x4ReplaceLaneJS,
681 'and', Bool32x4AndJS, 717 'and', Bool32x4AndJS,
682 'or', Bool32x4OrJS, 718 'or', Bool32x4OrJS,
683 'xor', Bool32x4XorJS, 719 'xor', Bool32x4XorJS,
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
716 'select', Int16x8SelectJS, 752 'select', Int16x8SelectJS,
717 'swizzle', Int16x8SwizzleJS, 753 'swizzle', Int16x8SwizzleJS,
718 'shuffle', Int16x8ShuffleJS, 754 'shuffle', Int16x8ShuffleJS,
719 'fromUint16x8', Int16x8FromUint16x8JS, 755 'fromUint16x8', Int16x8FromUint16x8JS,
720 'fromFloat32x4Bits', Int16x8FromFloat32x4BitsJS, 756 'fromFloat32x4Bits', Int16x8FromFloat32x4BitsJS,
721 'fromInt32x4Bits', Int16x8FromInt32x4BitsJS, 757 'fromInt32x4Bits', Int16x8FromInt32x4BitsJS,
722 'fromUint32x4Bits', Int16x8FromUint32x4BitsJS, 758 'fromUint32x4Bits', Int16x8FromUint32x4BitsJS,
723 'fromUint16x8Bits', Int16x8FromUint16x8BitsJS, 759 'fromUint16x8Bits', Int16x8FromUint16x8BitsJS,
724 'fromInt8x16Bits', Int16x8FromInt8x16BitsJS, 760 'fromInt8x16Bits', Int16x8FromInt8x16BitsJS,
725 'fromUint8x16Bits', Int16x8FromUint8x16BitsJS, 761 'fromUint8x16Bits', Int16x8FromUint8x16BitsJS,
762 'store', Int16x8StoreJS,
726 ]); 763 ]);
727 764
728 utils.InstallFunctions(GlobalUint16x8, DONT_ENUM, [ 765 utils.InstallFunctions(GlobalUint16x8, DONT_ENUM, [
729 'splat', Uint16x8Splat, 766 'splat', Uint16x8Splat,
730 'check', Uint16x8CheckJS, 767 'check', Uint16x8CheckJS,
731 'extractLane', Uint16x8ExtractLaneJS, 768 'extractLane', Uint16x8ExtractLaneJS,
732 'replaceLane', Uint16x8ReplaceLaneJS, 769 'replaceLane', Uint16x8ReplaceLaneJS,
733 'add', Uint16x8AddJS, 770 'add', Uint16x8AddJS,
734 'sub', Uint16x8SubJS, 771 'sub', Uint16x8SubJS,
735 'addSaturate', Uint16x8AddSaturateJS, 772 'addSaturate', Uint16x8AddSaturateJS,
(...skipping 19 matching lines...) Expand all
755 'select', Uint16x8SelectJS, 792 'select', Uint16x8SelectJS,
756 'swizzle', Uint16x8SwizzleJS, 793 'swizzle', Uint16x8SwizzleJS,
757 'shuffle', Uint16x8ShuffleJS, 794 'shuffle', Uint16x8ShuffleJS,
758 'fromInt16x8', Uint16x8FromInt16x8JS, 795 'fromInt16x8', Uint16x8FromInt16x8JS,
759 'fromFloat32x4Bits', Uint16x8FromFloat32x4BitsJS, 796 'fromFloat32x4Bits', Uint16x8FromFloat32x4BitsJS,
760 'fromInt32x4Bits', Uint16x8FromInt32x4BitsJS, 797 'fromInt32x4Bits', Uint16x8FromInt32x4BitsJS,
761 'fromUint32x4Bits', Uint16x8FromUint32x4BitsJS, 798 'fromUint32x4Bits', Uint16x8FromUint32x4BitsJS,
762 'fromInt16x8Bits', Uint16x8FromInt16x8BitsJS, 799 'fromInt16x8Bits', Uint16x8FromInt16x8BitsJS,
763 'fromInt8x16Bits', Uint16x8FromInt8x16BitsJS, 800 'fromInt8x16Bits', Uint16x8FromInt8x16BitsJS,
764 'fromUint8x16Bits', Uint16x8FromUint8x16BitsJS, 801 'fromUint8x16Bits', Uint16x8FromUint8x16BitsJS,
802 'store', Uint16x8StoreJS,
765 ]); 803 ]);
766 804
767 utils.InstallFunctions(GlobalBool16x8, DONT_ENUM, [ 805 utils.InstallFunctions(GlobalBool16x8, DONT_ENUM, [
768 'splat', Bool16x8Splat, 806 'splat', Bool16x8Splat,
769 'check', Bool16x8CheckJS, 807 'check', Bool16x8CheckJS,
770 'extractLane', Bool16x8ExtractLaneJS, 808 'extractLane', Bool16x8ExtractLaneJS,
771 'replaceLane', Bool16x8ReplaceLaneJS, 809 'replaceLane', Bool16x8ReplaceLaneJS,
772 'and', Bool16x8AndJS, 810 'and', Bool16x8AndJS,
773 'or', Bool16x8OrJS, 811 'or', Bool16x8OrJS,
774 'xor', Bool16x8XorJS, 812 'xor', Bool16x8XorJS,
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
807 'select', Int8x16SelectJS, 845 'select', Int8x16SelectJS,
808 'swizzle', Int8x16SwizzleJS, 846 'swizzle', Int8x16SwizzleJS,
809 'shuffle', Int8x16ShuffleJS, 847 'shuffle', Int8x16ShuffleJS,
810 'fromUint8x16', Int8x16FromUint8x16JS, 848 'fromUint8x16', Int8x16FromUint8x16JS,
811 'fromFloat32x4Bits', Int8x16FromFloat32x4BitsJS, 849 'fromFloat32x4Bits', Int8x16FromFloat32x4BitsJS,
812 'fromInt32x4Bits', Int8x16FromInt32x4BitsJS, 850 'fromInt32x4Bits', Int8x16FromInt32x4BitsJS,
813 'fromUint32x4Bits', Int8x16FromUint32x4BitsJS, 851 'fromUint32x4Bits', Int8x16FromUint32x4BitsJS,
814 'fromInt16x8Bits', Int8x16FromInt16x8BitsJS, 852 'fromInt16x8Bits', Int8x16FromInt16x8BitsJS,
815 'fromUint16x8Bits', Int8x16FromUint16x8BitsJS, 853 'fromUint16x8Bits', Int8x16FromUint16x8BitsJS,
816 'fromUint8x16Bits', Int8x16FromUint8x16BitsJS, 854 'fromUint8x16Bits', Int8x16FromUint8x16BitsJS,
855 'store', Int8x16StoreJS,
817 ]); 856 ]);
818 857
819 utils.InstallFunctions(GlobalUint8x16, DONT_ENUM, [ 858 utils.InstallFunctions(GlobalUint8x16, DONT_ENUM, [
820 'splat', Uint8x16Splat, 859 'splat', Uint8x16Splat,
821 'check', Uint8x16CheckJS, 860 'check', Uint8x16CheckJS,
822 'extractLane', Uint8x16ExtractLaneJS, 861 'extractLane', Uint8x16ExtractLaneJS,
823 'replaceLane', Uint8x16ReplaceLaneJS, 862 'replaceLane', Uint8x16ReplaceLaneJS,
824 'add', Uint8x16AddJS, 863 'add', Uint8x16AddJS,
825 'sub', Uint8x16SubJS, 864 'sub', Uint8x16SubJS,
826 'addSaturate', Uint8x16AddSaturateJS, 865 'addSaturate', Uint8x16AddSaturateJS,
(...skipping 19 matching lines...) Expand all
846 'select', Uint8x16SelectJS, 885 'select', Uint8x16SelectJS,
847 'swizzle', Uint8x16SwizzleJS, 886 'swizzle', Uint8x16SwizzleJS,
848 'shuffle', Uint8x16ShuffleJS, 887 'shuffle', Uint8x16ShuffleJS,
849 'fromInt8x16', Uint8x16FromInt8x16JS, 888 'fromInt8x16', Uint8x16FromInt8x16JS,
850 'fromFloat32x4Bits', Uint8x16FromFloat32x4BitsJS, 889 'fromFloat32x4Bits', Uint8x16FromFloat32x4BitsJS,
851 'fromInt32x4Bits', Uint8x16FromInt32x4BitsJS, 890 'fromInt32x4Bits', Uint8x16FromInt32x4BitsJS,
852 'fromUint32x4Bits', Uint8x16FromUint32x4BitsJS, 891 'fromUint32x4Bits', Uint8x16FromUint32x4BitsJS,
853 'fromInt16x8Bits', Uint8x16FromInt16x8BitsJS, 892 'fromInt16x8Bits', Uint8x16FromInt16x8BitsJS,
854 'fromUint16x8Bits', Uint8x16FromUint16x8BitsJS, 893 'fromUint16x8Bits', Uint8x16FromUint16x8BitsJS,
855 'fromInt8x16Bits', Uint8x16FromInt8x16BitsJS, 894 'fromInt8x16Bits', Uint8x16FromInt8x16BitsJS,
895 'store', Uint8x16StoreJS,
856 ]); 896 ]);
857 897
858 utils.InstallFunctions(GlobalBool8x16, DONT_ENUM, [ 898 utils.InstallFunctions(GlobalBool8x16, DONT_ENUM, [
859 'splat', Bool8x16Splat, 899 'splat', Bool8x16Splat,
860 'check', Bool8x16CheckJS, 900 'check', Bool8x16CheckJS,
861 'extractLane', Bool8x16ExtractLaneJS, 901 'extractLane', Bool8x16ExtractLaneJS,
862 'replaceLane', Bool8x16ReplaceLaneJS, 902 'replaceLane', Bool8x16ReplaceLaneJS,
863 'and', Bool8x16AndJS, 903 'and', Bool8x16AndJS,
864 'or', Bool8x16OrJS, 904 'or', Bool8x16OrJS,
865 'xor', Bool8x16XorJS, 905 'xor', Bool8x16XorJS,
(...skipping 11 matching lines...) Expand all
877 to.Bool32x4ToString = Bool32x4ToString; 917 to.Bool32x4ToString = Bool32x4ToString;
878 to.Int16x8ToString = Int16x8ToString; 918 to.Int16x8ToString = Int16x8ToString;
879 to.Uint16x8ToString = Uint16x8ToString; 919 to.Uint16x8ToString = Uint16x8ToString;
880 to.Bool16x8ToString = Bool16x8ToString; 920 to.Bool16x8ToString = Bool16x8ToString;
881 to.Int8x16ToString = Int8x16ToString; 921 to.Int8x16ToString = Int8x16ToString;
882 to.Uint8x16ToString = Uint8x16ToString; 922 to.Uint8x16ToString = Uint8x16ToString;
883 to.Bool8x16ToString = Bool8x16ToString; 923 to.Bool8x16ToString = Bool8x16ToString;
884 }); 924 });
885 925
886 }) 926 })
OLDNEW
« no previous file with comments | « no previous file | src/parser.h » ('j') | src/parser.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698