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

Side by Side Diff: src/mips64/lithium-codegen-mips64.cc

Issue 1153263012: MIPS64: Implement AddE lithium instruction to separate integer and address arithmetic. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 6 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/mips64/lithium-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 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 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/code-factory.h" 7 #include "src/code-factory.h"
8 #include "src/code-stubs.h" 8 #include "src/code-stubs.h"
9 #include "src/cpu-profiler.h" 9 #include "src/cpu-profiler.h"
10 #include "src/hydrogen-osr.h" 10 #include "src/hydrogen-osr.h"
(...skipping 1871 matching lines...) Expand 10 before | Expand all | Expand 10 after
1882 1882
1883 MemOperand operand = BuildSeqStringOperand(string, instr->index(), encoding); 1883 MemOperand operand = BuildSeqStringOperand(string, instr->index(), encoding);
1884 if (encoding == String::ONE_BYTE_ENCODING) { 1884 if (encoding == String::ONE_BYTE_ENCODING) {
1885 __ sb(value, operand); 1885 __ sb(value, operand);
1886 } else { 1886 } else {
1887 __ sh(value, operand); 1887 __ sh(value, operand);
1888 } 1888 }
1889 } 1889 }
1890 1890
1891 1891
1892 void LCodeGen::DoAddE(LAddE* instr) {
1893 LOperand* result = instr->result();
1894 LOperand* left = instr->left();
1895 LOperand* right = instr->right();
1896
1897 DCHECK(!instr->hydrogen()->CheckFlag(HValue::kCanOverflow));
1898 DCHECK(right->IsRegister() || right->IsConstantOperand());
1899 __ Daddu(ToRegister(result), ToRegister(left), ToOperand(right));
1900 }
1901
1902
1892 void LCodeGen::DoAddI(LAddI* instr) { 1903 void LCodeGen::DoAddI(LAddI* instr) {
1893 LOperand* left = instr->left(); 1904 LOperand* left = instr->left();
1894 LOperand* right = instr->right(); 1905 LOperand* right = instr->right();
1895 LOperand* result = instr->result(); 1906 LOperand* result = instr->result();
1896 bool can_overflow = instr->hydrogen()->CheckFlag(HValue::kCanOverflow); 1907 bool can_overflow = instr->hydrogen()->CheckFlag(HValue::kCanOverflow);
1897 1908
1898 if (!can_overflow) { 1909 if (!can_overflow) {
1899 if (right->IsStackSlot()) { 1910 DCHECK(right->IsRegister());
1900 Register right_reg = EmitLoadRegister(right, at); 1911 __ Daddu(ToRegister(result), ToRegister(left), ToOperand(right));
1901 __ Daddu(ToRegister(result), ToRegister(left), Operand(right_reg));
1902 } else {
1903 DCHECK(right->IsRegister() || right->IsConstantOperand());
1904 __ Daddu(ToRegister(result), ToRegister(left), ToOperand(right));
1905 }
1906 } else { // can_overflow. 1912 } else { // can_overflow.
1907 Register overflow = scratch0(); 1913 Register overflow = scratch0();
1908 Register scratch = scratch1(); 1914 Register scratch = scratch1();
1909 if (right->IsStackSlot() || 1915 if (right->IsConstantOperand()) {
1910 right->IsConstantOperand()) {
1911 Register right_reg = EmitLoadRegister(right, scratch); 1916 Register right_reg = EmitLoadRegister(right, scratch);
1912 __ AdduAndCheckForOverflow(ToRegister(result), 1917 __ AdduAndCheckForOverflow(ToRegister(result),
1913 ToRegister(left), 1918 ToRegister(left),
1914 right_reg, 1919 right_reg,
1915 overflow); // Reg at also used as scratch. 1920 overflow); // Reg at also used as scratch.
1916 } else { 1921 } else {
1917 DCHECK(right->IsRegister()); 1922 DCHECK(right->IsRegister());
1918 // Due to overflow check macros not supporting constant operands, 1923 // Due to overflow check macros not supporting constant operands,
1919 // handling the IsConstantOperand case was moved to prev if clause. 1924 // handling the IsConstantOperand case was moved to prev if clause.
1920 __ AdduAndCheckForOverflow(ToRegister(result), 1925 __ AdduAndCheckForOverflow(ToRegister(result),
(...skipping 4197 matching lines...) Expand 10 before | Expand all | Expand 10 after
6118 __ Push(at, ToRegister(instr->function())); 6123 __ Push(at, ToRegister(instr->function()));
6119 CallRuntime(Runtime::kPushBlockContext, 2, instr); 6124 CallRuntime(Runtime::kPushBlockContext, 2, instr);
6120 RecordSafepoint(Safepoint::kNoLazyDeopt); 6125 RecordSafepoint(Safepoint::kNoLazyDeopt);
6121 } 6126 }
6122 6127
6123 6128
6124 #undef __ 6129 #undef __
6125 6130
6126 } // namespace internal 6131 } // namespace internal
6127 } // namespace v8 6132 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/mips64/lithium-mips64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698