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

Side by Side Diff: runtime/vm/intermediate_language_ia32.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_IA32. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_IA32.
6 #if defined(TARGET_ARCH_IA32) 6 #if defined(TARGET_ARCH_IA32)
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 2825 matching lines...) Expand 10 before | Expand all | Expand 10 after
2836 2836
2837 switch (op_kind()) { 2837 switch (op_kind()) {
2838 case Token::kADD: __ addps(left, right); break; 2838 case Token::kADD: __ addps(left, right); break;
2839 case Token::kSUB: __ subps(left, right); break; 2839 case Token::kSUB: __ subps(left, right); break;
2840 case Token::kMUL: __ mulps(left, right); break; 2840 case Token::kMUL: __ mulps(left, right); break;
2841 case Token::kDIV: __ divps(left, right); break; 2841 case Token::kDIV: __ divps(left, right); break;
2842 default: UNREACHABLE(); 2842 default: UNREACHABLE();
2843 } 2843 }
2844 } 2844 }
2845 2845
2846
2847 LocationSummary* Float32x4ShuffleInstr::MakeLocationSummary() const {
2848 const intptr_t kNumInputs = 1;
2849 const intptr_t kNumTemps = 0;
2850 LocationSummary* summary =
2851 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
2852 summary->set_in(0, Location::RequiresFpuRegister());
2853 summary->set_out(Location::SameAsFirstInput());
2854 return summary;
2855 }
2856
2857
2858 void Float32x4ShuffleInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
2859 XmmRegister value = locs()->in(0).fpu_reg();
2860
2861 ASSERT(locs()->out().fpu_reg() == value);
2862
2863 switch (op_kind()) {
2864 case MethodRecognizer::kFloat32x4ShuffleXXXX:
2865 __ shufps(value, value, Immediate(0x00));
2866 break;
2867 case MethodRecognizer::kFloat32x4ShuffleYYYY:
2868 __ shufps(value, value, Immediate(0x55));
2869 break;
2870 case MethodRecognizer::kFloat32x4ShuffleZZZZ:
2871 __ shufps(value, value, Immediate(0xAA));
2872 break;
2873 case MethodRecognizer::kFloat32x4ShuffleWWWW:
2874 __ shufps(value, value, Immediate(0xFF));
2875 break;
2876 case MethodRecognizer::kFloat32x4ShuffleX:
2877 __ shufps(value, value, Immediate(0x00));
2878 __ cvtss2sd(value, value);
2879 break;
2880 case MethodRecognizer::kFloat32x4ShuffleY:
2881 __ shufps(value, value, Immediate(0x55));
2882 __ cvtss2sd(value, value);
2883 break;
2884 case MethodRecognizer::kFloat32x4ShuffleZ:
2885 __ shufps(value, value, Immediate(0xAA));
2886 __ cvtss2sd(value, value);
2887 break;
2888 case MethodRecognizer::kFloat32x4ShuffleW:
2889 __ shufps(value, value, Immediate(0xFF));
2890 __ cvtss2sd(value, value);
2891 break;
2892
2893 default: UNREACHABLE();
2894 }
2895 }
2896
2897
2846 LocationSummary* MathSqrtInstr::MakeLocationSummary() const { 2898 LocationSummary* MathSqrtInstr::MakeLocationSummary() const {
2847 const intptr_t kNumInputs = 1; 2899 const intptr_t kNumInputs = 1;
2848 const intptr_t kNumTemps = 0; 2900 const intptr_t kNumTemps = 0;
2849 LocationSummary* summary = 2901 LocationSummary* summary =
2850 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); 2902 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
2851 summary->set_in(0, Location::RequiresFpuRegister()); 2903 summary->set_in(0, Location::RequiresFpuRegister());
2852 summary->set_out(Location::RequiresFpuRegister()); 2904 summary->set_out(Location::RequiresFpuRegister());
2853 return summary; 2905 return summary;
2854 } 2906 }
2855 2907
(...skipping 1115 matching lines...) Expand 10 before | Expand all | Expand 10 after
3971 PcDescriptors::kOther, 4023 PcDescriptors::kOther,
3972 locs()); 4024 locs());
3973 __ Drop(2); // Discard type arguments and receiver. 4025 __ Drop(2); // Discard type arguments and receiver.
3974 } 4026 }
3975 4027
3976 } // namespace dart 4028 } // namespace dart
3977 4029
3978 #undef __ 4030 #undef __
3979 4031
3980 #endif // defined TARGET_ARCH_IA32 4032 #endif // defined TARGET_ARCH_IA32
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698