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

Side by Side Diff: runtime/vm/intermediate_language_mips.cc

Issue 262823009: Convert BinadryDoubleOp to MathUnaryInstr double-square if both inputs are the same. Uses less regi… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: 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 | « runtime/vm/intermediate_language_ia32.cc ('k') | runtime/vm/intermediate_language_x64.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 (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_MIPS. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_MIPS.
6 #if defined(TARGET_ARCH_MIPS) 6 #if defined(TARGET_ARCH_MIPS)
7 7
8 #include "vm/intermediate_language.h" 8 #include "vm/intermediate_language.h"
9 9
10 #include "vm/dart_entry.h" 10 #include "vm/dart_entry.h"
(...skipping 3494 matching lines...) Expand 10 before | Expand all | Expand 10 after
3505 return NULL; 3505 return NULL;
3506 } 3506 }
3507 3507
3508 3508
3509 void BinaryInt32x4OpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 3509 void BinaryInt32x4OpInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
3510 UNIMPLEMENTED(); 3510 UNIMPLEMENTED();
3511 } 3511 }
3512 3512
3513 3513
3514 LocationSummary* MathUnaryInstr::MakeLocationSummary(bool opt) const { 3514 LocationSummary* MathUnaryInstr::MakeLocationSummary(bool opt) const {
3515 if ((kind() == MethodRecognizer::kMathSin) || 3515 if ((kind() == MathUnaryInstr::kSin) || (kind() == MathUnaryInstr::kCos)) {
3516 (kind() == MethodRecognizer::kMathCos)) {
3517 const intptr_t kNumInputs = 1; 3516 const intptr_t kNumInputs = 1;
3518 const intptr_t kNumTemps = 0; 3517 const intptr_t kNumTemps = 0;
3519 LocationSummary* summary = 3518 LocationSummary* summary =
3520 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall); 3519 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall);
3521 summary->set_in(0, Location::FpuRegisterLocation(D6)); 3520 summary->set_in(0, Location::FpuRegisterLocation(D6));
3522 summary->set_out(0, Location::FpuRegisterLocation(D0)); 3521 summary->set_out(0, Location::FpuRegisterLocation(D0));
3523 return summary; 3522 return summary;
3524 } 3523 }
3524 ASSERT((kind() == MathUnaryInstr::kSqrt) ||
3525 (kind() == MathUnaryInstr::kDoubleSquare));
3525 const intptr_t kNumInputs = 1; 3526 const intptr_t kNumInputs = 1;
3526 const intptr_t kNumTemps = 0; 3527 const intptr_t kNumTemps = 0;
3527 LocationSummary* summary = 3528 LocationSummary* summary =
3528 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); 3529 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
3529 summary->set_in(0, Location::RequiresFpuRegister()); 3530 summary->set_in(0, Location::RequiresFpuRegister());
3530 summary->set_out(0, Location::RequiresFpuRegister()); 3531 summary->set_out(0, Location::RequiresFpuRegister());
3531 return summary; 3532 return summary;
3532 } 3533 }
3533 3534
3534 3535
3535 void MathUnaryInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 3536 void MathUnaryInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
3536 if (kind() == MethodRecognizer::kMathSqrt) { 3537 if (kind() == MathUnaryInstr::kSqrt) {
3537 __ sqrtd(locs()->out(0).fpu_reg(), locs()->in(0).fpu_reg()); 3538 __ sqrtd(locs()->out(0).fpu_reg(), locs()->in(0).fpu_reg());
3539 } else if (kind() == MathUnaryInstr::kDoubleSquare) {
3540 DRegister val = locs()->in(0).fpu_reg();
3541 DRegister result = locs()->out(0).fpu_reg();
3542 __ muld(result, val, val);
3538 } else { 3543 } else {
3539 __ CallRuntime(TargetFunction(), InputCount()); 3544 __ CallRuntime(TargetFunction(), InputCount());
3540 } 3545 }
3541 } 3546 }
3542 3547
3543 3548
3544 LocationSummary* MathMinMaxInstr::MakeLocationSummary(bool opt) const { 3549 LocationSummary* MathMinMaxInstr::MakeLocationSummary(bool opt) const {
3545 if (result_cid() == kDoubleCid) { 3550 if (result_cid() == kDoubleCid) {
3546 const intptr_t kNumInputs = 2; 3551 const intptr_t kNumInputs = 2;
3547 const intptr_t kNumTemps = 1; 3552 const intptr_t kNumTemps = 1;
(...skipping 949 matching lines...) Expand 10 before | Expand all | Expand 10 after
4497 compiler->GenerateCall(token_pos(), 4502 compiler->GenerateCall(token_pos(),
4498 &label, 4503 &label,
4499 PcDescriptors::kOther, 4504 PcDescriptors::kOther,
4500 locs()); 4505 locs());
4501 __ Drop(ArgumentCount()); // Discard arguments. 4506 __ Drop(ArgumentCount()); // Discard arguments.
4502 } 4507 }
4503 4508
4504 } // namespace dart 4509 } // namespace dart
4505 4510
4506 #endif // defined TARGET_ARCH_MIPS 4511 #endif // defined TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language_ia32.cc ('k') | runtime/vm/intermediate_language_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698