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 kSSEFloat32Abs: { |
| 730 // TODO(bmeurer): Use RIP relative 128-bit constants. |
| 731 // TODO(turbofan): Add AVX version with relaxed register constraints. |
| 732 __ pcmpeqd(kScratchDoubleReg, kScratchDoubleReg); |
| 733 __ psrlq(kScratchDoubleReg, 33); |
| 734 __ andps(i.OutputDoubleRegister(), kScratchDoubleReg); |
| 735 break; |
| 736 } |
729 case kSSEFloat32Neg: { | 737 case kSSEFloat32Neg: { |
730 // TODO(bmeurer): Use RIP relative 128-bit constants. | 738 // TODO(bmeurer): Use RIP relative 128-bit constants. |
731 // TODO(turbofan): Add AVX version with relaxed register constraints. | 739 // TODO(turbofan): Add AVX version with relaxed register constraints. |
732 __ pcmpeqd(kScratchDoubleReg, kScratchDoubleReg); | 740 __ pcmpeqd(kScratchDoubleReg, kScratchDoubleReg); |
733 __ psllq(kScratchDoubleReg, 31); | 741 __ psllq(kScratchDoubleReg, 31); |
734 __ xorps(i.OutputDoubleRegister(), kScratchDoubleReg); | 742 __ xorps(i.OutputDoubleRegister(), kScratchDoubleReg); |
735 break; | 743 break; |
736 } | 744 } |
737 case kSSEFloat32Sqrt: | 745 case kSSEFloat32Sqrt: |
738 ASSEMBLE_SSE_UNOP(sqrtss); | 746 ASSEMBLE_SSE_UNOP(sqrtss); |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
792 __ movsd(i.OutputDoubleRegister(), Operand(rsp, 0)); | 800 __ movsd(i.OutputDoubleRegister(), Operand(rsp, 0)); |
793 __ addq(rsp, Immediate(kDoubleSize)); | 801 __ addq(rsp, Immediate(kDoubleSize)); |
794 break; | 802 break; |
795 } | 803 } |
796 case kSSEFloat64Max: | 804 case kSSEFloat64Max: |
797 ASSEMBLE_SSE_BINOP(maxsd); | 805 ASSEMBLE_SSE_BINOP(maxsd); |
798 break; | 806 break; |
799 case kSSEFloat64Min: | 807 case kSSEFloat64Min: |
800 ASSEMBLE_SSE_BINOP(minsd); | 808 ASSEMBLE_SSE_BINOP(minsd); |
801 break; | 809 break; |
| 810 case kSSEFloat64Abs: { |
| 811 // TODO(bmeurer): Use RIP relative 128-bit constants. |
| 812 // TODO(turbofan): Add AVX version with relaxed register constraints. |
| 813 __ pcmpeqd(kScratchDoubleReg, kScratchDoubleReg); |
| 814 __ psrlq(kScratchDoubleReg, 1); |
| 815 __ andpd(i.OutputDoubleRegister(), kScratchDoubleReg); |
| 816 break; |
| 817 } |
802 case kSSEFloat64Neg: { | 818 case kSSEFloat64Neg: { |
803 // TODO(bmeurer): Use RIP relative 128-bit constants. | 819 // TODO(bmeurer): Use RIP relative 128-bit constants. |
804 // TODO(turbofan): Add AVX version with relaxed register constraints. | 820 // TODO(turbofan): Add AVX version with relaxed register constraints. |
805 __ pcmpeqd(kScratchDoubleReg, kScratchDoubleReg); | 821 __ pcmpeqd(kScratchDoubleReg, kScratchDoubleReg); |
806 __ psllq(kScratchDoubleReg, 63); | 822 __ psllq(kScratchDoubleReg, 63); |
807 __ xorpd(i.OutputDoubleRegister(), kScratchDoubleReg); | 823 __ xorpd(i.OutputDoubleRegister(), kScratchDoubleReg); |
808 break; | 824 break; |
809 } | 825 } |
810 case kSSEFloat64Sqrt: | 826 case kSSEFloat64Sqrt: |
811 ASSEMBLE_SSE_UNOP(sqrtsd); | 827 ASSEMBLE_SSE_UNOP(sqrtsd); |
(...skipping 764 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1576 } | 1592 } |
1577 } | 1593 } |
1578 MarkLazyDeoptSite(); | 1594 MarkLazyDeoptSite(); |
1579 } | 1595 } |
1580 | 1596 |
1581 #undef __ | 1597 #undef __ |
1582 | 1598 |
1583 } // namespace internal | 1599 } // namespace internal |
1584 } // namespace compiler | 1600 } // namespace compiler |
1585 } // namespace v8 | 1601 } // namespace v8 |
OLD | NEW |