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

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

Issue 1697953002: X87: [turbofan] Add TruncateFloat32ToUint32 operator to Turbofan. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 10 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 | « no previous file | 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 30da40b1739beeee5f31ccbfae77e541e603c6da..37827b292f0185c4b4a72d052250b0fde0d0fc30 100644
--- a/src/compiler/x87/code-generator-x87.cc
+++ b/src/compiler/x87/code-generator-x87.cc
@@ -1209,6 +1209,26 @@ void CodeGenerator::AssembleArchInstruction(Instruction* instr) {
}
break;
}
+ case kX87Float32ToUint32: {
+ if (!instr->InputAt(0)->IsDoubleRegister()) {
+ __ fld_s(i.InputOperand(0));
+ }
+ Label success;
+ __ TruncateX87TOSToI(i.OutputRegister(0));
+ __ test(i.OutputRegister(0), i.OutputRegister(0));
+ __ j(positive, &success);
+ __ push(Immediate(INT32_MIN));
+ __ fild_s(Operand(esp, 0));
+ __ lea(esp, Operand(esp, kPointerSize));
+ __ faddp();
+ __ TruncateX87TOSToI(i.OutputRegister(0));
+ __ or_(i.OutputRegister(0), Immediate(0x80000000));
+ __ bind(&success);
+ 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 | « no previous file | src/compiler/x87/instruction-codes-x87.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698