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

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

Issue 1522333002: X87: [TurboFan] Change the implementation of Float32's NaN comparision's return value in kX87Float3… (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years 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/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 82eee57747f063eb2e8834beca898b6ca6c4ba4e..839f569685f7b08383ea906f7f77a2239b7b46c6 100644
--- a/src/compiler/x87/code-generator-x87.cc
+++ b/src/compiler/x87/code-generator-x87.cc
@@ -744,7 +744,10 @@ void CodeGenerator::AssembleArchInstruction(Instruction* instr) {
__ fld(1);
__ fld(1);
__ FCmp();
- __ j(parity_even, &check_nan_left, Label::kNear); // At least one NaN.
+
+ // At least one NaN.
+ // Return the second operands if one of the two operands is NaN
+ __ j(parity_even, &return_right, Label::kNear);
__ j(equal, &check_zero, Label::kNear); // left == right.
__ j(condition, &return_left, Label::kNear);
__ jmp(&return_right, Label::kNear);
@@ -758,12 +761,6 @@ void CodeGenerator::AssembleArchInstruction(Instruction* instr) {
__ fadd(1);
__ jmp(&return_left, Label::kNear);
- __ bind(&check_nan_left);
- __ fld(0);
- __ fld(0);
- __ FCmp(); // NaN check.
- __ j(parity_even, &return_left, Label::kNear); // left == NaN.
-
__ bind(&return_right);
__ fxch();
@@ -781,7 +778,9 @@ void CodeGenerator::AssembleArchInstruction(Instruction* instr) {
__ fld(1);
__ fld(1);
__ FCmp();
- __ j(parity_even, &check_nan_left, Label::kNear); // At least one NaN.
+ // At least one NaN.
+ // Return the second operands if one of the two operands is NaN
+ __ j(parity_even, &return_right, Label::kNear);
__ j(equal, &check_zero, Label::kNear); // left == right.
__ j(condition, &return_left, Label::kNear);
__ jmp(&return_right, Label::kNear);
@@ -808,11 +807,6 @@ void CodeGenerator::AssembleArchInstruction(Instruction* instr) {
__ pop(eax); // restore esp
__ jmp(&return_left, Label::kNear);
- __ bind(&check_nan_left);
- __ fld(0);
- __ fld(0);
- __ FCmp(); // NaN check.
- __ j(parity_even, &return_left, Label::kNear); // left == NaN.
__ bind(&return_right);
__ fxch();
« 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