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

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

Issue 13867006: Inline binary Float32x4 ops. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 8 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_X64. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_X64.
6 #if defined(TARGET_ARCH_X64) 6 #if defined(TARGET_ARCH_X64)
7 7
8 #include "vm/intermediate_language.h" 8 #include "vm/intermediate_language.h"
9 9
10 #include "lib/error.h" 10 #include "lib/error.h"
(...skipping 2813 matching lines...) Expand 10 before | Expand all | Expand 10 after
2824 switch (op_kind()) { 2824 switch (op_kind()) {
2825 case Token::kADD: __ addsd(left, right); break; 2825 case Token::kADD: __ addsd(left, right); break;
2826 case Token::kSUB: __ subsd(left, right); break; 2826 case Token::kSUB: __ subsd(left, right); break;
2827 case Token::kMUL: __ mulsd(left, right); break; 2827 case Token::kMUL: __ mulsd(left, right); break;
2828 case Token::kDIV: __ divsd(left, right); break; 2828 case Token::kDIV: __ divsd(left, right); break;
2829 default: UNREACHABLE(); 2829 default: UNREACHABLE();
2830 } 2830 }
2831 } 2831 }
2832 2832
2833 2833
2834 LocationSummary* BinaryFloat32x4OpInstr::MakeLocationSummary() const {
2835 const intptr_t kNumInputs = 2;
2836 const intptr_t kNumTemps = 0;
2837 LocationSummary* summary =
2838 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
2839 summary->set_in(0, Location::RequiresFpuRegister());
2840 summary->set_in(1, Location::RequiresFpuRegister());
2841 summary->set_out(Location::SameAsFirstInput());
2842 return summary;
2843 }
2844
2845
2846 void BinaryFloat32x4OpInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
2847 XmmRegister left = locs()->in(0).fpu_reg();
2848 XmmRegister right = locs()->in(1).fpu_reg();
2849
2850 ASSERT(locs()->out().fpu_reg() == left);
2851
2852 switch (op_kind()) {
2853 case Token::kADD: __ addps(left, right); break;
2854 case Token::kSUB: __ subps(left, right); break;
2855 case Token::kMUL: __ mulps(left, right); break;
2856 case Token::kDIV: __ divps(left, right); break;
2857 default: UNREACHABLE();
2858 }
2859 }
2860
2861
2834 LocationSummary* MathSqrtInstr::MakeLocationSummary() const { 2862 LocationSummary* MathSqrtInstr::MakeLocationSummary() const {
2835 const intptr_t kNumInputs = 1; 2863 const intptr_t kNumInputs = 1;
2836 const intptr_t kNumTemps = 0; 2864 const intptr_t kNumTemps = 0;
2837 LocationSummary* summary = 2865 LocationSummary* summary =
2838 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); 2866 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
2839 summary->set_in(0, Location::RequiresFpuRegister()); 2867 summary->set_in(0, Location::RequiresFpuRegister());
2840 summary->set_out(Location::RequiresFpuRegister()); 2868 summary->set_out(Location::RequiresFpuRegister());
2841 return summary; 2869 return summary;
2842 } 2870 }
2843 2871
(...skipping 736 matching lines...) Expand 10 before | Expand all | Expand 10 after
3580 PcDescriptors::kOther, 3608 PcDescriptors::kOther,
3581 locs()); 3609 locs());
3582 __ Drop(2); // Discard type arguments and receiver. 3610 __ Drop(2); // Discard type arguments and receiver.
3583 } 3611 }
3584 3612
3585 } // namespace dart 3613 } // namespace dart
3586 3614
3587 #undef __ 3615 #undef __
3588 3616
3589 #endif // defined TARGET_ARCH_X64 3617 #endif // defined TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language_mips.cc ('k') | tests/lib/typeddata/float32x4_unbox_regress_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698