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

Side by Side Diff: runtime/vm/intermediate_language_x64.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
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 2892 matching lines...) Expand 10 before | Expand all | Expand 10 after
2903 break; 2903 break;
2904 case MethodRecognizer::kFloat32x4ShuffleW: 2904 case MethodRecognizer::kFloat32x4ShuffleW:
2905 __ shufps(value, value, Immediate(0xFF)); 2905 __ shufps(value, value, Immediate(0xFF));
2906 __ cvtss2sd(value, value); 2906 __ cvtss2sd(value, value);
2907 break; 2907 break;
2908 default: UNREACHABLE(); 2908 default: UNREACHABLE();
2909 } 2909 }
2910 } 2910 }
2911 2911
2912 2912
2913 LocationSummary* Float32x4ConstructorInstr::MakeLocationSummary() const {
2914 const intptr_t kNumInputs = 4;
2915 const intptr_t kNumTemps = 0;
2916 LocationSummary* summary =
2917 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
2918 summary->set_in(0, Location::RequiresFpuRegister());
2919 summary->set_in(1, Location::RequiresFpuRegister());
2920 summary->set_in(2, Location::RequiresFpuRegister());
2921 summary->set_in(3, Location::RequiresFpuRegister());
2922 summary->set_out(Location::SameAsFirstInput());
2923 return summary;
2924 }
2925
2926
2927 void Float32x4ConstructorInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
2928 XmmRegister v0 = locs()->in(0).fpu_reg();
2929 XmmRegister v1 = locs()->in(1).fpu_reg();
2930 XmmRegister v2 = locs()->in(2).fpu_reg();
2931 XmmRegister v3 = locs()->in(3).fpu_reg();
2932 ASSERT(v0 == locs()->out().fpu_reg());
2933 __ subq(RSP, Immediate(16));
2934 __ cvtsd2ss(v0, v0);
2935 __ movss(Address(RSP, -16), v0);
2936 __ movsd(v0, v1);
2937 __ cvtsd2ss(v0, v0);
2938 __ movss(Address(RSP, -12), v0);
2939 __ movsd(v0, v2);
2940 __ cvtsd2ss(v0, v0);
2941 __ movss(Address(RSP, -8), v0);
2942 __ movsd(v0, v3);
2943 __ cvtsd2ss(v0, v0);
2944 __ movss(Address(RSP, -4), v0);
2945 __ movups(v0, Address(RSP, -16));
2946 __ addq(RSP, Immediate(16));
2947 }
2948
2949
2950 LocationSummary* Float32x4ZeroInstr::MakeLocationSummary() const {
2951 const intptr_t kNumInputs = 0;
2952 const intptr_t kNumTemps = 0;
2953 LocationSummary* summary =
2954 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
2955 summary->set_out(Location::RequiresFpuRegister());
2956 return summary;
2957 }
2958
2959
2960 void Float32x4ZeroInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
2961 XmmRegister value = locs()->out().fpu_reg();
2962 __ xorps(value, value);
2963 }
2964
2965
2966 LocationSummary* Float32x4SplatInstr::MakeLocationSummary() const {
2967 const intptr_t kNumInputs = 1;
2968 const intptr_t kNumTemps = 0;
2969 LocationSummary* summary =
2970 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
2971 summary->set_in(0, Location::RequiresFpuRegister());
2972 summary->set_out(Location::SameAsFirstInput());
2973 return summary;
2974 }
2975
2976
2977 void Float32x4SplatInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
2978 XmmRegister value = locs()->out().fpu_reg();
2979 // Convert to Float32.
2980 __ cvtsd2ss(value, value);
2981 // Splat across all lanes.
2982 __ shufps(value, value, Immediate(0x00));
2983 }
2984
2985
2913 LocationSummary* MathSqrtInstr::MakeLocationSummary() const { 2986 LocationSummary* MathSqrtInstr::MakeLocationSummary() const {
2914 const intptr_t kNumInputs = 1; 2987 const intptr_t kNumInputs = 1;
2915 const intptr_t kNumTemps = 0; 2988 const intptr_t kNumTemps = 0;
2916 LocationSummary* summary = 2989 LocationSummary* summary =
2917 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); 2990 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
2918 summary->set_in(0, Location::RequiresFpuRegister()); 2991 summary->set_in(0, Location::RequiresFpuRegister());
2919 summary->set_out(Location::RequiresFpuRegister()); 2992 summary->set_out(Location::RequiresFpuRegister());
2920 return summary; 2993 return summary;
2921 } 2994 }
2922 2995
(...skipping 736 matching lines...) Expand 10 before | Expand all | Expand 10 after
3659 PcDescriptors::kOther, 3732 PcDescriptors::kOther,
3660 locs()); 3733 locs());
3661 __ Drop(2); // Discard type arguments and receiver. 3734 __ Drop(2); // Discard type arguments and receiver.
3662 } 3735 }
3663 3736
3664 } // namespace dart 3737 } // namespace dart
3665 3738
3666 #undef __ 3739 #undef __
3667 3740
3668 #endif // defined TARGET_ARCH_X64 3741 #endif // defined TARGET_ARCH_X64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698