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

Unified Diff: src/compiler/x87/instruction-selector-x87.cc

Issue 1227923003: X87: [turbofan] Add TruncationMode for TruncateFloat64ToInt32. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 5 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 | « src/compiler/x87/code-generator-x87.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/x87/instruction-selector-x87.cc
diff --git a/src/compiler/x87/instruction-selector-x87.cc b/src/compiler/x87/instruction-selector-x87.cc
index 7dda86efdc61150eaa41cae3eebdc88f163cf166..d350738e0b32e084cd42e43b255aedfb632bf0f1 100644
--- a/src/compiler/x87/instruction-selector-x87.cc
+++ b/src/compiler/x87/instruction-selector-x87.cc
@@ -647,6 +647,23 @@ void InstructionSelector::VisitTruncateFloat64ToFloat32(Node* node) {
}
+void InstructionSelector::VisitTruncateFloat64ToInt32(Node* node) {
+ X87OperandGenerator g(this);
+
+ switch (TruncationModeOf(node->op())) {
+ case TruncationMode::kJavaScript:
+ Emit(kArchTruncateDoubleToI, g.DefineAsRegister(node),
+ g.Use(node->InputAt(0)));
+ return;
+ case TruncationMode::kRoundToZero:
+ Emit(kX87Float64ToInt32, g.DefineAsRegister(node),
+ g.Use(node->InputAt(0)));
+ return;
+ }
+ UNREACHABLE();
+}
+
+
void InstructionSelector::VisitFloat32Add(Node* node) {
X87OperandGenerator g(this);
Emit(kX87PushFloat32, g.NoOutput(), g.Use(node->InputAt(0)));
« no previous file with comments | « src/compiler/x87/code-generator-x87.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698