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/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/scopes.h" | 10 #include "src/scopes.h" |
(...skipping 708 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
719 break; | 719 break; |
720 case kSSEFloat32Sub: | 720 case kSSEFloat32Sub: |
721 ASSEMBLE_SSE_BINOP(subss); | 721 ASSEMBLE_SSE_BINOP(subss); |
722 break; | 722 break; |
723 case kSSEFloat32Mul: | 723 case kSSEFloat32Mul: |
724 ASSEMBLE_SSE_BINOP(mulss); | 724 ASSEMBLE_SSE_BINOP(mulss); |
725 break; | 725 break; |
726 case kSSEFloat32Div: | 726 case kSSEFloat32Div: |
727 ASSEMBLE_SSE_BINOP(divss); | 727 ASSEMBLE_SSE_BINOP(divss); |
728 break; | 728 break; |
| 729 case kSSEFloat32Neg: { |
| 730 // TODO(bmeurer): Use RIP relative 128-bit constants. |
| 731 // TODO(turbofan): Add AVX version with relaxed register constraints. |
| 732 __ pcmpeqd(kScratchDoubleReg, kScratchDoubleReg); |
| 733 __ psllq(kScratchDoubleReg, 31); |
| 734 __ xorps(i.OutputDoubleRegister(), kScratchDoubleReg); |
| 735 break; |
| 736 } |
| 737 case kSSEFloat32Sqrt: |
| 738 ASSEMBLE_SSE_UNOP(sqrtss); |
| 739 break; |
729 case kSSEFloat32Max: | 740 case kSSEFloat32Max: |
730 ASSEMBLE_SSE_BINOP(maxss); | 741 ASSEMBLE_SSE_BINOP(maxss); |
731 break; | 742 break; |
732 case kSSEFloat32Min: | 743 case kSSEFloat32Min: |
733 ASSEMBLE_SSE_BINOP(minss); | 744 ASSEMBLE_SSE_BINOP(minss); |
734 break; | 745 break; |
735 case kSSEFloat32Sqrt: | |
736 ASSEMBLE_SSE_UNOP(sqrtss); | |
737 break; | |
738 case kSSEFloat32ToFloat64: | 746 case kSSEFloat32ToFloat64: |
739 ASSEMBLE_SSE_UNOP(cvtss2sd); | 747 ASSEMBLE_SSE_UNOP(cvtss2sd); |
740 break; | 748 break; |
741 case kSSEFloat64Cmp: | 749 case kSSEFloat64Cmp: |
742 ASSEMBLE_SSE_BINOP(ucomisd); | 750 ASSEMBLE_SSE_BINOP(ucomisd); |
743 break; | 751 break; |
744 case kSSEFloat64Add: | 752 case kSSEFloat64Add: |
745 ASSEMBLE_SSE_BINOP(addsd); | 753 ASSEMBLE_SSE_BINOP(addsd); |
746 break; | 754 break; |
747 case kSSEFloat64Sub: | 755 case kSSEFloat64Sub: |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
784 __ movsd(i.OutputDoubleRegister(), Operand(rsp, 0)); | 792 __ movsd(i.OutputDoubleRegister(), Operand(rsp, 0)); |
785 __ addq(rsp, Immediate(kDoubleSize)); | 793 __ addq(rsp, Immediate(kDoubleSize)); |
786 break; | 794 break; |
787 } | 795 } |
788 case kSSEFloat64Max: | 796 case kSSEFloat64Max: |
789 ASSEMBLE_SSE_BINOP(maxsd); | 797 ASSEMBLE_SSE_BINOP(maxsd); |
790 break; | 798 break; |
791 case kSSEFloat64Min: | 799 case kSSEFloat64Min: |
792 ASSEMBLE_SSE_BINOP(minsd); | 800 ASSEMBLE_SSE_BINOP(minsd); |
793 break; | 801 break; |
| 802 case kSSEFloat64Neg: { |
| 803 // TODO(bmeurer): Use RIP relative 128-bit constants. |
| 804 // TODO(turbofan): Add AVX version with relaxed register constraints. |
| 805 __ pcmpeqd(kScratchDoubleReg, kScratchDoubleReg); |
| 806 __ psllq(kScratchDoubleReg, 63); |
| 807 __ xorpd(i.OutputDoubleRegister(), kScratchDoubleReg); |
| 808 break; |
| 809 } |
794 case kSSEFloat64Sqrt: | 810 case kSSEFloat64Sqrt: |
795 ASSEMBLE_SSE_UNOP(sqrtsd); | 811 ASSEMBLE_SSE_UNOP(sqrtsd); |
796 break; | 812 break; |
797 case kSSEFloat64Round: { | 813 case kSSEFloat64Round: { |
798 CpuFeatureScope sse_scope(masm(), SSE4_1); | 814 CpuFeatureScope sse_scope(masm(), SSE4_1); |
799 RoundingMode const mode = | 815 RoundingMode const mode = |
800 static_cast<RoundingMode>(MiscField::decode(instr->opcode())); | 816 static_cast<RoundingMode>(MiscField::decode(instr->opcode())); |
801 __ roundsd(i.OutputDoubleRegister(), i.InputDoubleRegister(0), mode); | 817 __ roundsd(i.OutputDoubleRegister(), i.InputDoubleRegister(0), mode); |
802 break; | 818 break; |
803 } | 819 } |
(...skipping 756 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1560 } | 1576 } |
1561 } | 1577 } |
1562 MarkLazyDeoptSite(); | 1578 MarkLazyDeoptSite(); |
1563 } | 1579 } |
1564 | 1580 |
1565 #undef __ | 1581 #undef __ |
1566 | 1582 |
1567 } // namespace internal | 1583 } // namespace internal |
1568 } // namespace compiler | 1584 } // namespace compiler |
1569 } // namespace v8 | 1585 } // namespace v8 |
OLD | NEW |