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

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

Issue 11929021: Optimize double.floor and double.ceil down to roundsd when SSE4.1 is available. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 11 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_ia32.cc ('k') | no next file » | 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_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 2323 matching lines...) Expand 10 before | Expand all | Expand 10 after
2334 if (recognized_kind() == MethodRecognizer::kDoubleRound) { 2334 if (recognized_kind() == MethodRecognizer::kDoubleRound) {
2335 result->set_temp(0, Location::RequiresFpuRegister()); 2335 result->set_temp(0, Location::RequiresFpuRegister());
2336 } 2336 }
2337 return result; 2337 return result;
2338 } 2338 }
2339 2339
2340 2340
2341 void DoubleToDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 2341 void DoubleToDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
2342 XmmRegister value = locs()->in(0).fpu_reg(); 2342 XmmRegister value = locs()->in(0).fpu_reg();
2343 XmmRegister result = locs()->out().fpu_reg(); 2343 XmmRegister result = locs()->out().fpu_reg();
2344 if (recognized_kind() == MethodRecognizer::kDoubleTruncate) { 2344 switch (recognized_kind()) {
2345 __ roundsd(result, value, Assembler::kRoundToZero); 2345 case MethodRecognizer::kDoubleTruncate:
2346 } else { 2346 __ roundsd(result, value, Assembler::kRoundToZero);
2347 XmmRegister temp = locs()->temp(0).fpu_reg(); 2347 break;
2348 __ DoubleRound(result, value, temp); 2348 case MethodRecognizer::kDoubleFloor:
2349 __ roundsd(result, value, Assembler::kRoundDown);
2350 break;
2351 case MethodRecognizer::kDoubleCeil:
2352 __ roundsd(result, value, Assembler::kRoundUp);
2353 break;
2354 case MethodRecognizer::kDoubleRound: {
2355 XmmRegister temp = locs()->temp(0).fpu_reg();
2356 __ DoubleRound(result, value, temp);
2357 break;
2358 }
2359 default:
2360 UNREACHABLE();
2349 } 2361 }
2350 } 2362 }
2351 2363
2352 2364
2353 LocationSummary* PolymorphicInstanceCallInstr::MakeLocationSummary() const { 2365 LocationSummary* PolymorphicInstanceCallInstr::MakeLocationSummary() const {
2354 return MakeCallSummary(); 2366 return MakeCallSummary();
2355 } 2367 }
2356 2368
2357 2369
2358 void PolymorphicInstanceCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 2370 void PolymorphicInstanceCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
(...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after
2893 PcDescriptors::kOther, 2905 PcDescriptors::kOther,
2894 locs()); 2906 locs());
2895 __ Drop(2); // Discard type arguments and receiver. 2907 __ Drop(2); // Discard type arguments and receiver.
2896 } 2908 }
2897 2909
2898 } // namespace dart 2910 } // namespace dart
2899 2911
2900 #undef __ 2912 #undef __
2901 2913
2902 #endif // defined TARGET_ARCH_X64 2914 #endif // defined TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language_ia32.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698