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

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

Issue 11308040: ARM: Emit RSB (reverse-subtract) for subtraction with constant lhs (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebase, address comments Created 8 years, 1 month 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
« no previous file with comments | « src/arm/lithium-arm.cc ('k') | no next file » | 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 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 1601 matching lines...) Expand 10 before | Expand all | Expand 10 after
1612 ASSERT(right->IsRegister() || right->IsConstantOperand()); 1612 ASSERT(right->IsRegister() || right->IsConstantOperand());
1613 __ sub(ToRegister(result), ToRegister(left), ToOperand(right), set_cond); 1613 __ sub(ToRegister(result), ToRegister(left), ToOperand(right), set_cond);
1614 } 1614 }
1615 1615
1616 if (can_overflow) { 1616 if (can_overflow) {
1617 DeoptimizeIf(vs, instr->environment()); 1617 DeoptimizeIf(vs, instr->environment());
1618 } 1618 }
1619 } 1619 }
1620 1620
1621 1621
1622 void LCodeGen::DoRSubI(LRSubI* instr) {
1623 LOperand* left = instr->left();
1624 LOperand* right = instr->right();
1625 LOperand* result = instr->result();
1626 bool can_overflow = instr->hydrogen()->CheckFlag(HValue::kCanOverflow);
1627 SBit set_cond = can_overflow ? SetCC : LeaveCC;
1628
1629 if (right->IsStackSlot() || right->IsArgument()) {
1630 Register right_reg = EmitLoadRegister(right, ip);
1631 __ rsb(ToRegister(result), ToRegister(left), Operand(right_reg), set_cond);
1632 } else {
1633 ASSERT(right->IsRegister() || right->IsConstantOperand());
1634 __ rsb(ToRegister(result), ToRegister(left), ToOperand(right), set_cond);
1635 }
1636
1637 if (can_overflow) {
1638 DeoptimizeIf(vs, instr->environment());
1639 }
1640 }
1641
1642
1622 void LCodeGen::DoConstantI(LConstantI* instr) { 1643 void LCodeGen::DoConstantI(LConstantI* instr) {
1623 ASSERT(instr->result()->IsRegister()); 1644 ASSERT(instr->result()->IsRegister());
1624 __ mov(ToRegister(instr->result()), Operand(instr->value())); 1645 __ mov(ToRegister(instr->result()), Operand(instr->value()));
1625 } 1646 }
1626 1647
1627 1648
1628 void LCodeGen::DoConstantD(LConstantD* instr) { 1649 void LCodeGen::DoConstantD(LConstantD* instr) {
1629 ASSERT(instr->result()->IsDoubleRegister()); 1650 ASSERT(instr->result()->IsDoubleRegister());
1630 DwVfpRegister result = ToDoubleRegister(instr->result()); 1651 DwVfpRegister result = ToDoubleRegister(instr->result());
1631 double v = instr->value(); 1652 double v = instr->value();
(...skipping 4118 matching lines...) Expand 10 before | Expand all | Expand 10 after
5750 __ sub(scratch, result, Operand(index, LSL, kPointerSizeLog2 - kSmiTagSize)); 5771 __ sub(scratch, result, Operand(index, LSL, kPointerSizeLog2 - kSmiTagSize));
5751 __ ldr(result, FieldMemOperand(scratch, 5772 __ ldr(result, FieldMemOperand(scratch,
5752 FixedArray::kHeaderSize - kPointerSize)); 5773 FixedArray::kHeaderSize - kPointerSize));
5753 __ bind(&done); 5774 __ bind(&done);
5754 } 5775 }
5755 5776
5756 5777
5757 #undef __ 5778 #undef __
5758 5779
5759 } } // namespace v8::internal 5780 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/arm/lithium-arm.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698