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

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

Issue 258793002: ARM64: Generate optimized code for Math.floor and Math.round with double outputs. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Change C-style comments to C++-style comments Created 6 years, 7 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/arm64/lithium-arm64.h ('k') | src/arm64/lithium-codegen-arm64.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 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "v8.h" 5 #include "v8.h"
6 6
7 #include "lithium-allocator-inl.h" 7 #include "lithium-allocator-inl.h"
8 #include "arm64/lithium-arm64.h" 8 #include "arm64/lithium-arm64.h"
9 #include "arm64/lithium-codegen-arm64.h" 9 #include "arm64/lithium-codegen-arm64.h"
10 #include "hydrogen-osr.h" 10 #include "hydrogen-osr.h"
(...skipping 2426 matching lines...) Expand 10 before | Expand all | Expand 10 after
2437 // TODO(all): Implement TempFPRegister. 2437 // TODO(all): Implement TempFPRegister.
2438 LOperand* double_temp1 = FixedTemp(d24); // This was chosen arbitrarily. 2438 LOperand* double_temp1 = FixedTemp(d24); // This was chosen arbitrarily.
2439 LOperand* temp1 = TempRegister(); 2439 LOperand* temp1 = TempRegister();
2440 LOperand* temp2 = TempRegister(); 2440 LOperand* temp2 = TempRegister();
2441 LOperand* temp3 = TempRegister(); 2441 LOperand* temp3 = TempRegister();
2442 LMathExp* result = new(zone()) LMathExp(input, double_temp1, 2442 LMathExp* result = new(zone()) LMathExp(input, double_temp1,
2443 temp1, temp2, temp3); 2443 temp1, temp2, temp3);
2444 return DefineAsRegister(result); 2444 return DefineAsRegister(result);
2445 } 2445 }
2446 case kMathFloor: { 2446 case kMathFloor: {
2447 ASSERT(instr->representation().IsInteger32());
2448 ASSERT(instr->value()->representation().IsDouble()); 2447 ASSERT(instr->value()->representation().IsDouble());
2449 // TODO(jbramley): ARM64 can easily handle a double argument with frintm,
2450 // but we're never asked for it here. At the moment, we fall back to the
2451 // runtime if the result doesn't fit, like the other architectures.
2452 LOperand* input = UseRegisterAtStart(instr->value()); 2448 LOperand* input = UseRegisterAtStart(instr->value());
2453 LMathFloor* result = new(zone()) LMathFloor(input); 2449 if (instr->representation().IsInteger32()) {
2454 return AssignEnvironment(AssignPointerMap(DefineAsRegister(result))); 2450 LMathFloorI* result = new(zone()) LMathFloorI(input);
2451 return AssignEnvironment(AssignPointerMap(DefineAsRegister(result)));
2452 } else {
2453 ASSERT(instr->representation().IsDouble());
2454 LMathFloorD* result = new(zone()) LMathFloorD(input);
2455 return DefineAsRegister(result);
2456 }
2455 } 2457 }
2456 case kMathLog: { 2458 case kMathLog: {
2457 ASSERT(instr->representation().IsDouble()); 2459 ASSERT(instr->representation().IsDouble());
2458 ASSERT(instr->value()->representation().IsDouble()); 2460 ASSERT(instr->value()->representation().IsDouble());
2459 LOperand* input = UseFixedDouble(instr->value(), d0); 2461 LOperand* input = UseFixedDouble(instr->value(), d0);
2460 LMathLog* result = new(zone()) LMathLog(input); 2462 LMathLog* result = new(zone()) LMathLog(input);
2461 return MarkAsCall(DefineFixedDouble(result, d0), instr); 2463 return MarkAsCall(DefineFixedDouble(result, d0), instr);
2462 } 2464 }
2463 case kMathPowHalf: { 2465 case kMathPowHalf: {
2464 ASSERT(instr->representation().IsDouble()); 2466 ASSERT(instr->representation().IsDouble());
2465 ASSERT(instr->value()->representation().IsDouble()); 2467 ASSERT(instr->value()->representation().IsDouble());
2466 LOperand* input = UseRegister(instr->value()); 2468 LOperand* input = UseRegister(instr->value());
2467 return DefineAsRegister(new(zone()) LMathPowHalf(input)); 2469 return DefineAsRegister(new(zone()) LMathPowHalf(input));
2468 } 2470 }
2469 case kMathRound: { 2471 case kMathRound: {
2470 ASSERT(instr->representation().IsInteger32());
2471 ASSERT(instr->value()->representation().IsDouble()); 2472 ASSERT(instr->value()->representation().IsDouble());
2472 // TODO(jbramley): As with kMathFloor, we can probably handle double
2473 // results fairly easily, but we are never asked for them.
2474 LOperand* input = UseRegister(instr->value()); 2473 LOperand* input = UseRegister(instr->value());
2475 LOperand* temp = FixedTemp(d24); // Choosen arbitrarily. 2474 if (instr->representation().IsInteger32()) {
2476 LMathRound* result = new(zone()) LMathRound(input, temp); 2475 LMathRoundI* result = new(zone()) LMathRoundI(input, FixedTemp(d24));
2477 return AssignEnvironment(DefineAsRegister(result)); 2476 return AssignEnvironment(DefineAsRegister(result));
2477 } else {
2478 ASSERT(instr->representation().IsDouble());
2479 LMathRoundD* result = new(zone()) LMathRoundD(input);
2480 return DefineAsRegister(result);
2481 }
2478 } 2482 }
2479 case kMathSqrt: { 2483 case kMathSqrt: {
2480 ASSERT(instr->representation().IsDouble()); 2484 ASSERT(instr->representation().IsDouble());
2481 ASSERT(instr->value()->representation().IsDouble()); 2485 ASSERT(instr->value()->representation().IsDouble());
2482 LOperand* input = UseRegisterAtStart(instr->value()); 2486 LOperand* input = UseRegisterAtStart(instr->value());
2483 return DefineAsRegister(new(zone()) LMathSqrt(input)); 2487 return DefineAsRegister(new(zone()) LMathSqrt(input));
2484 } 2488 }
2485 case kMathClz32: { 2489 case kMathClz32: {
2486 ASSERT(instr->representation().IsInteger32()); 2490 ASSERT(instr->representation().IsInteger32());
2487 ASSERT(instr->value()->representation().IsInteger32()); 2491 ASSERT(instr->value()->representation().IsInteger32());
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
2553 2557
2554 LInstruction* LChunkBuilder::DoWrapReceiver(HWrapReceiver* instr) { 2558 LInstruction* LChunkBuilder::DoWrapReceiver(HWrapReceiver* instr) {
2555 LOperand* receiver = UseRegister(instr->receiver()); 2559 LOperand* receiver = UseRegister(instr->receiver());
2556 LOperand* function = UseRegister(instr->function()); 2560 LOperand* function = UseRegister(instr->function());
2557 LWrapReceiver* result = new(zone()) LWrapReceiver(receiver, function); 2561 LWrapReceiver* result = new(zone()) LWrapReceiver(receiver, function);
2558 return AssignEnvironment(DefineAsRegister(result)); 2562 return AssignEnvironment(DefineAsRegister(result));
2559 } 2563 }
2560 2564
2561 2565
2562 } } // namespace v8::internal 2566 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/arm64/lithium-arm64.h ('k') | src/arm64/lithium-codegen-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698