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

Side by Side Diff: runtime/vm/intermediate_language_ia32.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.h ('k') | runtime/vm/intermediate_language_x64.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 2433 matching lines...) Expand 10 before | Expand all | Expand 10 after
2444 if (recognized_kind() == MethodRecognizer::kDoubleRound) { 2444 if (recognized_kind() == MethodRecognizer::kDoubleRound) {
2445 result->set_temp(0, Location::RequiresFpuRegister()); 2445 result->set_temp(0, Location::RequiresFpuRegister());
2446 } 2446 }
2447 return result; 2447 return result;
2448 } 2448 }
2449 2449
2450 2450
2451 void DoubleToDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 2451 void DoubleToDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
2452 XmmRegister value = locs()->in(0).fpu_reg(); 2452 XmmRegister value = locs()->in(0).fpu_reg();
2453 XmmRegister result = locs()->out().fpu_reg(); 2453 XmmRegister result = locs()->out().fpu_reg();
2454 if (recognized_kind() == MethodRecognizer::kDoubleTruncate) { 2454 switch (recognized_kind()) {
2455 __ roundsd(result, value, Assembler::kRoundToZero); 2455 case MethodRecognizer::kDoubleTruncate:
2456 } else { 2456 __ roundsd(result, value, Assembler::kRoundToZero);
2457 XmmRegister temp = locs()->temp(0).fpu_reg(); 2457 break;
2458 __ DoubleRound(result, value, temp); 2458 case MethodRecognizer::kDoubleFloor:
2459 __ roundsd(result, value, Assembler::kRoundDown);
2460 break;
2461 case MethodRecognizer::kDoubleCeil:
2462 __ roundsd(result, value, Assembler::kRoundUp);
2463 break;
2464 case MethodRecognizer::kDoubleRound: {
2465 XmmRegister temp = locs()->temp(0).fpu_reg();
2466 __ DoubleRound(result, value, temp);
2467 break;
2468 }
2469 default:
2470 UNREACHABLE();
2459 } 2471 }
2460 } 2472 }
2461 2473
2462 2474
2463 LocationSummary* PolymorphicInstanceCallInstr::MakeLocationSummary() const { 2475 LocationSummary* PolymorphicInstanceCallInstr::MakeLocationSummary() const {
2464 return MakeCallSummary(); 2476 return MakeCallSummary();
2465 } 2477 }
2466 2478
2467 2479
2468 void PolymorphicInstanceCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 2480 void PolymorphicInstanceCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
(...skipping 780 matching lines...) Expand 10 before | Expand all | Expand 10 after
3249 PcDescriptors::kOther, 3261 PcDescriptors::kOther,
3250 locs()); 3262 locs());
3251 __ Drop(2); // Discard type arguments and receiver. 3263 __ Drop(2); // Discard type arguments and receiver.
3252 } 3264 }
3253 3265
3254 } // namespace dart 3266 } // namespace dart
3255 3267
3256 #undef __ 3268 #undef __
3257 3269
3258 #endif // defined TARGET_ARCH_IA32 3270 #endif // defined TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language.h ('k') | runtime/vm/intermediate_language_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698