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

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

Issue 145273014: A64: Implement LModI for ARM A64. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/a64
Patch Set: Created 6 years, 10 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
« no previous file with comments | « src/a64/lithium-a64.h ('k') | src/a64/lithium-codegen-a64.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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 1743 matching lines...) Expand 10 before | Expand all | Expand 10 after
1754 ASSERT(instr->representation().IsDouble()); 1754 ASSERT(instr->representation().IsDouble());
1755 ASSERT(instr->left()->representation().IsDouble()); 1755 ASSERT(instr->left()->representation().IsDouble());
1756 ASSERT(instr->right()->representation().IsDouble()); 1756 ASSERT(instr->right()->representation().IsDouble());
1757 left = UseRegisterAtStart(instr->left()); 1757 left = UseRegisterAtStart(instr->left());
1758 right = UseRegisterAtStart(instr->right()); 1758 right = UseRegisterAtStart(instr->right());
1759 } 1759 }
1760 return DefineAsRegister(new(zone()) LMathMinMax(left, right)); 1760 return DefineAsRegister(new(zone()) LMathMinMax(left, right));
1761 } 1761 }
1762 1762
1763 1763
1764 LInstruction* LChunkBuilder::DoMod(HMod* instr) { 1764 LInstruction* LChunkBuilder::DoMod(HMod* hmod) {
1765 if (instr->representation().IsInteger32()) { 1765 HValue* hleft = hmod->left();
1766 ASSERT(instr->left()->representation().IsInteger32()); 1766 HValue* hright = hmod->right();
1767 ASSERT(instr->right()->representation().IsInteger32());
1768 1767
1769 UNIMPLEMENTED_INSTRUCTION(); 1768 if (hmod->representation().IsInteger32()) {
1770 } else if (instr->representation().IsSmiOrTagged()) { 1769 ASSERT(hleft->representation().IsInteger32());
1771 UNIMPLEMENTED_INSTRUCTION(); 1770 ASSERT(hleft->representation().IsInteger32());
1771 LOperand* left_op;
1772 LOperand* right_op;
1773
1774 if (hmod->HasPowerOf2Divisor()) {
1775 left_op = UseRegisterAtStart(hleft);
1776 right_op = UseConstant(hright);
1777 } else {
1778 right_op = UseRegister(hright);
1779 left_op = UseRegister(hleft);
1780 }
1781
1782 LModI* lmod = new(zone()) LModI(left_op, right_op);
1783
1784 if (hmod->right()->CanBeZero() ||
1785 (hmod->CheckFlag(HValue::kBailoutOnMinusZero) &&
1786 hmod->left()->CanBeNegative() && hmod->CanBeZero())) {
1787 AssignEnvironment(lmod);
1788 }
1789 return DefineAsRegister(lmod);
1790
1791 } else if (hmod->representation().IsSmiOrTagged()) {
1792 return DoArithmeticT(Token::MOD, hmod);
1772 } else { 1793 } else {
1773 return DoArithmeticD(Token::MOD, instr); 1794 return DoArithmeticD(Token::MOD, hmod);
1774 } 1795 }
1775 } 1796 }
1776 1797
1777 1798
1778 LInstruction* LChunkBuilder::DoMul(HMul* instr) { 1799 LInstruction* LChunkBuilder::DoMul(HMul* instr) {
1779 if (instr->representation().IsInteger32()) { 1800 if (instr->representation().IsInteger32()) {
1780 ASSERT(instr->left()->representation().IsInteger32()); 1801 ASSERT(instr->left()->representation().IsInteger32());
1781 ASSERT(instr->right()->representation().IsInteger32()); 1802 ASSERT(instr->right()->representation().IsInteger32());
1782 1803
1783 bool can_overflow = instr->CheckFlag(HValue::kCanOverflow); 1804 bool can_overflow = instr->CheckFlag(HValue::kCanOverflow);
(...skipping 674 matching lines...) Expand 10 before | Expand all | Expand 10 after
2458 LInstruction* LChunkBuilder::DoWrapReceiver(HWrapReceiver* instr) { 2479 LInstruction* LChunkBuilder::DoWrapReceiver(HWrapReceiver* instr) {
2459 LOperand* receiver = UseRegister(instr->receiver()); 2480 LOperand* receiver = UseRegister(instr->receiver());
2460 LOperand* function = UseRegisterAtStart(instr->function()); 2481 LOperand* function = UseRegisterAtStart(instr->function());
2461 LOperand* temp = TempRegister(); 2482 LOperand* temp = TempRegister();
2462 LWrapReceiver* result = new(zone()) LWrapReceiver(receiver, function, temp); 2483 LWrapReceiver* result = new(zone()) LWrapReceiver(receiver, function, temp);
2463 return AssignEnvironment(DefineAsRegister(result)); 2484 return AssignEnvironment(DefineAsRegister(result));
2464 } 2485 }
2465 2486
2466 2487
2467 } } // namespace v8::internal 2488 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/a64/lithium-a64.h ('k') | src/a64/lithium-codegen-a64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698