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

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

Issue 22853009: For trigonometric functions call to C-libraries: they are faster than x87 operations (3% on Box2D). (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 3 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 (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_ARM. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM.
6 #if defined(TARGET_ARCH_ARM) 6 #if defined(TARGET_ARCH_ARM)
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 3742 matching lines...) Expand 10 before | Expand all | Expand 10 after
3753 break; 3753 break;
3754 case Token::kSUB: 3754 case Token::kSUB:
3755 __ vsubqi(kWord, result, left, right); 3755 __ vsubqi(kWord, result, left, right);
3756 break; 3756 break;
3757 default: UNREACHABLE(); 3757 default: UNREACHABLE();
3758 } 3758 }
3759 } 3759 }
3760 3760
3761 3761
3762 LocationSummary* MathUnaryInstr::MakeLocationSummary() const { 3762 LocationSummary* MathUnaryInstr::MakeLocationSummary() const {
3763 if ((kind() == MethodRecognizer::kMathSin) ||
3764 (kind() == MethodRecognizer::kMathCos)) {
3765 const intptr_t kNumInputs = 1;
3766 const intptr_t kNumTemps = 0;
3767 LocationSummary* summary =
3768 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall);
3769 summary->set_in(0, Location::FpuRegisterLocation(Q0));
3770 summary->set_out(Location::FpuRegisterLocation(Q0));
3771 return summary;
3772 }
3763 const intptr_t kNumInputs = 1; 3773 const intptr_t kNumInputs = 1;
3764 const intptr_t kNumTemps = 0; 3774 const intptr_t kNumTemps = 0;
3765 LocationSummary* summary = 3775 LocationSummary* summary =
3766 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); 3776 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
3767 summary->set_in(0, Location::RequiresFpuRegister()); 3777 summary->set_in(0, Location::RequiresFpuRegister());
3768 summary->set_out(Location::RequiresFpuRegister()); 3778 summary->set_out(Location::RequiresFpuRegister());
3769 return summary; 3779 return summary;
3770 } 3780 }
3771 3781
3772 3782
3773 void MathUnaryInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 3783 void MathUnaryInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
3774 if (kind() == MethodRecognizer::kMathSqrt) { 3784 if (kind() == MethodRecognizer::kMathSqrt) {
3775 DRegister val = EvenDRegisterOf(locs()->in(0).fpu_reg()); 3785 DRegister val = EvenDRegisterOf(locs()->in(0).fpu_reg());
3776 DRegister result = EvenDRegisterOf(locs()->out().fpu_reg()); 3786 DRegister result = EvenDRegisterOf(locs()->out().fpu_reg());
3777 __ vsqrtd(result, val); 3787 __ vsqrtd(result, val);
3778 } else { 3788 } else {
3779 UNIMPLEMENTED(); 3789 __ CallRuntime(TargetFunction(), InputCount());
3780 } 3790 }
3781 } 3791 }
3782 3792
3783 3793
3784 LocationSummary* MathMinMaxInstr::MakeLocationSummary() const { 3794 LocationSummary* MathMinMaxInstr::MakeLocationSummary() const {
3785 if (result_cid() == kDoubleCid) { 3795 if (result_cid() == kDoubleCid) {
3786 const intptr_t kNumInputs = 2; 3796 const intptr_t kNumInputs = 2;
3787 const intptr_t kNumTemps = 1; 3797 const intptr_t kNumTemps = 1;
3788 LocationSummary* summary = 3798 LocationSummary* summary =
3789 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); 3799 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
(...skipping 836 matching lines...) Expand 10 before | Expand all | Expand 10 after
4626 compiler->GenerateCall(token_pos(), 4636 compiler->GenerateCall(token_pos(),
4627 &label, 4637 &label,
4628 PcDescriptors::kOther, 4638 PcDescriptors::kOther,
4629 locs()); 4639 locs());
4630 __ Drop(2); // Discard type arguments and receiver. 4640 __ Drop(2); // Discard type arguments and receiver.
4631 } 4641 }
4632 4642
4633 } // namespace dart 4643 } // namespace dart
4634 4644
4635 #endif // defined TARGET_ARCH_ARM 4645 #endif // defined TARGET_ARCH_ARM
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698