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

Unified Diff: src/crankshaft/x87/lithium-codegen-x87.cc

Issue 1856303002: [X87] [Crankshaft] Fix DoMathFloor and DoMathRound code generation bug. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 8 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/crankshaft/x87/lithium-codegen-x87.cc
diff --git a/src/crankshaft/x87/lithium-codegen-x87.cc b/src/crankshaft/x87/lithium-codegen-x87.cc
index 01df131d568858dcaa2095e6623a613b79635089..1283ac075818f1562178738d42f9cb7885f4e0e4 100644
--- a/src/crankshaft/x87/lithium-codegen-x87.cc
+++ b/src/crankshaft/x87/lithium-codegen-x87.cc
@@ -3480,6 +3480,7 @@ void LCodeGen::DoMathFloor(LMathFloor* instr) {
__ sub(esp, Immediate(kPointerSize));
__ fist_s(Operand(esp, 0));
__ pop(output_reg);
+ __ X87SetRC(0x0000);
__ X87CheckIA();
DeoptimizeIf(equal, instr, Deoptimizer::kOverflow);
__ fnclex();
@@ -3512,6 +3513,8 @@ void LCodeGen::DoMathRound(LMathRound* instr) {
// Clear exception bits.
__ fnclex();
__ fistp_s(MemOperand(esp, 0));
+ // Restore round mode.
+ __ X87SetRC(0x0000);
// Check overflow.
__ X87CheckIA();
__ pop(result);
@@ -3546,6 +3549,8 @@ void LCodeGen::DoMathRound(LMathRound* instr) {
// Clear exception bits.
__ fnclex();
__ fistp_s(MemOperand(esp, 0));
+ // Restore round mode.
+ __ X87SetRC(0x0000);
// Check overflow.
__ X87CheckIA();
__ pop(result);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698