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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/intermediate_language.h ('k') | runtime/vm/intermediate_language_x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intermediate_language_ia32.cc
diff --git a/runtime/vm/intermediate_language_ia32.cc b/runtime/vm/intermediate_language_ia32.cc
index fe7603e1b27525480b1856c9ec1d89618a77e32f..42cfb9ec8657c764e1df58e81071f2647c6e8e11 100644
--- a/runtime/vm/intermediate_language_ia32.cc
+++ b/runtime/vm/intermediate_language_ia32.cc
@@ -2451,11 +2451,23 @@ LocationSummary* DoubleToDoubleInstr::MakeLocationSummary() const {
void DoubleToDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
XmmRegister value = locs()->in(0).fpu_reg();
XmmRegister result = locs()->out().fpu_reg();
- if (recognized_kind() == MethodRecognizer::kDoubleTruncate) {
- __ roundsd(result, value, Assembler::kRoundToZero);
- } else {
- XmmRegister temp = locs()->temp(0).fpu_reg();
- __ DoubleRound(result, value, temp);
+ switch (recognized_kind()) {
+ case MethodRecognizer::kDoubleTruncate:
+ __ roundsd(result, value, Assembler::kRoundToZero);
+ break;
+ case MethodRecognizer::kDoubleFloor:
+ __ roundsd(result, value, Assembler::kRoundDown);
+ break;
+ case MethodRecognizer::kDoubleCeil:
+ __ roundsd(result, value, Assembler::kRoundUp);
+ break;
+ case MethodRecognizer::kDoubleRound: {
+ XmmRegister temp = locs()->temp(0).fpu_reg();
+ __ DoubleRound(result, value, temp);
+ break;
+ }
+ default:
+ UNREACHABLE();
}
}
« 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