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

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

Issue 13936009: Inline Float32x4 constructors (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
« no previous file with comments | « runtime/vm/intermediate_language_arm.cc ('k') | runtime/vm/intermediate_language_mips.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 2877 matching lines...) Expand 10 before | Expand all | Expand 10 after
2888 case MethodRecognizer::kFloat32x4ShuffleW: 2888 case MethodRecognizer::kFloat32x4ShuffleW:
2889 __ shufps(value, value, Immediate(0xFF)); 2889 __ shufps(value, value, Immediate(0xFF));
2890 __ cvtss2sd(value, value); 2890 __ cvtss2sd(value, value);
2891 break; 2891 break;
2892 2892
2893 default: UNREACHABLE(); 2893 default: UNREACHABLE();
2894 } 2894 }
2895 } 2895 }
2896 2896
2897 2897
2898 LocationSummary* Float32x4ConstructorInstr::MakeLocationSummary() const {
2899 const intptr_t kNumInputs = 4;
2900 const intptr_t kNumTemps = 0;
2901 LocationSummary* summary =
2902 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
2903 summary->set_in(0, Location::RequiresFpuRegister());
2904 summary->set_in(1, Location::RequiresFpuRegister());
2905 summary->set_in(2, Location::RequiresFpuRegister());
2906 summary->set_in(3, Location::RequiresFpuRegister());
2907 summary->set_out(Location::SameAsFirstInput());
2908 return summary;
2909 }
2910
2911
2912 void Float32x4ConstructorInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
2913 XmmRegister v0 = locs()->in(0).fpu_reg();
2914 XmmRegister v1 = locs()->in(1).fpu_reg();
2915 XmmRegister v2 = locs()->in(2).fpu_reg();
2916 XmmRegister v3 = locs()->in(3).fpu_reg();
2917 ASSERT(v0 == locs()->out().fpu_reg());
2918 __ subl(ESP, Immediate(16));
2919 __ cvtsd2ss(v0, v0);
2920 __ movss(Address(ESP, -16), v0);
2921 __ movsd(v0, v1);
2922 __ cvtsd2ss(v0, v0);
2923 __ movss(Address(ESP, -12), v0);
2924 __ movsd(v0, v2);
2925 __ cvtsd2ss(v0, v0);
2926 __ movss(Address(ESP, -8), v0);
2927 __ movsd(v0, v3);
2928 __ cvtsd2ss(v0, v0);
2929 __ movss(Address(ESP, -4), v0);
2930 __ movups(v0, Address(ESP, -16));
2931 __ addl(ESP, Immediate(16));
2932 }
2933
2934
2935 LocationSummary* Float32x4ZeroInstr::MakeLocationSummary() const {
2936 const intptr_t kNumInputs = 0;
2937 const intptr_t kNumTemps = 0;
2938 LocationSummary* summary =
2939 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
2940 summary->set_out(Location::RequiresFpuRegister());
2941 return summary;
2942 }
2943
2944
2945 void Float32x4ZeroInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
2946 XmmRegister value = locs()->out().fpu_reg();
2947 __ xorps(value, value);
2948 }
2949
2950
2951 LocationSummary* Float32x4SplatInstr::MakeLocationSummary() const {
2952 const intptr_t kNumInputs = 1;
2953 const intptr_t kNumTemps = 0;
2954 LocationSummary* summary =
2955 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
2956 summary->set_in(0, Location::RequiresFpuRegister());
2957 summary->set_out(Location::SameAsFirstInput());
2958 return summary;
2959 }
2960
2961
2962 void Float32x4SplatInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
2963 XmmRegister value = locs()->out().fpu_reg();
2964 ASSERT(locs()->in(0).fpu_reg() == locs()->out().fpu_reg());
2965 // Convert to Float32.
2966 __ cvtsd2ss(value, value);
2967 // Splat across all lanes.
2968 __ shufps(value, value, Immediate(0x00));
2969 }
2970
2971
2898 LocationSummary* MathSqrtInstr::MakeLocationSummary() const { 2972 LocationSummary* MathSqrtInstr::MakeLocationSummary() const {
2899 const intptr_t kNumInputs = 1; 2973 const intptr_t kNumInputs = 1;
2900 const intptr_t kNumTemps = 0; 2974 const intptr_t kNumTemps = 0;
2901 LocationSummary* summary = 2975 LocationSummary* summary =
2902 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); 2976 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
2903 summary->set_in(0, Location::RequiresFpuRegister()); 2977 summary->set_in(0, Location::RequiresFpuRegister());
2904 summary->set_out(Location::RequiresFpuRegister()); 2978 summary->set_out(Location::RequiresFpuRegister());
2905 return summary; 2979 return summary;
2906 } 2980 }
2907 2981
(...skipping 1115 matching lines...) Expand 10 before | Expand all | Expand 10 after
4023 PcDescriptors::kOther, 4097 PcDescriptors::kOther,
4024 locs()); 4098 locs());
4025 __ Drop(2); // Discard type arguments and receiver. 4099 __ Drop(2); // Discard type arguments and receiver.
4026 } 4100 }
4027 4101
4028 } // namespace dart 4102 } // namespace dart
4029 4103
4030 #undef __ 4104 #undef __
4031 4105
4032 #endif // defined TARGET_ARCH_IA32 4106 #endif // defined TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language_arm.cc ('k') | runtime/vm/intermediate_language_mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698