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 816 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
827 __ lea(esp, Operand(esp, kFloatSize)); | 827 __ lea(esp, Operand(esp, kFloatSize)); |
828 break; | 828 break; |
829 } | 829 } |
830 case kX87Float32Abs: { | 830 case kX87Float32Abs: { |
831 __ fstp(0); | 831 __ fstp(0); |
832 __ fld_s(MemOperand(esp, 0)); | 832 __ fld_s(MemOperand(esp, 0)); |
833 __ fabs(); | 833 __ fabs(); |
834 __ lea(esp, Operand(esp, kFloatSize)); | 834 __ lea(esp, Operand(esp, kFloatSize)); |
835 break; | 835 break; |
836 } | 836 } |
| 837 case kX87Float32Round: { |
| 838 RoundingMode mode = |
| 839 static_cast<RoundingMode>(MiscField::decode(instr->opcode())); |
| 840 // Set the correct round mode in x87 control register |
| 841 __ X87SetRC((mode << 10)); |
| 842 |
| 843 if (!instr->InputAt(0)->IsDoubleRegister()) { |
| 844 InstructionOperand* input = instr->InputAt(0); |
| 845 USE(input); |
| 846 DCHECK(input->IsDoubleStackSlot()); |
| 847 __ fstp(0); |
| 848 __ fld_s(i.InputOperand(0)); |
| 849 } |
| 850 __ frndint(); |
| 851 __ X87SetRC(0x0000); |
| 852 break; |
| 853 } |
837 case kX87Float64Add: { | 854 case kX87Float64Add: { |
838 __ X87SetFPUCW(0x027F); | 855 __ X87SetFPUCW(0x027F); |
839 __ fstp(0); | 856 __ fstp(0); |
840 __ fld_d(MemOperand(esp, 0)); | 857 __ fld_d(MemOperand(esp, 0)); |
841 __ fld_d(MemOperand(esp, kDoubleSize)); | 858 __ fld_d(MemOperand(esp, kDoubleSize)); |
842 __ faddp(); | 859 __ faddp(); |
843 // Clear stack. | 860 // Clear stack. |
844 __ lea(esp, Operand(esp, 2 * kDoubleSize)); | 861 __ lea(esp, Operand(esp, 2 * kDoubleSize)); |
845 // Restore the default value of control word. | 862 // Restore the default value of control word. |
846 __ X87SetFPUCW(0x037F); | 863 __ X87SetFPUCW(0x037F); |
(...skipping 1141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1988 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; | 2005 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; |
1989 __ Nop(padding_size); | 2006 __ Nop(padding_size); |
1990 } | 2007 } |
1991 } | 2008 } |
1992 | 2009 |
1993 #undef __ | 2010 #undef __ |
1994 | 2011 |
1995 } // namespace compiler | 2012 } // namespace compiler |
1996 } // namespace internal | 2013 } // namespace internal |
1997 } // namespace v8 | 2014 } // namespace v8 |
OLD | NEW |