OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 #if V8_TARGET_ARCH_IA32 | 5 #if V8_TARGET_ARCH_IA32 |
6 | 6 |
7 #include "src/base/bits.h" | 7 #include "src/base/bits.h" |
8 #include "src/base/division-by-constant.h" | 8 #include "src/base/division-by-constant.h" |
9 #include "src/base/utils/random-number-generator.h" | 9 #include "src/base/utils/random-number-generator.h" |
10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
(...skipping 2109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2120 pop(eax); | 2120 pop(eax); |
2121 } else { | 2121 } else { |
2122 push(Immediate(upper)); | 2122 push(Immediate(upper)); |
2123 push(Immediate(lower)); | 2123 push(Immediate(lower)); |
2124 movsd(dst, Operand(esp, 0)); | 2124 movsd(dst, Operand(esp, 0)); |
2125 add(esp, Immediate(kDoubleSize)); | 2125 add(esp, Immediate(kDoubleSize)); |
2126 } | 2126 } |
2127 } | 2127 } |
2128 } | 2128 } |
2129 | 2129 |
| 2130 void MacroAssembler::Pshufd(XMMRegister dst, const Operand& src, |
| 2131 uint8_t shuffle) { |
| 2132 if (CpuFeatures::IsSupported(AVX)) { |
| 2133 CpuFeatureScope scope(this, AVX); |
| 2134 vpshufd(dst, src, shuffle); |
| 2135 } else { |
| 2136 pshufd(dst, src, shuffle); |
| 2137 } |
| 2138 } |
2130 | 2139 |
2131 void MacroAssembler::Pextrd(Register dst, XMMRegister src, int8_t imm8) { | 2140 void MacroAssembler::Pextrd(Register dst, XMMRegister src, int8_t imm8) { |
2132 if (imm8 == 0) { | 2141 if (imm8 == 0) { |
2133 movd(dst, src); | 2142 Movd(dst, src); |
| 2143 return; |
| 2144 } |
| 2145 if (CpuFeatures::IsSupported(AVX)) { |
| 2146 CpuFeatureScope scope(this, AVX); |
| 2147 vpextrd(dst, src, imm8); |
2134 return; | 2148 return; |
2135 } | 2149 } |
2136 if (CpuFeatures::IsSupported(SSE4_1)) { | 2150 if (CpuFeatures::IsSupported(SSE4_1)) { |
2137 CpuFeatureScope sse_scope(this, SSE4_1); | 2151 CpuFeatureScope sse_scope(this, SSE4_1); |
2138 pextrd(dst, src, imm8); | 2152 pextrd(dst, src, imm8); |
2139 return; | 2153 return; |
2140 } | 2154 } |
2141 DCHECK_LT(imm8, 4); | 2155 DCHECK_LT(imm8, 4); |
2142 pshufd(xmm0, src, imm8); | 2156 pshufd(xmm0, src, imm8); |
2143 movd(dst, xmm0); | 2157 movd(dst, xmm0); |
(...skipping 634 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2778 mov(eax, dividend); | 2792 mov(eax, dividend); |
2779 shr(eax, 31); | 2793 shr(eax, 31); |
2780 add(edx, eax); | 2794 add(edx, eax); |
2781 } | 2795 } |
2782 | 2796 |
2783 | 2797 |
2784 } // namespace internal | 2798 } // namespace internal |
2785 } // namespace v8 | 2799 } // namespace v8 |
2786 | 2800 |
2787 #endif // V8_TARGET_ARCH_IA32 | 2801 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |