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 724 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
735 } | 735 } |
736 case kSSEFloat32ToFloat64: | 736 case kSSEFloat32ToFloat64: |
737 __ cvtss2sd(i.OutputDoubleRegister(), i.InputOperand(0)); | 737 __ cvtss2sd(i.OutputDoubleRegister(), i.InputOperand(0)); |
738 break; | 738 break; |
739 case kSSEFloat64ToFloat32: | 739 case kSSEFloat64ToFloat32: |
740 __ cvtsd2ss(i.OutputDoubleRegister(), i.InputOperand(0)); | 740 __ cvtsd2ss(i.OutputDoubleRegister(), i.InputOperand(0)); |
741 break; | 741 break; |
742 case kSSEFloat32ToInt32: | 742 case kSSEFloat32ToInt32: |
743 __ cvttss2si(i.OutputRegister(), i.InputOperand(0)); | 743 __ cvttss2si(i.OutputRegister(), i.InputOperand(0)); |
744 break; | 744 break; |
| 745 case kSSEFloat32ToUint32: { |
| 746 Label success; |
| 747 __ cvttss2si(i.OutputRegister(), i.InputOperand(0)); |
| 748 __ test(i.OutputRegister(), i.OutputRegister()); |
| 749 __ j(positive, &success); |
| 750 __ Move(kScratchDoubleReg, static_cast<float>(INT32_MIN)); |
| 751 __ addss(kScratchDoubleReg, i.InputOperand(0)); |
| 752 __ cvttss2si(i.OutputRegister(), kScratchDoubleReg); |
| 753 __ or_(i.OutputRegister(), Immediate(0x80000000)); |
| 754 __ bind(&success); |
| 755 break; |
| 756 } |
745 case kSSEFloat64ToInt32: | 757 case kSSEFloat64ToInt32: |
746 __ cvttsd2si(i.OutputRegister(), i.InputOperand(0)); | 758 __ cvttsd2si(i.OutputRegister(), i.InputOperand(0)); |
747 break; | 759 break; |
748 case kSSEFloat64ToUint32: { | 760 case kSSEFloat64ToUint32: { |
749 __ Move(kScratchDoubleReg, -2147483648.0); | 761 __ Move(kScratchDoubleReg, -2147483648.0); |
750 __ addsd(kScratchDoubleReg, i.InputOperand(0)); | 762 __ addsd(kScratchDoubleReg, i.InputOperand(0)); |
751 __ cvttsd2si(i.OutputRegister(), kScratchDoubleReg); | 763 __ cvttsd2si(i.OutputRegister(), kScratchDoubleReg); |
752 __ add(i.OutputRegister(), Immediate(0x80000000)); | 764 __ add(i.OutputRegister(), Immediate(0x80000000)); |
753 break; | 765 break; |
754 } | 766 } |
(...skipping 948 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1703 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; | 1715 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; |
1704 __ Nop(padding_size); | 1716 __ Nop(padding_size); |
1705 } | 1717 } |
1706 } | 1718 } |
1707 | 1719 |
1708 #undef __ | 1720 #undef __ |
1709 | 1721 |
1710 } // namespace compiler | 1722 } // namespace compiler |
1711 } // namespace internal | 1723 } // namespace internal |
1712 } // namespace v8 | 1724 } // namespace v8 |
OLD | NEW |