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

Side by Side Diff: src/a64/lithium-a64.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 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 1363 matching lines...) Expand 10 before | Expand all | Expand 10 after
1374 } 1374 }
1375 1375
1376 1376
1377 LInstruction* LChunkBuilder::DoDiv(HDiv* instr) { 1377 LInstruction* LChunkBuilder::DoDiv(HDiv* instr) {
1378 if (instr->representation().IsInteger32()) { 1378 if (instr->representation().IsInteger32()) {
1379 // TODO(all): Update this case to support smi inputs. 1379 // TODO(all): Update this case to support smi inputs.
1380 ASSERT(instr->left()->representation().Equals(instr->representation())); 1380 ASSERT(instr->left()->representation().Equals(instr->representation()));
1381 ASSERT(instr->right()->representation().Equals(instr->representation())); 1381 ASSERT(instr->right()->representation().Equals(instr->representation()));
1382 if (instr->RightIsPowerOf2()) { 1382 if (instr->RightIsPowerOf2()) {
1383 ASSERT(!instr->CheckFlag(HValue::kCanBeDivByZero)); 1383 ASSERT(!instr->CheckFlag(HValue::kCanBeDivByZero));
1384 LOperand* value = UseRegisterAtStart(instr->left()); 1384 LOperand* value = UseRegister(instr->left());
1385 LDivI* div = new(zone()) LDivI(value, UseConstant(instr->right()), NULL); 1385 LDivI* div = new(zone()) LDivI(value, UseConstant(instr->right()), NULL);
1386 return AssignEnvironment(DefineAsRegister(div)); 1386 return AssignEnvironment(DefineAsRegister(div));
1387 } 1387 }
1388 LOperand* dividend = UseRegister(instr->left()); 1388 LOperand* dividend = UseRegister(instr->left());
1389 LOperand* divisor = UseRegister(instr->right()); 1389 LOperand* divisor = UseRegister(instr->right());
1390 LOperand* temp = instr->CheckFlag(HInstruction::kAllUsesTruncatingToInt32) 1390 LOperand* temp = instr->CheckFlag(HInstruction::kAllUsesTruncatingToInt32)
1391 ? NULL : TempRegister(); 1391 ? NULL : TempRegister();
1392 LDivI* div = new(zone()) LDivI(dividend, divisor, temp); 1392 LDivI* div = new(zone()) LDivI(dividend, divisor, temp);
1393 return AssignEnvironment(DefineAsRegister(div)); 1393 return AssignEnvironment(DefineAsRegister(div));
1394 } else if (instr->representation().IsDouble()) { 1394 } else if (instr->representation().IsDouble()) {
(...skipping 1045 matching lines...) Expand 10 before | Expand all | Expand 10 after
2440 2440
2441 LInstruction* LChunkBuilder::DoWrapReceiver(HWrapReceiver* instr) { 2441 LInstruction* LChunkBuilder::DoWrapReceiver(HWrapReceiver* instr) {
2442 LOperand* receiver = UseRegister(instr->receiver()); 2442 LOperand* receiver = UseRegister(instr->receiver());
2443 LOperand* function = UseRegister(instr->function()); 2443 LOperand* function = UseRegister(instr->function());
2444 LWrapReceiver* result = new(zone()) LWrapReceiver(receiver, function); 2444 LWrapReceiver* result = new(zone()) LWrapReceiver(receiver, function);
2445 return AssignEnvironment(DefineAsRegister(result)); 2445 return AssignEnvironment(DefineAsRegister(result));
2446 } 2446 }
2447 2447
2448 2448
2449 } } // namespace v8::internal 2449 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698