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

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

Issue 2147883002: MIPS64: Implement Mips64And32, Mips64Or32, Mips64Nor32 and Mips64Xor32 operators. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Address comments. Created 4 years, 5 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/compiler/mips64/instruction-codes-mips64.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 902 matching lines...) Expand 10 before | Expand all | Expand 10 after
913 i.InputInt8(2)); 913 i.InputInt8(2));
914 break; 914 break;
915 case kMips64Lsa: 915 case kMips64Lsa:
916 DCHECK(instr->InputAt(2)->IsImmediate()); 916 DCHECK(instr->InputAt(2)->IsImmediate());
917 __ Lsa(i.OutputRegister(), i.InputRegister(0), i.InputRegister(1), 917 __ Lsa(i.OutputRegister(), i.InputRegister(0), i.InputRegister(1),
918 i.InputInt8(2)); 918 i.InputInt8(2));
919 break; 919 break;
920 case kMips64And: 920 case kMips64And:
921 __ And(i.OutputRegister(), i.InputRegister(0), i.InputOperand(1)); 921 __ And(i.OutputRegister(), i.InputRegister(0), i.InputOperand(1));
922 break; 922 break;
923 case kMips64And32:
924 if (instr->InputAt(1)->IsRegister()) {
925 __ sll(i.InputRegister(0), i.InputRegister(0), 0x0);
926 __ sll(i.InputRegister(1), i.InputRegister(1), 0x0);
927 __ And(i.OutputRegister(), i.InputRegister(0), i.InputOperand(1));
928 } else {
929 __ sll(i.InputRegister(0), i.InputRegister(0), 0x0);
930 __ And(i.OutputRegister(), i.InputRegister(0), i.InputOperand(1));
931 }
932 break;
923 case kMips64Or: 933 case kMips64Or:
924 __ Or(i.OutputRegister(), i.InputRegister(0), i.InputOperand(1)); 934 __ Or(i.OutputRegister(), i.InputRegister(0), i.InputOperand(1));
925 break; 935 break;
936 case kMips64Or32:
937 if (instr->InputAt(1)->IsRegister()) {
938 __ sll(i.InputRegister(0), i.InputRegister(0), 0x0);
939 __ sll(i.InputRegister(1), i.InputRegister(1), 0x0);
940 __ Or(i.OutputRegister(), i.InputRegister(0), i.InputOperand(1));
941 } else {
942 __ sll(i.InputRegister(0), i.InputRegister(0), 0x0);
943 __ Or(i.OutputRegister(), i.InputRegister(0), i.InputOperand(1));
944 }
945 break;
926 case kMips64Nor: 946 case kMips64Nor:
927 if (instr->InputAt(1)->IsRegister()) { 947 if (instr->InputAt(1)->IsRegister()) {
928 __ Nor(i.OutputRegister(), i.InputRegister(0), i.InputOperand(1)); 948 __ Nor(i.OutputRegister(), i.InputRegister(0), i.InputOperand(1));
929 } else { 949 } else {
930 DCHECK(i.InputOperand(1).immediate() == 0); 950 DCHECK(i.InputOperand(1).immediate() == 0);
931 __ Nor(i.OutputRegister(), i.InputRegister(0), zero_reg); 951 __ Nor(i.OutputRegister(), i.InputRegister(0), zero_reg);
932 } 952 }
933 break; 953 break;
954 case kMips64Nor32:
955 if (instr->InputAt(1)->IsRegister()) {
956 __ sll(i.InputRegister(0), i.InputRegister(0), 0x0);
957 __ sll(i.InputRegister(1), i.InputRegister(1), 0x0);
958 __ Nor(i.OutputRegister(), i.InputRegister(0), i.InputOperand(1));
959 } else {
960 DCHECK(i.InputOperand(1).immediate() == 0);
961 __ sll(i.InputRegister(0), i.InputRegister(0), 0x0);
962 __ Nor(i.OutputRegister(), i.InputRegister(0), zero_reg);
963 }
964 break;
934 case kMips64Xor: 965 case kMips64Xor:
935 __ Xor(i.OutputRegister(), i.InputRegister(0), i.InputOperand(1)); 966 __ Xor(i.OutputRegister(), i.InputRegister(0), i.InputOperand(1));
936 break; 967 break;
968 case kMips64Xor32:
969 if (instr->InputAt(1)->IsRegister()) {
970 __ sll(i.InputRegister(0), i.InputRegister(0), 0x0);
971 __ sll(i.InputRegister(1), i.InputRegister(1), 0x0);
972 __ Xor(i.OutputRegister(), i.InputRegister(0), i.InputOperand(1));
973 } else {
974 __ sll(i.InputRegister(0), i.InputRegister(0), 0x0);
975 __ Xor(i.OutputRegister(), i.InputRegister(0), i.InputOperand(1));
976 }
977 break;
937 case kMips64Clz: 978 case kMips64Clz:
938 __ Clz(i.OutputRegister(), i.InputRegister(0)); 979 __ Clz(i.OutputRegister(), i.InputRegister(0));
939 break; 980 break;
940 case kMips64Dclz: 981 case kMips64Dclz:
941 __ dclz(i.OutputRegister(), i.InputRegister(0)); 982 __ dclz(i.OutputRegister(), i.InputRegister(0));
942 break; 983 break;
943 case kMips64Ctz: { 984 case kMips64Ctz: {
944 Register reg1 = kScratchReg; 985 Register reg1 = kScratchReg;
945 Register reg2 = kScratchReg2; 986 Register reg2 = kScratchReg2;
946 Label skip_for_zero; 987 Label skip_for_zero;
(...skipping 1434 matching lines...) Expand 10 before | Expand all | Expand 10 after
2381 padding_size -= v8::internal::Assembler::kInstrSize; 2422 padding_size -= v8::internal::Assembler::kInstrSize;
2382 } 2423 }
2383 } 2424 }
2384 } 2425 }
2385 2426
2386 #undef __ 2427 #undef __
2387 2428
2388 } // namespace compiler 2429 } // namespace compiler
2389 } // namespace internal 2430 } // namespace internal
2390 } // namespace v8 2431 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/compiler/mips64/instruction-codes-mips64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698