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

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

Issue 166793002: Fixed and improved code for integral division. Fixed and extended tests. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: A64 fixes and cleanup 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
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 1218 matching lines...) Expand 10 before | Expand all | Expand 10 after
1229 } 1229 }
1230 } 1230 }
1231 1231
1232 1232
1233 LInstruction* LChunkBuilder::DoDiv(HDiv* instr) { 1233 LInstruction* LChunkBuilder::DoDiv(HDiv* instr) {
1234 if (instr->representation().IsSmiOrInteger32()) { 1234 if (instr->representation().IsSmiOrInteger32()) {
1235 ASSERT(instr->left()->representation().Equals(instr->representation())); 1235 ASSERT(instr->left()->representation().Equals(instr->representation()));
1236 ASSERT(instr->right()->representation().Equals(instr->representation())); 1236 ASSERT(instr->right()->representation().Equals(instr->representation()));
1237 if (instr->RightIsPowerOf2()) { 1237 if (instr->RightIsPowerOf2()) {
1238 ASSERT(!instr->CheckFlag(HValue::kCanBeDivByZero)); 1238 ASSERT(!instr->CheckFlag(HValue::kCanBeDivByZero));
1239 LOperand* value = UseRegisterAtStart(instr->left()); 1239 LOperand* value = UseRegister(instr->left());
1240 LDivI* div = new(zone()) LDivI(value, UseConstant(instr->right()), NULL); 1240 LDivI* div = new(zone()) LDivI(value, UseConstant(instr->right()), NULL);
1241 return AssignEnvironment(DefineAsRegister(div)); 1241 return AssignEnvironment(DefineAsRegister(div));
1242 } 1242 }
1243 LOperand* dividend = UseRegister(instr->left()); 1243 LOperand* dividend = UseRegister(instr->left());
1244 LOperand* divisor = UseRegister(instr->right()); 1244 LOperand* divisor = UseRegister(instr->right());
1245 LOperand* temp = CpuFeatures::IsSupported(SUDIV) ? NULL : FixedTemp(d4); 1245 LOperand* temp = CpuFeatures::IsSupported(SUDIV) ? NULL : FixedTemp(d4);
1246 LDivI* div = new(zone()) LDivI(dividend, divisor, temp); 1246 LDivI* div = new(zone()) LDivI(dividend, divisor, temp);
1247 return AssignEnvironment(DefineAsRegister(div)); 1247 return AssignEnvironment(DefineAsRegister(div));
1248 } else if (instr->representation().IsDouble()) { 1248 } else if (instr->representation().IsDouble()) {
1249 return DoArithmeticD(Token::DIV, instr); 1249 return DoArithmeticD(Token::DIV, instr);
(...skipping 1218 matching lines...) Expand 10 before | Expand all | Expand 10 after
2468 } 2468 }
2469 2469
2470 2470
2471 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { 2471 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) {
2472 LOperand* object = UseRegister(instr->object()); 2472 LOperand* object = UseRegister(instr->object());
2473 LOperand* index = UseRegister(instr->index()); 2473 LOperand* index = UseRegister(instr->index());
2474 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index)); 2474 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index));
2475 } 2475 }
2476 2476
2477 } } // namespace v8::internal 2477 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698