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

Side by Side Diff: src/compiler/mips/code-generator-mips.cc

Issue 1819383002: MIPS: [wasm] Lowering of Int64Shl, Int64Shr, Int64Sar, Int64Add and Int64Sub. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Enable all lowering tests Created 4 years, 8 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
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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 #include "src/ast/scopes.h" 5 #include "src/ast/scopes.h"
6 #include "src/compiler/code-generator.h" 6 #include "src/compiler/code-generator.h"
7 #include "src/compiler/code-generator-impl.h" 7 #include "src/compiler/code-generator-impl.h"
8 #include "src/compiler/gap-resolver.h" 8 #include "src/compiler/gap-resolver.h"
9 #include "src/compiler/node-matchers.h" 9 #include "src/compiler/node-matchers.h"
10 #include "src/compiler/osr.h" 10 #include "src/compiler/osr.h"
(...skipping 812 matching lines...) Expand 10 before | Expand all | Expand 10 after
823 } 823 }
824 break; 824 break;
825 case kMipsSar: 825 case kMipsSar:
826 if (instr->InputAt(1)->IsRegister()) { 826 if (instr->InputAt(1)->IsRegister()) {
827 __ srav(i.OutputRegister(), i.InputRegister(0), i.InputRegister(1)); 827 __ srav(i.OutputRegister(), i.InputRegister(0), i.InputRegister(1));
828 } else { 828 } else {
829 int32_t imm = i.InputOperand(1).immediate(); 829 int32_t imm = i.InputOperand(1).immediate();
830 __ sra(i.OutputRegister(), i.InputRegister(0), imm); 830 __ sra(i.OutputRegister(), i.InputRegister(0), imm);
831 } 831 }
832 break; 832 break;
833 case kMipsShlPair: {
834 if (instr->InputAt(2)->IsRegister()) {
835 __ ShlPair(i.OutputRegister(0), i.OutputRegister(1), i.InputRegister(0),
836 i.InputRegister(1), i.InputRegister(2));
837 } else {
838 uint32_t imm = i.InputOperand(2).immediate();
839 __ ShlPair(i.OutputRegister(0), i.OutputRegister(1), i.InputRegister(0),
840 i.InputRegister(1), imm);
841 }
842 } break;
843 case kMipsShrPair: {
844 if (instr->InputAt(2)->IsRegister()) {
845 __ ShrPair(i.OutputRegister(0), i.OutputRegister(1), i.InputRegister(0),
846 i.InputRegister(1), i.InputRegister(2));
847 } else {
848 uint32_t imm = i.InputOperand(2).immediate();
849 __ ShrPair(i.OutputRegister(0), i.OutputRegister(1), i.InputRegister(0),
850 i.InputRegister(1), imm);
851 }
852 } break;
853 case kMipsSarPair: {
854 if (instr->InputAt(2)->IsRegister()) {
855 __ SarPair(i.OutputRegister(0), i.OutputRegister(1), i.InputRegister(0),
856 i.InputRegister(1), i.InputRegister(2));
857 } else {
858 uint32_t imm = i.InputOperand(2).immediate();
859 __ SarPair(i.OutputRegister(0), i.OutputRegister(1), i.InputRegister(0),
860 i.InputRegister(1), imm);
861 }
862 } break;
833 case kMipsExt: 863 case kMipsExt:
834 __ Ext(i.OutputRegister(), i.InputRegister(0), i.InputInt8(1), 864 __ Ext(i.OutputRegister(), i.InputRegister(0), i.InputInt8(1),
835 i.InputInt8(2)); 865 i.InputInt8(2));
836 break; 866 break;
837 case kMipsIns: 867 case kMipsIns:
838 if (instr->InputAt(1)->IsImmediate() && i.InputInt8(1) == 0) { 868 if (instr->InputAt(1)->IsImmediate() && i.InputInt8(1) == 0) {
839 __ Ins(i.OutputRegister(), zero_reg, i.InputInt8(1), i.InputInt8(2)); 869 __ Ins(i.OutputRegister(), zero_reg, i.InputInt8(1), i.InputInt8(2));
840 } else { 870 } else {
841 __ Ins(i.OutputRegister(), i.InputRegister(0), i.InputInt8(1), 871 __ Ins(i.OutputRegister(), i.InputRegister(0), i.InputInt8(1),
842 i.InputInt8(2)); 872 i.InputInt8(2));
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
907 __ max_s(i.OutputDoubleRegister(), i.InputDoubleRegister(0), 937 __ max_s(i.OutputDoubleRegister(), i.InputDoubleRegister(0),
908 i.InputDoubleRegister(1)); 938 i.InputDoubleRegister(1));
909 break; 939 break;
910 case kMipsMinS: 940 case kMipsMinS:
911 __ min_s(i.OutputDoubleRegister(), i.InputDoubleRegister(0), 941 __ min_s(i.OutputDoubleRegister(), i.InputDoubleRegister(0),
912 i.InputDoubleRegister(1)); 942 i.InputDoubleRegister(1));
913 break; 943 break;
914 case kMipsCmpD: 944 case kMipsCmpD:
915 // Psuedo-instruction used for FP cmp/branch. No opcode emitted here. 945 // Psuedo-instruction used for FP cmp/branch. No opcode emitted here.
916 break; 946 break;
947 case kMipsAddPair:
948 __ AddPair(i.OutputRegister(0), i.OutputRegister(1), i.InputRegister(0),
949 i.InputRegister(1), i.InputRegister(2), i.InputRegister(3));
950 break;
951 case kMipsSubPair:
952 __ SubPair(i.OutputRegister(0), i.OutputRegister(1), i.InputRegister(0),
953 i.InputRegister(1), i.InputRegister(2), i.InputRegister(3));
954 break;
917 case kMipsAddD: 955 case kMipsAddD:
918 // TODO(plind): add special case: combine mult & add. 956 // TODO(plind): add special case: combine mult & add.
919 __ add_d(i.OutputDoubleRegister(), i.InputDoubleRegister(0), 957 __ add_d(i.OutputDoubleRegister(), i.InputDoubleRegister(0),
920 i.InputDoubleRegister(1)); 958 i.InputDoubleRegister(1));
921 break; 959 break;
922 case kMipsSubD: 960 case kMipsSubD:
923 __ sub_d(i.OutputDoubleRegister(), i.InputDoubleRegister(0), 961 __ sub_d(i.OutputDoubleRegister(), i.InputDoubleRegister(0),
924 i.InputDoubleRegister(1)); 962 i.InputDoubleRegister(1));
925 break; 963 break;
926 case kMipsMulD: 964 case kMipsMulD:
(...skipping 938 matching lines...) Expand 10 before | Expand all | Expand 10 after
1865 padding_size -= v8::internal::Assembler::kInstrSize; 1903 padding_size -= v8::internal::Assembler::kInstrSize;
1866 } 1904 }
1867 } 1905 }
1868 } 1906 }
1869 1907
1870 #undef __ 1908 #undef __
1871 1909
1872 } // namespace compiler 1910 } // namespace compiler
1873 } // namespace internal 1911 } // namespace internal
1874 } // namespace v8 1912 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/compiler/mips/instruction-codes-mips.h » ('j') | src/compiler/mips/instruction-selector-mips.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698