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

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

Issue 23536045: ARM: Tweak the integer division operation. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 3 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 | « no previous file | src/arm/lithium-codegen-arm.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 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 1355 matching lines...) Expand 10 before | Expand all | Expand 10 after
1366 1366
1367 LInstruction* LChunkBuilder::DoDiv(HDiv* instr) { 1367 LInstruction* LChunkBuilder::DoDiv(HDiv* instr) {
1368 if (instr->representation().IsDouble()) { 1368 if (instr->representation().IsDouble()) {
1369 return DoArithmeticD(Token::DIV, instr); 1369 return DoArithmeticD(Token::DIV, instr);
1370 } else if (instr->representation().IsSmiOrInteger32()) { 1370 } else if (instr->representation().IsSmiOrInteger32()) {
1371 ASSERT(instr->left()->representation().Equals(instr->representation())); 1371 ASSERT(instr->left()->representation().Equals(instr->representation()));
1372 ASSERT(instr->right()->representation().Equals(instr->representation())); 1372 ASSERT(instr->right()->representation().Equals(instr->representation()));
1373 if (instr->HasPowerOf2Divisor()) { 1373 if (instr->HasPowerOf2Divisor()) {
1374 ASSERT(!instr->CheckFlag(HValue::kCanBeDivByZero)); 1374 ASSERT(!instr->CheckFlag(HValue::kCanBeDivByZero));
1375 LOperand* value = UseRegisterAtStart(instr->left()); 1375 LOperand* value = UseRegisterAtStart(instr->left());
1376 LDivI* div = 1376 LDivI* div = new(zone()) LDivI(value, UseConstant(instr->right()), NULL);
1377 new(zone()) LDivI(value, UseOrConstant(instr->right()), NULL); 1377 return AssignEnvironment(DefineAsRegister(div));
1378 return AssignEnvironment(DefineSameAsFirst(div));
1379 } 1378 }
1380 LOperand* dividend = UseRegister(instr->left()); 1379 LOperand* dividend = UseRegister(instr->left());
1381 LOperand* divisor = UseRegister(instr->right()); 1380 LOperand* divisor = UseRegister(instr->right());
1382 LOperand* temp = CpuFeatures::IsSupported(SUDIV) ? NULL : FixedTemp(d4); 1381 LOperand* temp = CpuFeatures::IsSupported(SUDIV) ? NULL : FixedTemp(d4);
1383 LDivI* div = new(zone()) LDivI(dividend, divisor, temp); 1382 LDivI* div = new(zone()) LDivI(dividend, divisor, temp);
1384 return AssignEnvironment(DefineAsRegister(div)); 1383 return AssignEnvironment(DefineAsRegister(div));
1385 } else { 1384 } else {
1386 return DoArithmeticT(Token::DIV, instr); 1385 return DoArithmeticT(Token::DIV, instr);
1387 } 1386 }
1388 } 1387 }
(...skipping 1233 matching lines...) Expand 10 before | Expand all | Expand 10 after
2622 2621
2623 2622
2624 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { 2623 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) {
2625 LOperand* object = UseRegister(instr->object()); 2624 LOperand* object = UseRegister(instr->object());
2626 LOperand* index = UseRegister(instr->index()); 2625 LOperand* index = UseRegister(instr->index());
2627 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index)); 2626 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index));
2628 } 2627 }
2629 2628
2630 2629
2631 } } // namespace v8::internal 2630 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/arm/lithium-codegen-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698