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

Side by Side Diff: src/mips/macro-assembler-mips.h

Issue 1749263002: MIPS: Improve Lsa/Dlsa implementations. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebased. Created 4 years, 9 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 | « src/mips/assembler-mips.cc ('k') | src/mips/macro-assembler-mips.cc » ('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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 #ifndef V8_MIPS_MACRO_ASSEMBLER_MIPS_H_ 5 #ifndef V8_MIPS_MACRO_ASSEMBLER_MIPS_H_
6 #define V8_MIPS_MACRO_ASSEMBLER_MIPS_H_ 6 #define V8_MIPS_MACRO_ASSEMBLER_MIPS_H_
7 7
8 #include "src/assembler.h" 8 #include "src/assembler.h"
9 #include "src/globals.h" 9 #include "src/globals.h"
10 #include "src/mips/assembler-mips.h" 10 #include "src/mips/assembler-mips.h"
(...skipping 629 matching lines...) Expand 10 before | Expand all | Expand 10 after
640 DEFINE_INSTRUCTION(Slt); 640 DEFINE_INSTRUCTION(Slt);
641 DEFINE_INSTRUCTION(Sltu); 641 DEFINE_INSTRUCTION(Sltu);
642 642
643 // MIPS32 R2 instruction macro. 643 // MIPS32 R2 instruction macro.
644 DEFINE_INSTRUCTION(Ror); 644 DEFINE_INSTRUCTION(Ror);
645 645
646 #undef DEFINE_INSTRUCTION 646 #undef DEFINE_INSTRUCTION
647 #undef DEFINE_INSTRUCTION2 647 #undef DEFINE_INSTRUCTION2
648 #undef DEFINE_INSTRUCTION3 648 #undef DEFINE_INSTRUCTION3
649 649
650 // Load Scaled Address instructions. Parameter sa (shift argument) must be
651 // between [1, 31] (inclusive). On pre-r6 architectures the scratch register
652 // may be clobbered.
650 void Lsa(Register rd, Register rs, Register rt, uint8_t sa, 653 void Lsa(Register rd, Register rs, Register rt, uint8_t sa,
651 Register scratch = at); 654 Register scratch = at);
655
652 void Pref(int32_t hint, const MemOperand& rs); 656 void Pref(int32_t hint, const MemOperand& rs);
653 657
654 658
655 // --------------------------------------------------------------------------- 659 // ---------------------------------------------------------------------------
656 // Pseudo-instructions. 660 // Pseudo-instructions.
657 661
658 void mov(Register rd, Register rt) { or_(rd, rt, zero_reg); } 662 void mov(Register rd, Register rt) { or_(rd, rt, zero_reg); }
659 663
660 void Ulw(Register rd, const MemOperand& rs); 664 void Ulw(Register rd, const MemOperand& rs);
661 void Usw(Register rd, const MemOperand& rs); 665 void Usw(Register rd, const MemOperand& rs);
(...skipping 1121 matching lines...) Expand 10 before | Expand all | Expand 10 after
1783 MacroAssembler masm_; // Macro assembler used to generate the code. 1787 MacroAssembler masm_; // Macro assembler used to generate the code.
1784 FlushICache flush_cache_; // Whether to flush the I cache after patching. 1788 FlushICache flush_cache_; // Whether to flush the I cache after patching.
1785 }; 1789 };
1786 1790
1787 template <typename Func> 1791 template <typename Func>
1788 void MacroAssembler::GenerateSwitchTable(Register index, size_t case_count, 1792 void MacroAssembler::GenerateSwitchTable(Register index, size_t case_count,
1789 Func GetLabelFunction) { 1793 Func GetLabelFunction) {
1790 if (kArchVariant >= kMips32r6) { 1794 if (kArchVariant >= kMips32r6) {
1791 BlockTrampolinePoolFor(case_count + 5); 1795 BlockTrampolinePoolFor(case_count + 5);
1792 addiupc(at, 5); 1796 addiupc(at, 5);
1793 lsa(at, at, index, kPointerSizeLog2); 1797 Lsa(at, at, index, kPointerSizeLog2);
1794 lw(at, MemOperand(at)); 1798 lw(at, MemOperand(at));
1795 } else { 1799 } else {
1796 Label here; 1800 Label here;
1797 BlockTrampolinePoolFor(case_count + 10); 1801 BlockTrampolinePoolFor(case_count + 10);
1798 push(ra); 1802 push(ra);
1799 bal(&here); 1803 bal(&here);
1800 sll(at, index, kPointerSizeLog2); // Branch delay slot. 1804 sll(at, index, kPointerSizeLog2); // Branch delay slot.
1801 bind(&here); 1805 bind(&here);
1802 addu(at, at, ra); 1806 addu(at, at, ra);
1803 pop(ra); 1807 pop(ra);
(...skipping 12 matching lines...) Expand all
1816 #define __FILE_LINE__ __FILE__ ":" CODE_COVERAGE_TOSTRING(__LINE__) 1820 #define __FILE_LINE__ __FILE__ ":" CODE_COVERAGE_TOSTRING(__LINE__)
1817 #define ACCESS_MASM(masm) masm->stop(__FILE_LINE__); masm-> 1821 #define ACCESS_MASM(masm) masm->stop(__FILE_LINE__); masm->
1818 #else 1822 #else
1819 #define ACCESS_MASM(masm) masm-> 1823 #define ACCESS_MASM(masm) masm->
1820 #endif 1824 #endif
1821 1825
1822 } // namespace internal 1826 } // namespace internal
1823 } // namespace v8 1827 } // namespace v8
1824 1828
1825 #endif // V8_MIPS_MACRO_ASSEMBLER_MIPS_H_ 1829 #endif // V8_MIPS_MACRO_ASSEMBLER_MIPS_H_
OLDNEW
« no previous file with comments | « src/mips/assembler-mips.cc ('k') | src/mips/macro-assembler-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698