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

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

Issue 12052032: Improve integer division on ARM in favor of power of 2 constant divisor (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 7 years, 9 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 1183 matching lines...) Expand 10 before | Expand all | Expand 10 after
1194 if (instr->HasNoUses()) return NULL; 1194 if (instr->HasNoUses()) return NULL;
1195 LOperand* value = UseRegisterAtStart(instr->value()); 1195 LOperand* value = UseRegisterAtStart(instr->value());
1196 return DefineAsRegister(new(zone()) LBitNotI(value)); 1196 return DefineAsRegister(new(zone()) LBitNotI(value));
1197 } 1197 }
1198 1198
1199 1199
1200 LInstruction* LChunkBuilder::DoDiv(HDiv* instr) { 1200 LInstruction* LChunkBuilder::DoDiv(HDiv* instr) {
1201 if (instr->representation().IsDouble()) { 1201 if (instr->representation().IsDouble()) {
1202 return DoArithmeticD(Token::DIV, instr); 1202 return DoArithmeticD(Token::DIV, instr);
1203 } else if (instr->representation().IsInteger32()) { 1203 } else if (instr->representation().IsInteger32()) {
1204 if (instr->HasPowerOf2Divisor()) {
1205 ASSERT(!instr->CheckFlag(HValue::kCanBeDivByZero));
1206 LOperand* value = UseRegisterAtStart(instr->left());
1207 LDivI* div =
1208 new(zone()) LDivI(value, UseOrConstant(instr->right()));
1209 return AssignEnvironment(DefineSameAsFirst(div));
1210 }
1204 // TODO(1042) The fixed register allocation 1211 // TODO(1042) The fixed register allocation
1205 // is needed because we call TypeRecordingBinaryOpStub from 1212 // is needed because we call TypeRecordingBinaryOpStub from
1206 // the generated code, which requires registers r0 1213 // the generated code, which requires registers r0
1207 // and r1 to be used. We should remove that 1214 // and r1 to be used. We should remove that
1208 // when we provide a native implementation. 1215 // when we provide a native implementation.
1209 LOperand* dividend = UseFixed(instr->left(), r0); 1216 LOperand* dividend = UseFixed(instr->left(), r0);
1210 LOperand* divisor = UseFixed(instr->right(), r1); 1217 LOperand* divisor = UseFixed(instr->right(), r1);
1211 return AssignEnvironment(AssignPointerMap( 1218 return AssignEnvironment(AssignPointerMap(
1212 DefineFixed(new(zone()) LDivI(dividend, divisor), r0))); 1219 DefineFixed(new(zone()) LDivI(dividend, divisor), r0)));
1213 } else { 1220 } else {
(...skipping 1241 matching lines...) Expand 10 before | Expand all | Expand 10 after
2455 2462
2456 2463
2457 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { 2464 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) {
2458 LOperand* object = UseRegister(instr->object()); 2465 LOperand* object = UseRegister(instr->object());
2459 LOperand* index = UseRegister(instr->index()); 2466 LOperand* index = UseRegister(instr->index());
2460 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index)); 2467 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index));
2461 } 2468 }
2462 2469
2463 2470
2464 } } // namespace v8::internal 2471 } } // 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