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

Side by Side Diff: src/compiler/x64/code-generator-x64.cc

Issue 2767983002: [wasm] Implement wasm x64 I16x8 Ops (Closed)
Patch Set: Fix order of ops Created 3 years, 8 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 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 <limits> 7 #include <limits>
8 8
9 #include "src/compilation-info.h" 9 #include "src/compilation-info.h"
10 #include "src/compiler/code-generator-impl.h" 10 #include "src/compiler/code-generator-impl.h"
(...skipping 2217 matching lines...) Expand 10 before | Expand all | Expand 10 after
2228 case kX64I32x4MaxU: { 2228 case kX64I32x4MaxU: {
2229 CpuFeatureScope sse_scope(masm(), SSE4_1); 2229 CpuFeatureScope sse_scope(masm(), SSE4_1);
2230 __ pmaxud(i.OutputSimd128Register(), i.InputSimd128Register(1)); 2230 __ pmaxud(i.OutputSimd128Register(), i.InputSimd128Register(1));
2231 break; 2231 break;
2232 } 2232 }
2233 case kX64S128Zero: { 2233 case kX64S128Zero: {
2234 XMMRegister dst = i.OutputSimd128Register(); 2234 XMMRegister dst = i.OutputSimd128Register();
2235 __ xorps(dst, dst); 2235 __ xorps(dst, dst);
2236 break; 2236 break;
2237 } 2237 }
2238 case kX64S32x4Select: { 2238 case kX64I16x8Splat: {
2239 XMMRegister dst = i.OutputSimd128Register();
2240 __ movd(dst, i.InputRegister(0));
2241 __ pshuflw(dst, dst, 0x0);
2242 __ pshufhw(dst, dst, 0x0);
2243 __ pshufd(dst, dst, 0x0);
2244 break;
2245 }
2246 case kX64I16x8ExtractLane: {
2247 CpuFeatureScope sse_scope(masm(), SSE4_1);
2248 Register dst = i.OutputRegister();
2249 __ xorq(dst, dst);
bbudge 2017/04/17 17:34:06 Is this really needed? It seems like movsx (move w
gdeepti 2017/04/17 17:46:22 Not needed, left behind as a result of merge after
2250 __ pextrw(dst, i.InputSimd128Register(0), i.InputInt8(1));
2251 __ movsxwl(i.OutputRegister(), i.OutputRegister());
bbudge 2017/04/17 17:34:06 nit: use dst here.
gdeepti 2017/04/17 17:46:22 Done.
2252 break;
2253 }
2254 case kX64I16x8ReplaceLane: {
2255 CpuFeatureScope sse_scope(masm(), SSE4_1);
2256 if (instr->InputAt(2)->IsRegister()) {
2257 __ pinsrw(i.OutputSimd128Register(), i.InputRegister(2),
2258 i.InputInt8(1));
2259 } else {
2260 __ pinsrw(i.OutputSimd128Register(), i.InputOperand(2), i.InputInt8(1));
2261 }
2262 break;
2263 }
2264 case kX64I16x8Shl: {
2265 __ psllw(i.OutputSimd128Register(), i.InputInt8(1));
2266 break;
2267 }
2268 case kX64I16x8ShrS: {
2269 __ psraw(i.OutputSimd128Register(), i.InputInt8(1));
2270 break;
2271 }
2272 case kX64I16x8Add: {
2273 __ paddw(i.OutputSimd128Register(), i.InputSimd128Register(1));
2274 break;
2275 }
2276 case kX64I16x8AddSaturateS: {
2277 __ paddsw(i.OutputSimd128Register(), i.InputSimd128Register(1));
2278 break;
2279 }
2280 case kX64I16x8Sub: {
2281 __ psubw(i.OutputSimd128Register(), i.InputSimd128Register(1));
2282 break;
2283 }
2284 case kX64I16x8SubSaturateS: {
2285 __ psubsw(i.OutputSimd128Register(), i.InputSimd128Register(1));
2286 break;
2287 }
2288 case kX64I16x8Mul: {
2289 CpuFeatureScope sse_scope(masm(), SSE4_1);
2290 __ pmullw(i.OutputSimd128Register(), i.InputSimd128Register(1));
2291 break;
2292 }
2293 case kX64I16x8MinS: {
2294 CpuFeatureScope sse_scope(masm(), SSE4_1);
2295 __ pminsw(i.OutputSimd128Register(), i.InputSimd128Register(1));
2296 break;
2297 }
2298 case kX64I16x8MaxS: {
2299 CpuFeatureScope sse_scope(masm(), SSE4_1);
2300 __ pmaxsw(i.OutputSimd128Register(), i.InputSimd128Register(1));
2301 break;
2302 }
2303 case kX64I16x8Eq: {
2304 __ pcmpeqw(i.OutputSimd128Register(), i.InputSimd128Register(1));
2305 break;
2306 }
2307 case kX64I16x8Ne: {
2308 __ pcmpeqw(i.OutputSimd128Register(), i.InputSimd128Register(1));
2309 __ pcmpeqw(kScratchDoubleReg, kScratchDoubleReg);
2310 __ pxor(i.OutputSimd128Register(), kScratchDoubleReg);
2311 break;
2312 }
2313 case kX64I16x8ShrU: {
2314 __ psrlw(i.OutputSimd128Register(), i.InputInt8(1));
2315 break;
2316 }
2317 case kX64I16x8AddSaturateU: {
2318 __ paddusw(i.OutputSimd128Register(), i.InputSimd128Register(1));
2319 break;
2320 }
2321 case kX64I16x8SubSaturateU: {
2322 __ psubusw(i.OutputSimd128Register(), i.InputSimd128Register(1));
2323 break;
2324 }
2325 case kX64I16x8MinU: {
2326 CpuFeatureScope sse_scope(masm(), SSE4_1);
2327 __ pminuw(i.OutputSimd128Register(), i.InputSimd128Register(1));
2328 break;
2329 }
2330 case kX64I16x8MaxU: {
2331 CpuFeatureScope sse_scope(masm(), SSE4_1);
2332 __ pmaxuw(i.OutputSimd128Register(), i.InputSimd128Register(1));
2333 break;
2334 }
2335 case kX64S128Select: {
2239 // Mask used here is stored in dst. 2336 // Mask used here is stored in dst.
2240 XMMRegister dst = i.OutputSimd128Register(); 2337 XMMRegister dst = i.OutputSimd128Register();
2241 __ movaps(kScratchDoubleReg, i.InputSimd128Register(1)); 2338 __ movaps(kScratchDoubleReg, i.InputSimd128Register(1));
2242 __ xorps(kScratchDoubleReg, i.InputSimd128Register(2)); 2339 __ xorps(kScratchDoubleReg, i.InputSimd128Register(2));
2243 __ andps(dst, kScratchDoubleReg); 2340 __ andps(dst, kScratchDoubleReg);
2244 __ xorps(dst, i.InputSimd128Register(2)); 2341 __ xorps(dst, i.InputSimd128Register(2));
2245 break; 2342 break;
2246 } 2343 }
2247 case kCheckedLoadInt8: 2344 case kCheckedLoadInt8:
2248 ASSEMBLE_CHECKED_LOAD_INTEGER(movsxbl); 2345 ASSEMBLE_CHECKED_LOAD_INTEGER(movsxbl);
(...skipping 752 matching lines...) Expand 10 before | Expand all | Expand 10 after
3001 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; 3098 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc;
3002 __ Nop(padding_size); 3099 __ Nop(padding_size);
3003 } 3100 }
3004 } 3101 }
3005 3102
3006 #undef __ 3103 #undef __
3007 3104
3008 } // namespace compiler 3105 } // namespace compiler
3009 } // namespace internal 3106 } // namespace internal
3010 } // namespace v8 3107 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698