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

Unified Diff: src/compiler/x87/code-generator-x87.cc

Issue 1583323004: [turbofan] Add the TruncateFloat32ToInt32 operator to turbofan. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fixed a small bug Created 4 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 | « src/compiler/x64/instruction-selector-x64.cc ('k') | src/compiler/x87/instruction-codes-x87.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/x87/code-generator-x87.cc
diff --git a/src/compiler/x87/code-generator-x87.cc b/src/compiler/x87/code-generator-x87.cc
index f4e334dbb2624ab5f417a86349e065b3836d4f91..96e029111bf618ae87a8b15eed96194c4fb3ef09 100644
--- a/src/compiler/x87/code-generator-x87.cc
+++ b/src/compiler/x87/code-generator-x87.cc
@@ -1005,6 +1005,16 @@ void CodeGenerator::AssembleArchInstruction(Instruction* instr) {
__ LoadUint32NoSSE2(i.InputRegister(0));
break;
}
+ case kX87Float32ToInt32: {
+ if (!instr->InputAt(0)->IsDoubleRegister()) {
+ __ fld_s(i.InputOperand(0));
+ }
+ __ TruncateX87TOSToI(i.OutputRegister(0));
+ if (!instr->InputAt(0)->IsDoubleRegister()) {
+ __ fstp(0);
+ }
+ break;
+ }
case kX87Float64ToInt32: {
if (!instr->InputAt(0)->IsDoubleRegister()) {
__ fld_d(i.InputOperand(0));
« no previous file with comments | « src/compiler/x64/instruction-selector-x64.cc ('k') | src/compiler/x87/instruction-codes-x87.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698