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

Side by Side 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, 1 month 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 unified diff | Download patch
« no previous file with comments | « no previous file | src/x87/codegen-x87.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/compiler/code-generator.h" 5 #include "src/compiler/code-generator.h"
6 6
7 #include "src/compiler/code-generator-impl.h" 7 #include "src/compiler/code-generator-impl.h"
8 #include "src/compiler/gap-resolver.h" 8 #include "src/compiler/gap-resolver.h"
9 #include "src/compiler/node-matchers.h" 9 #include "src/compiler/node-matchers.h"
10 #include "src/compiler/osr.h" 10 #include "src/compiler/osr.h"
(...skipping 954 matching lines...) Expand 10 before | Expand all | Expand 10 after
965 } 965 }
966 case kX87Float64InsertLowWord32: { 966 case kX87Float64InsertLowWord32: {
967 __ sub(esp, Immediate(kDoubleSize)); 967 __ sub(esp, Immediate(kDoubleSize));
968 __ fstp_d(MemOperand(esp, 0)); 968 __ fstp_d(MemOperand(esp, 0));
969 __ mov(MemOperand(esp, 0), i.InputRegister(1)); 969 __ mov(MemOperand(esp, 0), i.InputRegister(1));
970 __ fld_d(MemOperand(esp, 0)); 970 __ fld_d(MemOperand(esp, 0));
971 __ add(esp, Immediate(kDoubleSize)); 971 __ add(esp, Immediate(kDoubleSize));
972 break; 972 break;
973 } 973 }
974 case kX87Float64Sqrt: { 974 case kX87Float64Sqrt: {
975 __ X87SetFPUCW(0x027F);
975 __ fstp(0); 976 __ fstp(0);
976 __ fld_d(MemOperand(esp, 0)); 977 __ fld_d(MemOperand(esp, 0));
977 #if V8_GLIBC_PREREQ(2, 19)
978 __ push(edx);
979 __ sub(esp, Immediate(2 * kIntSize));
980 __ fnstcw(MemOperand(esp, 4));
981 __ mov(edx, Immediate(0xfeff));
982 __ and_(edx, MemOperand(esp, 4));
983 __ mov(MemOperand(esp, 0), edx);
984 __ fldcw(MemOperand(esp, 0));
985 #endif
986 __ fsqrt(); 978 __ fsqrt();
987 #if V8_GLIBC_PREREQ(2, 19)
988 __ fldcw(MemOperand(esp, 4));
989 __ lea(esp, Operand(esp, 2 * kIntSize));
990 __ pop(edx);
991 #endif
992 __ lea(esp, Operand(esp, kDoubleSize)); 979 __ lea(esp, Operand(esp, kDoubleSize));
980 __ X87SetFPUCW(0x037F);
993 break; 981 break;
994 } 982 }
995 case kX87Float64Round: { 983 case kX87Float64Round: {
996 RoundingMode mode = 984 RoundingMode mode =
997 static_cast<RoundingMode>(MiscField::decode(instr->opcode())); 985 static_cast<RoundingMode>(MiscField::decode(instr->opcode()));
998 if (mode == MiscField::encode(kRoundDown)) { 986 if (mode == MiscField::encode(kRoundDown)) {
999 __ X87SetRC(0x0400); 987 __ X87SetRC(0x0400);
1000 } else { 988 } else {
1001 __ X87SetRC(0x0c00); 989 __ X87SetRC(0x0c00);
1002 } 990 }
(...skipping 902 matching lines...) Expand 10 before | Expand all | Expand 10 after
1905 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; 1893 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc;
1906 __ Nop(padding_size); 1894 __ Nop(padding_size);
1907 } 1895 }
1908 } 1896 }
1909 1897
1910 #undef __ 1898 #undef __
1911 1899
1912 } // namespace compiler 1900 } // namespace compiler
1913 } // namespace internal 1901 } // namespace internal
1914 } // namespace v8 1902 } // namespace v8
OLDNEW
« 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