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

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

Issue 1417553007: X87: Fix the sqrt precision issue. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 2 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/x87/codegen-x87.cc » ('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 838d2d2e126c8be44dab189ba091f9e10d874c91..e574c05742ea0d8cb6c6a6351858c9bbf24d81a7 100644
--- a/src/compiler/x87/code-generator-x87.cc
+++ b/src/compiler/x87/code-generator-x87.cc
@@ -972,24 +972,12 @@ void CodeGenerator::AssembleArchInstruction(Instruction* instr) {
break;
}
case kX87Float64Sqrt: {
+ __ X87SetFPUCW(0x027F);
__ 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));
+ __ X87SetFPUCW(0x037F);
break;
}
case kX87Float64Round: {
« no previous file with comments | « no previous file | src/x87/codegen-x87.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698