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 89ecff0a709dc4dab18f760ae834abe79cb4aa85..838d2d2e126c8be44dab189ba091f9e10d874c91 100644 |
--- a/src/compiler/x87/code-generator-x87.cc |
+++ b/src/compiler/x87/code-generator-x87.cc |
@@ -974,7 +974,21 @@ void CodeGenerator::AssembleArchInstruction(Instruction* instr) { |
case kX87Float64Sqrt: { |
__ fstp(0); |
__ fld_d(MemOperand(esp, 0)); |
+#if V8_GLIBC_PREREQ(2, 19) |
+ __ push(edx); |
+ __ sub(esp, Immediate(2 * kIntSize)); |
+ __ fnstcw(MemOperand(esp, 4)); |
+ __ mov(edx, Immediate(0xfeff)); |
+ __ and_(edx, MemOperand(esp, 4)); |
+ __ mov(MemOperand(esp, 0), edx); |
+ __ fldcw(MemOperand(esp, 0)); |
+#endif |
__ fsqrt(); |
+#if V8_GLIBC_PREREQ(2, 19) |
+ __ fldcw(MemOperand(esp, 4)); |
+ __ lea(esp, Operand(esp, 2 * kIntSize)); |
+ __ pop(edx); |
+#endif |
__ lea(esp, Operand(esp, kDoubleSize)); |
break; |
} |