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

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

Issue 13872020: Inline Float32x4 Getters (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 2842 matching lines...) Expand 10 before | Expand all | Expand 10 after
2853 switch (op_kind()) { 2853 switch (op_kind()) {
2854 case Token::kADD: __ addps(left, right); break; 2854 case Token::kADD: __ addps(left, right); break;
2855 case Token::kSUB: __ subps(left, right); break; 2855 case Token::kSUB: __ subps(left, right); break;
2856 case Token::kMUL: __ mulps(left, right); break; 2856 case Token::kMUL: __ mulps(left, right); break;
2857 case Token::kDIV: __ divps(left, right); break; 2857 case Token::kDIV: __ divps(left, right); break;
2858 default: UNREACHABLE(); 2858 default: UNREACHABLE();
2859 } 2859 }
2860 } 2860 }
2861 2861
2862 2862
2863 LocationSummary* Float32x4ShuffleInstr::MakeLocationSummary() const {
2864 const intptr_t kNumInputs = 1;
2865 const intptr_t kNumTemps = 0;
2866 LocationSummary* summary =
2867 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
2868 summary->set_in(0, Location::RequiresFpuRegister());
2869 summary->set_out(Location::SameAsFirstInput());
2870 return summary;
2871 }
2872
2873
2874 void Float32x4ShuffleInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
2875 XmmRegister value = locs()->in(0).fpu_reg();
2876
2877 ASSERT(locs()->out().fpu_reg() == value);
2878
2879 switch (op_kind()) {
2880 case MethodRecognizer::kFloat32x4ShuffleXXXX:
2881 __ shufps(value, value, Immediate(0x00));
2882 break;
2883 case MethodRecognizer::kFloat32x4ShuffleYYYY:
2884 __ shufps(value, value, Immediate(0x55));
2885 break;
2886 case MethodRecognizer::kFloat32x4ShuffleZZZZ:
2887 __ shufps(value, value, Immediate(0xAA));
2888 break;
2889 case MethodRecognizer::kFloat32x4ShuffleWWWW:
2890 __ shufps(value, value, Immediate(0xFF));
2891 break;
2892 case MethodRecognizer::kFloat32x4ShuffleX:
2893 __ shufps(value, value, Immediate(0x00));
2894 __ cvtss2sd(value, value);
2895 break;
2896 case MethodRecognizer::kFloat32x4ShuffleY:
2897 __ shufps(value, value, Immediate(0x55));
2898 __ cvtss2sd(value, value);
2899 break;
2900 case MethodRecognizer::kFloat32x4ShuffleZ:
2901 __ shufps(value, value, Immediate(0xAA));
2902 __ cvtss2sd(value, value);
2903 break;
2904 case MethodRecognizer::kFloat32x4ShuffleW:
2905 __ shufps(value, value, Immediate(0xFF));
2906 __ cvtss2sd(value, value);
2907 break;
2908 default: UNREACHABLE();
2909 }
2910 }
2911
2912
2863 LocationSummary* MathSqrtInstr::MakeLocationSummary() const { 2913 LocationSummary* MathSqrtInstr::MakeLocationSummary() const {
2864 const intptr_t kNumInputs = 1; 2914 const intptr_t kNumInputs = 1;
2865 const intptr_t kNumTemps = 0; 2915 const intptr_t kNumTemps = 0;
2866 LocationSummary* summary = 2916 LocationSummary* summary =
2867 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); 2917 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
2868 summary->set_in(0, Location::RequiresFpuRegister()); 2918 summary->set_in(0, Location::RequiresFpuRegister());
2869 summary->set_out(Location::RequiresFpuRegister()); 2919 summary->set_out(Location::RequiresFpuRegister());
2870 return summary; 2920 return summary;
2871 } 2921 }
2872 2922
(...skipping 736 matching lines...) Expand 10 before | Expand all | Expand 10 after
3609 PcDescriptors::kOther, 3659 PcDescriptors::kOther,
3610 locs()); 3660 locs());
3611 __ Drop(2); // Discard type arguments and receiver. 3661 __ Drop(2); // Discard type arguments and receiver.
3612 } 3662 }
3613 3663
3614 } // namespace dart 3664 } // namespace dart
3615 3665
3616 #undef __ 3666 #undef __
3617 3667
3618 #endif // defined TARGET_ARCH_X64 3668 #endif // defined TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language_mips.cc ('k') | tests/lib/typed_data/float32x4_unbox_regress_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698