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

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 2780 matching lines...) Expand 10 before | Expand all | Expand 10 after
2791 summary->set_out(Location::RequiresFpuRegister()); 2791 summary->set_out(Location::RequiresFpuRegister());
2792 return summary; 2792 return summary;
2793 } 2793 }
2794 2794
2795 2795
2796 void UnboxFloat32x4Instr::EmitNativeCode(FlowGraphCompiler* compiler) { 2796 void UnboxFloat32x4Instr::EmitNativeCode(FlowGraphCompiler* compiler) {
2797 const intptr_t value_cid = value()->Type()->ToCid(); 2797 const intptr_t value_cid = value()->Type()->ToCid();
2798 const Register value = locs()->in(0).reg(); 2798 const Register value = locs()->in(0).reg();
2799 const XmmRegister result = locs()->out().fpu_reg(); 2799 const XmmRegister result = locs()->out().fpu_reg();
2800 2800
2801 ASSERT(value_cid == kFloat32x4Cid); 2801 if (value_cid != kFloat32x4Cid) {
Vyacheslav Egorov (Google) 2013/04/15 11:09:35 Ditto
Cutch 2013/04/15 13:34:56 Done.
2802 Label* deopt = compiler->AddDeoptStub(deopt_id_, kDeoptCheckClass);
2803 __ testq(value, Immediate(kSmiTagMask));
2804 __ j(ZERO, deopt);
2805 __ CompareClassId(value, kFloat32x4Cid);
2806 __ j(NOT_EQUAL, deopt);
2807 }
2802 __ movups(result, FieldAddress(value, Float32x4::value_offset())); 2808 __ movups(result, FieldAddress(value, Float32x4::value_offset()));
2803 } 2809 }
2804 2810
2805 2811
2806 LocationSummary* BinaryDoubleOpInstr::MakeLocationSummary() const { 2812 LocationSummary* BinaryDoubleOpInstr::MakeLocationSummary() const {
2807 const intptr_t kNumInputs = 2; 2813 const intptr_t kNumInputs = 2;
2808 const intptr_t kNumTemps = 0; 2814 const intptr_t kNumTemps = 0;
2809 LocationSummary* summary = 2815 LocationSummary* summary =
2810 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); 2816 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
2811 summary->set_in(0, Location::RequiresFpuRegister()); 2817 summary->set_in(0, Location::RequiresFpuRegister());
(...skipping 12 matching lines...) Expand all
2824 switch (op_kind()) { 2830 switch (op_kind()) {
2825 case Token::kADD: __ addsd(left, right); break; 2831 case Token::kADD: __ addsd(left, right); break;
2826 case Token::kSUB: __ subsd(left, right); break; 2832 case Token::kSUB: __ subsd(left, right); break;
2827 case Token::kMUL: __ mulsd(left, right); break; 2833 case Token::kMUL: __ mulsd(left, right); break;
2828 case Token::kDIV: __ divsd(left, right); break; 2834 case Token::kDIV: __ divsd(left, right); break;
2829 default: UNREACHABLE(); 2835 default: UNREACHABLE();
2830 } 2836 }
2831 } 2837 }
2832 2838
2833 2839
2840 LocationSummary* BinaryFloat32x4OpInstr::MakeLocationSummary() const {
2841 const intptr_t kNumInputs = 2;
2842 const intptr_t kNumTemps = 0;
2843 LocationSummary* summary =
2844 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
2845 summary->set_in(0, Location::RequiresFpuRegister());
2846 summary->set_in(1, Location::RequiresFpuRegister());
2847 summary->set_out(Location::SameAsFirstInput());
2848 return summary;
2849 }
2850
2851
2852 void BinaryFloat32x4OpInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
2853 XmmRegister left = locs()->in(0).fpu_reg();
2854 XmmRegister right = locs()->in(1).fpu_reg();
2855
2856 ASSERT(locs()->out().fpu_reg() == left);
2857
2858 switch (op_kind()) {
2859 case Token::kADD: __ addps(left, right); break;
2860 case Token::kSUB: __ subps(left, right); break;
2861 case Token::kMUL: __ mulps(left, right); break;
2862 case Token::kDIV: __ divps(left, right); break;
2863 default: UNREACHABLE();
2864 }
2865 }
2866
2867
2834 LocationSummary* MathSqrtInstr::MakeLocationSummary() const { 2868 LocationSummary* MathSqrtInstr::MakeLocationSummary() const {
2835 const intptr_t kNumInputs = 1; 2869 const intptr_t kNumInputs = 1;
2836 const intptr_t kNumTemps = 0; 2870 const intptr_t kNumTemps = 0;
2837 LocationSummary* summary = 2871 LocationSummary* summary =
2838 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); 2872 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
2839 summary->set_in(0, Location::RequiresFpuRegister()); 2873 summary->set_in(0, Location::RequiresFpuRegister());
2840 summary->set_out(Location::RequiresFpuRegister()); 2874 summary->set_out(Location::RequiresFpuRegister());
2841 return summary; 2875 return summary;
2842 } 2876 }
2843 2877
(...skipping 736 matching lines...) Expand 10 before | Expand all | Expand 10 after
3580 PcDescriptors::kOther, 3614 PcDescriptors::kOther,
3581 locs()); 3615 locs());
3582 __ Drop(2); // Discard type arguments and receiver. 3616 __ Drop(2); // Discard type arguments and receiver.
3583 } 3617 }
3584 3618
3585 } // namespace dart 3619 } // namespace dart
3586 3620
3587 #undef __ 3621 #undef __
3588 3622
3589 #endif // defined TARGET_ARCH_X64 3623 #endif // defined TARGET_ARCH_X64
OLDNEW
« runtime/vm/intermediate_language_ia32.cc ('K') | « runtime/vm/intermediate_language_mips.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698