OLD | NEW |
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/ast/scopes.h" | 7 #include "src/ast/scopes.h" |
8 #include "src/compiler/code-generator-impl.h" | 8 #include "src/compiler/code-generator-impl.h" |
9 #include "src/compiler/gap-resolver.h" | 9 #include "src/compiler/gap-resolver.h" |
10 #include "src/compiler/node-matchers.h" | 10 #include "src/compiler/node-matchers.h" |
(...skipping 1073 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1084 __ fstp(0); | 1084 __ fstp(0); |
1085 __ fld_d(MemOperand(esp, 0)); | 1085 __ fld_d(MemOperand(esp, 0)); |
1086 __ fsqrt(); | 1086 __ fsqrt(); |
1087 __ lea(esp, Operand(esp, kDoubleSize)); | 1087 __ lea(esp, Operand(esp, kDoubleSize)); |
1088 __ X87SetFPUCW(0x037F); | 1088 __ X87SetFPUCW(0x037F); |
1089 break; | 1089 break; |
1090 } | 1090 } |
1091 case kX87Float64Round: { | 1091 case kX87Float64Round: { |
1092 RoundingMode mode = | 1092 RoundingMode mode = |
1093 static_cast<RoundingMode>(MiscField::decode(instr->opcode())); | 1093 static_cast<RoundingMode>(MiscField::decode(instr->opcode())); |
1094 if (mode == MiscField::encode(kRoundDown)) { | 1094 // Set the correct round mode in x87 control register |
1095 __ X87SetRC(0x0400); | 1095 __ X87SetRC((mode << 10)); |
1096 } else { | |
1097 __ X87SetRC(0x0c00); | |
1098 } | |
1099 | 1096 |
1100 if (!instr->InputAt(0)->IsDoubleRegister()) { | 1097 if (!instr->InputAt(0)->IsDoubleRegister()) { |
1101 InstructionOperand* input = instr->InputAt(0); | 1098 InstructionOperand* input = instr->InputAt(0); |
1102 USE(input); | 1099 USE(input); |
1103 DCHECK(input->IsDoubleStackSlot()); | 1100 DCHECK(input->IsDoubleStackSlot()); |
1104 __ fstp(0); | 1101 __ fstp(0); |
1105 __ fld_d(i.InputOperand(0)); | 1102 __ fld_d(i.InputOperand(0)); |
1106 } | 1103 } |
1107 __ frndint(); | 1104 __ frndint(); |
1108 __ X87SetRC(0x0000); | 1105 __ X87SetRC(0x0000); |
(...skipping 882 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1991 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; | 1988 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; |
1992 __ Nop(padding_size); | 1989 __ Nop(padding_size); |
1993 } | 1990 } |
1994 } | 1991 } |
1995 | 1992 |
1996 #undef __ | 1993 #undef __ |
1997 | 1994 |
1998 } // namespace compiler | 1995 } // namespace compiler |
1999 } // namespace internal | 1996 } // namespace internal |
2000 } // namespace v8 | 1997 } // namespace v8 |
OLD | NEW |