Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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(); | |
|
srdjan
2013/04/25 21:10:47
ASSERT result is same as v0.
| |
| 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(); | |
|
srdjan
2013/04/25 21:10:47
ditto
| |
| 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(); | |
|
srdjan
2013/04/25 21:10:47
ditto
| |
| 2964 // Convert to Float32. | |
| 2965 __ cvtsd2ss(value, value); | |
| 2966 // Splat across all lanes. | |
| 2967 __ shufps(value, value, Immediate(0x00)); | |
| 2968 } | |
| 2969 | |
| 2970 | |
| 2898 LocationSummary* MathSqrtInstr::MakeLocationSummary() const { | 2971 LocationSummary* MathSqrtInstr::MakeLocationSummary() const { |
| 2899 const intptr_t kNumInputs = 1; | 2972 const intptr_t kNumInputs = 1; |
| 2900 const intptr_t kNumTemps = 0; | 2973 const intptr_t kNumTemps = 0; |
| 2901 LocationSummary* summary = | 2974 LocationSummary* summary = |
| 2902 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 2975 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| 2903 summary->set_in(0, Location::RequiresFpuRegister()); | 2976 summary->set_in(0, Location::RequiresFpuRegister()); |
| 2904 summary->set_out(Location::RequiresFpuRegister()); | 2977 summary->set_out(Location::RequiresFpuRegister()); |
| 2905 return summary; | 2978 return summary; |
| 2906 } | 2979 } |
| 2907 | 2980 |
| (...skipping 1115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4023 PcDescriptors::kOther, | 4096 PcDescriptors::kOther, |
| 4024 locs()); | 4097 locs()); |
| 4025 __ Drop(2); // Discard type arguments and receiver. | 4098 __ Drop(2); // Discard type arguments and receiver. |
| 4026 } | 4099 } |
| 4027 | 4100 |
| 4028 } // namespace dart | 4101 } // namespace dart |
| 4029 | 4102 |
| 4030 #undef __ | 4103 #undef __ |
| 4031 | 4104 |
| 4032 #endif // defined TARGET_ARCH_IA32 | 4105 #endif // defined TARGET_ARCH_IA32 |
| OLD | NEW |