Index: src/ia32/lithium-codegen-ia32.cc |
diff --git a/src/ia32/lithium-codegen-ia32.cc b/src/ia32/lithium-codegen-ia32.cc |
index 2925dcde950175485607cf4e42f50c03366334fb..67feb333e083ae06c971078cbdb457e9e0ee78b5 100644 |
--- a/src/ia32/lithium-codegen-ia32.cc |
+++ b/src/ia32/lithium-codegen-ia32.cc |
@@ -2950,7 +2950,10 @@ void LCodeGen::DoMathPowHalf(LMathPowHalf* instr) { |
__ movd(xmm_scratch, scratch); |
__ cvtss2sd(xmm_scratch, xmm_scratch); |
__ ucomisd(input_reg, xmm_scratch); |
+ // Comparing -Infinity with NaN results in "unordered", which sets the |
+ // zero flag as if both were equal. However, it also sets the carry flag. |
__ j(not_equal, &sqrt, Label::kNear); |
+ __ j(carry, &sqrt, Label::kNear); |
// If input is -Infinity, return Infinity. |
__ xorps(input_reg, input_reg); |
__ subsd(input_reg, xmm_scratch); |