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

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

Issue 1485023004: MIPS:[turbofan] Use Ins, Dins to clear bits instead of And with inverted immediate. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix comments. Created 5 years 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 702 matching lines...) Expand 10 before | Expand all | Expand 10 after
713 } else { 713 } else {
714 int64_t imm = i.InputOperand(1).immediate(); 714 int64_t imm = i.InputOperand(1).immediate();
715 __ sra(i.OutputRegister(), i.InputRegister(0), 715 __ sra(i.OutputRegister(), i.InputRegister(0),
716 static_cast<uint16_t>(imm)); 716 static_cast<uint16_t>(imm));
717 } 717 }
718 break; 718 break;
719 case kMips64Ext: 719 case kMips64Ext:
720 __ Ext(i.OutputRegister(), i.InputRegister(0), i.InputInt8(1), 720 __ Ext(i.OutputRegister(), i.InputRegister(0), i.InputInt8(1),
721 i.InputInt8(2)); 721 i.InputInt8(2));
722 break; 722 break;
723 case kMips64Ins:
724 if (instr->InputAt(1)->IsImmediate() && i.InputInt8(1) == 0) {
725 __ Ins(i.OutputRegister(), zero_reg, i.InputInt8(1), i.InputInt8(2));
726 } else {
727 __ Ins(i.OutputRegister(), i.InputRegister(0), i.InputInt8(1),
728 i.InputInt8(2));
729 }
730 break;
723 case kMips64Dext: 731 case kMips64Dext:
724 __ Dext(i.OutputRegister(), i.InputRegister(0), i.InputInt8(1), 732 __ Dext(i.OutputRegister(), i.InputRegister(0), i.InputInt8(1),
725 i.InputInt8(2)); 733 i.InputInt8(2));
726 break; 734 break;
735 case kMips64Dins:
736 if (instr->InputAt(1)->IsImmediate() && i.InputInt8(1) == 0) {
737 __ Dins(i.OutputRegister(), zero_reg, i.InputInt8(1), i.InputInt8(2));
738 } else {
739 __ Dins(i.OutputRegister(), i.InputRegister(0), i.InputInt8(1),
740 i.InputInt8(2));
741 }
742 break;
727 case kMips64Dshl: 743 case kMips64Dshl:
728 if (instr->InputAt(1)->IsRegister()) { 744 if (instr->InputAt(1)->IsRegister()) {
729 __ dsllv(i.OutputRegister(), i.InputRegister(0), i.InputRegister(1)); 745 __ dsllv(i.OutputRegister(), i.InputRegister(0), i.InputRegister(1));
730 } else { 746 } else {
731 int64_t imm = i.InputOperand(1).immediate(); 747 int64_t imm = i.InputOperand(1).immediate();
732 if (imm < 32) { 748 if (imm < 32) {
733 __ dsll(i.OutputRegister(), i.InputRegister(0), 749 __ dsll(i.OutputRegister(), i.InputRegister(0),
734 static_cast<uint16_t>(imm)); 750 static_cast<uint16_t>(imm));
735 } else { 751 } else {
736 __ dsll32(i.OutputRegister(), i.InputRegister(0), 752 __ dsll32(i.OutputRegister(), i.InputRegister(0),
(...skipping 1029 matching lines...) Expand 10 before | Expand all | Expand 10 after
1766 padding_size -= v8::internal::Assembler::kInstrSize; 1782 padding_size -= v8::internal::Assembler::kInstrSize;
1767 } 1783 }
1768 } 1784 }
1769 } 1785 }
1770 1786
1771 #undef __ 1787 #undef __
1772 1788
1773 } // namespace compiler 1789 } // namespace compiler
1774 } // namespace internal 1790 } // namespace internal
1775 } // namespace v8 1791 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/mips/instruction-selector-mips.cc ('k') | src/compiler/mips64/instruction-codes-mips64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698