Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(284)

Side by Side Diff: src/ia32/macro-assembler-ia32.cc

Issue 2937653002: [ia32][wasm] Add I8x16/I16x8 Splat/ExtractLane/ReplaceLane (Closed)
Patch Set: Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 2118 matching lines...) Expand 10 before | Expand all | Expand 10 after
2129 pop(eax); 2129 pop(eax);
2130 } else { 2130 } else {
2131 push(Immediate(upper)); 2131 push(Immediate(upper));
2132 push(Immediate(lower)); 2132 push(Immediate(lower));
2133 movsd(dst, Operand(esp, 0)); 2133 movsd(dst, Operand(esp, 0));
2134 add(esp, Immediate(kDoubleSize)); 2134 add(esp, Immediate(kDoubleSize));
2135 } 2135 }
2136 } 2136 }
2137 } 2137 }
2138 2138
2139 void MacroAssembler::Pxor(XMMRegister dst, const Operand& src) {
2140 if (CpuFeatures::IsSupported(AVX)) {
2141 CpuFeatureScope scope(this, AVX);
2142 vpxor(dst, dst, src);
2143 } else {
2144 pxor(dst, src);
2145 }
2146 }
2147
2148 void MacroAssembler::Pshuflw(XMMRegister dst, const Operand& src,
2149 uint8_t shuffle) {
2150 if (CpuFeatures::IsSupported(AVX)) {
2151 CpuFeatureScope scope(this, AVX);
2152 vpshuflw(dst, src, shuffle);
2153 } else {
2154 pshuflw(dst, src, shuffle);
2155 }
2156 }
2157
2139 void MacroAssembler::Pshufd(XMMRegister dst, const Operand& src, 2158 void MacroAssembler::Pshufd(XMMRegister dst, const Operand& src,
2140 uint8_t shuffle) { 2159 uint8_t shuffle) {
2141 if (CpuFeatures::IsSupported(AVX)) { 2160 if (CpuFeatures::IsSupported(AVX)) {
2142 CpuFeatureScope scope(this, AVX); 2161 CpuFeatureScope scope(this, AVX);
2143 vpshufd(dst, src, shuffle); 2162 vpshufd(dst, src, shuffle);
2144 } else { 2163 } else {
2145 pshufd(dst, src, shuffle); 2164 pshufd(dst, src, shuffle);
2146 } 2165 }
2147 } 2166 }
2148 2167
2168 void MacroAssembler::Pshufb(XMMRegister dst, const Operand& src) {
2169 if (CpuFeatures::IsSupported(AVX)) {
2170 CpuFeatureScope scope(this, AVX);
2171 vpshufb(dst, dst, src);
2172 return;
2173 }
2174 if (CpuFeatures::IsSupported(SSSE3)) {
2175 CpuFeatureScope sse_scope(this, SSSE3);
2176 pshufb(dst, src);
2177 return;
2178 }
2179 UNREACHABLE();
2180 }
2181
2182 void MacroAssembler::Pextrb(Register dst, XMMRegister src, int8_t imm8) {
2183 if (CpuFeatures::IsSupported(AVX)) {
2184 CpuFeatureScope scope(this, AVX);
2185 vpextrb(dst, src, imm8);
2186 return;
2187 }
2188 if (CpuFeatures::IsSupported(SSE4_1)) {
2189 CpuFeatureScope sse_scope(this, SSE4_1);
2190 pextrb(dst, src, imm8);
2191 return;
2192 }
2193 UNREACHABLE();
2194 }
2195
2196 void MacroAssembler::Pextrw(Register dst, XMMRegister src, int8_t imm8) {
2197 if (CpuFeatures::IsSupported(AVX)) {
2198 CpuFeatureScope scope(this, AVX);
2199 vpextrw(dst, src, imm8);
2200 return;
2201 }
2202 if (CpuFeatures::IsSupported(SSE4_1)) {
2203 CpuFeatureScope sse_scope(this, SSE4_1);
2204 pextrw(dst, src, imm8);
2205 return;
2206 }
2207 UNREACHABLE();
2208 }
2209
2149 void MacroAssembler::Pextrd(Register dst, XMMRegister src, int8_t imm8) { 2210 void MacroAssembler::Pextrd(Register dst, XMMRegister src, int8_t imm8) {
2150 if (imm8 == 0) { 2211 if (imm8 == 0) {
2151 Movd(dst, src); 2212 Movd(dst, src);
2152 return; 2213 return;
2153 } 2214 }
2154 if (CpuFeatures::IsSupported(AVX)) { 2215 if (CpuFeatures::IsSupported(AVX)) {
2155 CpuFeatureScope scope(this, AVX); 2216 CpuFeatureScope scope(this, AVX);
2156 vpextrd(dst, src, imm8); 2217 vpextrd(dst, src, imm8);
2157 return; 2218 return;
2158 } 2219 }
(...skipping 642 matching lines...) Expand 10 before | Expand all | Expand 10 after
2801 mov(eax, dividend); 2862 mov(eax, dividend);
2802 shr(eax, 31); 2863 shr(eax, 31);
2803 add(edx, eax); 2864 add(edx, eax);
2804 } 2865 }
2805 2866
2806 2867
2807 } // namespace internal 2868 } // namespace internal
2808 } // namespace v8 2869 } // namespace v8
2809 2870
2810 #endif // V8_TARGET_ARCH_IA32 2871 #endif // V8_TARGET_ARCH_IA32
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698