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

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

Issue 14781002: Inline remaining Float32x4 operations. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 7 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 3155 matching lines...) Expand 10 before | Expand all | Expand 10 after
3166 __ reciprocalps(left); 3166 __ reciprocalps(left);
3167 break; 3167 break;
3168 case MethodRecognizer::kFloat32x4ReciprocalSqrt: 3168 case MethodRecognizer::kFloat32x4ReciprocalSqrt:
3169 __ rsqrtps(left); 3169 __ rsqrtps(left);
3170 break; 3170 break;
3171 default: UNREACHABLE(); 3171 default: UNREACHABLE();
3172 } 3172 }
3173 } 3173 }
3174 3174
3175 3175
3176 LocationSummary* Float32x4ZeroArgInstr::MakeLocationSummary() const {
3177 const intptr_t kNumInputs = 1;
3178 const intptr_t kNumTemps = 0;
3179 LocationSummary* summary =
3180 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
3181 summary->set_in(0, Location::RequiresFpuRegister());
3182 summary->set_out(Location::SameAsFirstInput());
3183 return summary;
3184 }
3185
3186
3187 void Float32x4ZeroArgInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
3188 XmmRegister left = locs()->in(0).fpu_reg();
3189
3190 ASSERT(locs()->out().fpu_reg() == left);
3191 switch (op_kind()) {
3192 case MethodRecognizer::kFloat32x4Negate:
3193 __ negateps(left);
3194 break;
3195 case MethodRecognizer::kFloat32x4Absolute:
3196 __ absps(left);
3197 break;
3198 default: UNREACHABLE();
3199 }
3200 }
3201
3202
3203 LocationSummary* Float32x4ClampInstr::MakeLocationSummary() const {
3204 const intptr_t kNumInputs = 3;
3205 const intptr_t kNumTemps = 0;
3206 LocationSummary* summary =
3207 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
3208 summary->set_in(0, Location::RequiresFpuRegister());
3209 summary->set_in(1, Location::RequiresFpuRegister());
3210 summary->set_in(2, Location::RequiresFpuRegister());
3211 summary->set_out(Location::SameAsFirstInput());
3212 return summary;
3213 }
3214
3215
3216 void Float32x4ClampInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
3217 XmmRegister left = locs()->in(0).fpu_reg();
3218 XmmRegister lower = locs()->in(1).fpu_reg();
3219 XmmRegister upper = locs()->in(2).fpu_reg();
3220 ASSERT(locs()->out().fpu_reg() == left);
3221 __ minps(left, upper);
3222 __ maxps(left, lower);
3223 }
3224
3225
3226 LocationSummary* Float32x4WithInstr::MakeLocationSummary() const {
3227 const intptr_t kNumInputs = 2;
3228 const intptr_t kNumTemps = 0;
3229 LocationSummary* summary =
3230 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
3231 summary->set_in(0, Location::RequiresFpuRegister());
3232 summary->set_in(1, Location::RequiresFpuRegister());
3233 summary->set_out(Location::SameAsFirstInput());
3234 return summary;
3235 }
3236
3237 void Float32x4WithInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
3238 XmmRegister replacement = locs()->in(0).fpu_reg();
3239 XmmRegister value = locs()->in(1).fpu_reg();
3240
3241 ASSERT(locs()->out().fpu_reg() == replacement);
3242
3243 switch (op_kind()) {
3244 case MethodRecognizer::kFloat32x4WithX:
3245 __ cvtsd2ss(replacement, replacement);
3246 __ subq(RSP, Immediate(16));
3247 // Move value to stack.
3248 __ movups(Address(RSP, -16), value);
3249 // Write over X value.
3250 __ movss(Address(RSP, -16), replacement);
3251 // Move updated value into output register.
3252 __ movups(replacement, Address(RSP, -16));
3253 __ addq(RSP, Immediate(16));
3254 break;
3255 case MethodRecognizer::kFloat32x4WithY:
3256 __ cvtsd2ss(replacement, replacement);
3257 __ subq(RSP, Immediate(16));
3258 // Move value to stack.
3259 __ movups(Address(RSP, -16), value);
3260 // Write over Y value.
3261 __ movss(Address(RSP, -12), replacement);
3262 // Move updated value into output register.
3263 __ movups(replacement, Address(RSP, -16));
3264 __ addq(RSP, Immediate(16));
3265 break;
3266 case MethodRecognizer::kFloat32x4WithZ:
3267 __ cvtsd2ss(replacement, replacement);
3268 __ subq(RSP, Immediate(16));
3269 // Move value to stack.
3270 __ movups(Address(RSP, -16), value);
3271 // Write over Z value.
3272 __ movss(Address(RSP, -8), replacement);
3273 // Move updated value into output register.
3274 __ movups(replacement, Address(RSP, -16));
3275 __ addq(RSP, Immediate(16));
3276 break;
3277 case MethodRecognizer::kFloat32x4WithW:
3278 __ cvtsd2ss(replacement, replacement);
3279 __ subq(RSP, Immediate(16));
3280 // Move value to stack.
3281 __ movups(Address(RSP, -16), value);
3282 // Write over W value.
3283 __ movss(Address(RSP, -4), replacement);
3284 // Move updated value into output register.
3285 __ movups(replacement, Address(RSP, -16));
3286 __ addq(RSP, Immediate(16));
3287 break;
3288 default: UNREACHABLE();
3289 }
3290 }
3291
3292
3293 LocationSummary* Float32x4ToUint32x4Instr::MakeLocationSummary() const {
3294 const intptr_t kNumInputs = 1;
3295 const intptr_t kNumTemps = 0;
3296 LocationSummary* summary =
3297 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
3298 summary->set_in(0, Location::RequiresFpuRegister());
3299 summary->set_out(Location::SameAsFirstInput());
3300 return summary;
3301 }
3302
3303
3304 void Float32x4ToUint32x4Instr::EmitNativeCode(FlowGraphCompiler* compiler) {
3305 // NOP.
3306 }
3307
3308
3176 LocationSummary* MathSqrtInstr::MakeLocationSummary() const { 3309 LocationSummary* MathSqrtInstr::MakeLocationSummary() const {
3177 const intptr_t kNumInputs = 1; 3310 const intptr_t kNumInputs = 1;
3178 const intptr_t kNumTemps = 0; 3311 const intptr_t kNumTemps = 0;
3179 LocationSummary* summary = 3312 LocationSummary* summary =
3180 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); 3313 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
3181 summary->set_in(0, Location::RequiresFpuRegister()); 3314 summary->set_in(0, Location::RequiresFpuRegister());
3182 summary->set_out(Location::RequiresFpuRegister()); 3315 summary->set_out(Location::RequiresFpuRegister());
3183 return summary; 3316 return summary;
3184 } 3317 }
3185 3318
(...skipping 719 matching lines...) Expand 10 before | Expand all | Expand 10 after
3905 PcDescriptors::kOther, 4038 PcDescriptors::kOther,
3906 locs()); 4039 locs());
3907 __ Drop(2); // Discard type arguments and receiver. 4040 __ Drop(2); // Discard type arguments and receiver.
3908 } 4041 }
3909 4042
3910 } // namespace dart 4043 } // namespace dart
3911 4044
3912 #undef __ 4045 #undef __
3913 4046
3914 #endif // defined TARGET_ARCH_X64 4047 #endif // defined TARGET_ARCH_X64
OLDNEW
« runtime/vm/flow_graph_optimizer.cc ('K') | « runtime/vm/intermediate_language_mips.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698