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

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

Issue 1534183002: MIPS64: r6 compact branch optimization. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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
« no previous file with comments | « no previous file | src/ic/mips64/ic-mips64.cc » ('j') | src/mips64/assembler-mips64.h » ('J')
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 1535 matching lines...) Expand 10 before | Expand all | Expand 10 after
1546 __ li(at, Operand(i.InputInt32(index + 0))); 1546 __ li(at, Operand(i.InputInt32(index + 0)));
1547 __ beq(input, at, GetLabel(i.InputRpo(index + 1))); 1547 __ beq(input, at, GetLabel(i.InputRpo(index + 1)));
1548 } 1548 }
1549 __ nop(); // Branch delay slot of the last beq. 1549 __ nop(); // Branch delay slot of the last beq.
1550 AssembleArchJump(i.InputRpo(1)); 1550 AssembleArchJump(i.InputRpo(1));
1551 } 1551 }
1552 1552
1553 1553
1554 void CodeGenerator::AssembleArchTableSwitch(Instruction* instr) { 1554 void CodeGenerator::AssembleArchTableSwitch(Instruction* instr) {
1555 MipsOperandConverter i(this, instr); 1555 MipsOperandConverter i(this, instr);
1556 Register input = i.InputRegister(0); 1556 Register input = i.InputRegister(0);
ivica.bogosavljevic 2015/12/18 08:56:32 Patch tested on MIPS64 R2 and R6, simulator and qe
ivica.bogosavljevic 2015/12/22 10:22:39 Patch also tested on MIPS64R6 Big-Endian under qem
1557 size_t const case_count = instr->InputCount() - 2; 1557 size_t const case_count = instr->InputCount() - 2;
1558 Label here; 1558 Label here;
1559 1559
1560 __ Branch(GetLabel(i.InputRpo(1)), hs, input, Operand(case_count)); 1560 __ Branch(GetLabel(i.InputRpo(1)), hs, input, Operand(case_count));
1561 __ BlockTrampolinePoolFor(static_cast<int>(case_count) * 2 + 7); 1561 __ BlockTrampolinePoolFor(static_cast<int>(case_count) * 2 + 7);
1562 // Ensure that dd-ed labels use 8 byte aligned addresses. 1562 // Ensure that dd-ed labels use 8 byte aligned addresses.
1563 if ((masm()->pc_offset() & 7) != 0) { 1563 __ Align(8);
1564 __ nop();
1565 }
1566 __ bal(&here); 1564 __ bal(&here);
1567 __ dsll(at, input, 3); // Branch delay slot. 1565 __ dsll(at, input, 3); // Branch delay slot.
1568 __ bind(&here); 1566 __ bind(&here);
1569 __ daddu(at, at, ra); 1567 __ daddu(at, at, ra);
1570 __ ld(at, MemOperand(at, 4 * v8::internal::Assembler::kInstrSize)); 1568 __ ld(at, MemOperand(at, 4 * v8::internal::Assembler::kInstrSize));
1571 __ jr(at); 1569 __ jr(at);
1572 __ nop(); // Branch delay slot nop. 1570 __ nop(); // Branch delay slot nop.
1573 for (size_t index = 0; index < case_count; ++index) { 1571 for (size_t index = 0; index < case_count; ++index) {
1574 __ dd(GetLabel(i.InputRpo(index + 2))); 1572 __ dd(GetLabel(i.InputRpo(index + 2)));
1575 } 1573 }
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after
1886 padding_size -= v8::internal::Assembler::kInstrSize; 1884 padding_size -= v8::internal::Assembler::kInstrSize;
1887 } 1885 }
1888 } 1886 }
1889 } 1887 }
1890 1888
1891 #undef __ 1889 #undef __
1892 1890
1893 } // namespace compiler 1891 } // namespace compiler
1894 } // namespace internal 1892 } // namespace internal
1895 } // namespace v8 1893 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/ic/mips64/ic-mips64.cc » ('j') | src/mips64/assembler-mips64.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698