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

Side by Side Diff: src/compiler/x87/code-generator-x87.cc

Issue 1425763002: X87: fix the sqrt 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 | no next file » | 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 956 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 __ fstp(0); 975 __ fstp(0);
976 __ fld_d(MemOperand(esp, 0)); 976 __ 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
977 __ fsqrt(); 986 __ 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
978 __ lea(esp, Operand(esp, kDoubleSize)); 992 __ lea(esp, Operand(esp, kDoubleSize));
979 break; 993 break;
980 } 994 }
981 case kX87Float64Round: { 995 case kX87Float64Round: {
982 RoundingMode mode = 996 RoundingMode mode =
983 static_cast<RoundingMode>(MiscField::decode(instr->opcode())); 997 static_cast<RoundingMode>(MiscField::decode(instr->opcode()));
984 if (mode == MiscField::encode(kRoundDown)) { 998 if (mode == MiscField::encode(kRoundDown)) {
985 __ X87SetRC(0x0400); 999 __ X87SetRC(0x0400);
986 } else { 1000 } else {
987 __ X87SetRC(0x0c00); 1001 __ X87SetRC(0x0c00);
(...skipping 903 matching lines...) Expand 10 before | Expand all | Expand 10 after
1891 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; 1905 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc;
1892 __ Nop(padding_size); 1906 __ Nop(padding_size);
1893 } 1907 }
1894 } 1908 }
1895 1909
1896 #undef __ 1910 #undef __
1897 1911
1898 } // namespace compiler 1912 } // namespace compiler
1899 } // namespace internal 1913 } // namespace internal
1900 } // namespace v8 1914 } // namespace v8
OLDNEW
« 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