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

Side by Side Diff: src/mips/lithium-mips.cc

Issue 453043002: MIPS: Add support for arch. revision 6 to mips32 port. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 4 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 | Annotate | Revision Log
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 #if V8_TARGET_ARCH_MIPS 7 #if V8_TARGET_ARCH_MIPS
8 8
9 #include "src/hydrogen-osr.h" 9 #include "src/hydrogen-osr.h"
10 #include "src/lithium-inl.h" 10 #include "src/lithium-inl.h"
(...skipping 1307 matching lines...) Expand 10 before | Expand all | Expand 10 after
1318 return result; 1318 return result;
1319 } 1319 }
1320 1320
1321 1321
1322 LInstruction* LChunkBuilder::DoDivI(HDiv* instr) { 1322 LInstruction* LChunkBuilder::DoDivI(HDiv* instr) {
1323 DCHECK(instr->representation().IsSmiOrInteger32()); 1323 DCHECK(instr->representation().IsSmiOrInteger32());
1324 DCHECK(instr->left()->representation().Equals(instr->representation())); 1324 DCHECK(instr->left()->representation().Equals(instr->representation()));
1325 DCHECK(instr->right()->representation().Equals(instr->representation())); 1325 DCHECK(instr->right()->representation().Equals(instr->representation()));
1326 LOperand* dividend = UseRegister(instr->left()); 1326 LOperand* dividend = UseRegister(instr->left());
1327 LOperand* divisor = UseRegister(instr->right()); 1327 LOperand* divisor = UseRegister(instr->right());
1328 LOperand* temp = TempRegister();
1328 LInstruction* result = 1329 LInstruction* result =
1329 DefineAsRegister(new(zone()) LDivI(dividend, divisor)); 1330 DefineAsRegister(new(zone()) LDivI(dividend, divisor, temp));
1330 if (instr->CheckFlag(HValue::kCanBeDivByZero) || 1331 if (instr->CheckFlag(HValue::kCanBeDivByZero) ||
1331 instr->CheckFlag(HValue::kBailoutOnMinusZero) || 1332 instr->CheckFlag(HValue::kBailoutOnMinusZero) ||
1332 (instr->CheckFlag(HValue::kCanOverflow) && 1333 (instr->CheckFlag(HValue::kCanOverflow) &&
1333 !instr->CheckFlag(HValue::kAllUsesTruncatingToInt32)) || 1334 !instr->CheckFlag(HValue::kAllUsesTruncatingToInt32)) ||
1334 (!instr->IsMathFloorOfDiv() && 1335 (!instr->IsMathFloorOfDiv() &&
1335 !instr->CheckFlag(HValue::kAllUsesTruncatingToInt32))) { 1336 !instr->CheckFlag(HValue::kAllUsesTruncatingToInt32))) {
1336 result = AssignEnvironment(result); 1337 result = AssignEnvironment(result);
1337 } 1338 }
1338 return result; 1339 return result;
1339 } 1340 }
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
1504 } 1505 }
1505 right_op = UseRegister(right); 1506 right_op = UseRegister(right);
1506 } 1507 }
1507 LMulI* mul = new(zone()) LMulI(left_op, right_op); 1508 LMulI* mul = new(zone()) LMulI(left_op, right_op);
1508 if (can_overflow || bailout_on_minus_zero) { 1509 if (can_overflow || bailout_on_minus_zero) {
1509 AssignEnvironment(mul); 1510 AssignEnvironment(mul);
1510 } 1511 }
1511 return DefineAsRegister(mul); 1512 return DefineAsRegister(mul);
1512 1513
1513 } else if (instr->representation().IsDouble()) { 1514 } else if (instr->representation().IsDouble()) {
1514 if (kArchVariant == kMips32r2) { 1515 if (IsMipsArchVariant(kMips32r2)) {
paul.l... 2014/08/08 19:43:21 This should be IsMipsArchVariant(kMips32r2) || IsM
1515 if (instr->HasOneUse() && instr->uses().value()->IsAdd()) { 1516 if (instr->HasOneUse() && instr->uses().value()->IsAdd()) {
1516 HAdd* add = HAdd::cast(instr->uses().value()); 1517 HAdd* add = HAdd::cast(instr->uses().value());
1517 if (instr == add->left()) { 1518 if (instr == add->left()) {
1518 // This mul is the lhs of an add. The add and mul will be folded 1519 // This mul is the lhs of an add. The add and mul will be folded
1519 // into a multiply-add. 1520 // into a multiply-add.
1520 return NULL; 1521 return NULL;
1521 } 1522 }
1522 if (instr == add->right() && !add->left()->IsMul()) { 1523 if (instr == add->right() && !add->left()->IsMul()) {
1523 // This mul is the rhs of an add, where the lhs is not another mul. 1524 // This mul is the rhs of an add, where the lhs is not another mul.
1524 // The add and mul will be folded into a multiply-add. 1525 // The add and mul will be folded into a multiply-add.
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
1577 } else if (instr->representation().IsExternal()) { 1578 } else if (instr->representation().IsExternal()) {
1578 DCHECK(instr->left()->representation().IsExternal()); 1579 DCHECK(instr->left()->representation().IsExternal());
1579 DCHECK(instr->right()->representation().IsInteger32()); 1580 DCHECK(instr->right()->representation().IsInteger32());
1580 DCHECK(!instr->CheckFlag(HValue::kCanOverflow)); 1581 DCHECK(!instr->CheckFlag(HValue::kCanOverflow));
1581 LOperand* left = UseRegisterAtStart(instr->left()); 1582 LOperand* left = UseRegisterAtStart(instr->left());
1582 LOperand* right = UseOrConstantAtStart(instr->right()); 1583 LOperand* right = UseOrConstantAtStart(instr->right());
1583 LAddI* add = new(zone()) LAddI(left, right); 1584 LAddI* add = new(zone()) LAddI(left, right);
1584 LInstruction* result = DefineAsRegister(add); 1585 LInstruction* result = DefineAsRegister(add);
1585 return result; 1586 return result;
1586 } else if (instr->representation().IsDouble()) { 1587 } else if (instr->representation().IsDouble()) {
1587 if (kArchVariant == kMips32r2) { 1588 if (IsMipsArchVariant(kMips32r2)) {
paul.l... 2014/08/08 19:43:21 as above, also allowed on mips32r6.
1588 if (instr->left()->IsMul()) 1589 if (instr->left()->IsMul())
1589 return DoMultiplyAdd(HMul::cast(instr->left()), instr->right()); 1590 return DoMultiplyAdd(HMul::cast(instr->left()), instr->right());
1590 1591
1591 if (instr->right()->IsMul()) { 1592 if (instr->right()->IsMul()) {
1592 DCHECK(!instr->left()->IsMul()); 1593 DCHECK(!instr->left()->IsMul());
1593 return DoMultiplyAdd(HMul::cast(instr->right()), instr->left()); 1594 return DoMultiplyAdd(HMul::cast(instr->right()), instr->left());
1594 } 1595 }
1595 } 1596 }
1596 return DoArithmeticD(Token::ADD, instr); 1597 return DoArithmeticD(Token::ADD, instr);
1597 } else { 1598 } else {
(...skipping 973 matching lines...) Expand 10 before | Expand all | Expand 10 after
2571 LOperand* context = UseFixed(instr->context(), cp); 2572 LOperand* context = UseFixed(instr->context(), cp);
2572 LOperand* function = UseRegisterAtStart(instr->function()); 2573 LOperand* function = UseRegisterAtStart(instr->function());
2573 LAllocateBlockContext* result = 2574 LAllocateBlockContext* result =
2574 new(zone()) LAllocateBlockContext(context, function); 2575 new(zone()) LAllocateBlockContext(context, function);
2575 return MarkAsCall(DefineFixed(result, cp), instr); 2576 return MarkAsCall(DefineFixed(result, cp), instr);
2576 } 2577 }
2577 2578
2578 } } // namespace v8::internal 2579 } } // namespace v8::internal
2579 2580
2580 #endif // V8_TARGET_ARCH_MIPS 2581 #endif // V8_TARGET_ARCH_MIPS
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698