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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: src/compiler/x64/code-generator-x64.cc
diff --git a/src/compiler/x64/code-generator-x64.cc b/src/compiler/x64/code-generator-x64.cc
index 3215ec24f725717e79f55e9ca6128edfaf871ca2..ac4df46753db21e38a6b67d70e39b7c57019e21a 100644
--- a/src/compiler/x64/code-generator-x64.cc
+++ b/src/compiler/x64/code-generator-x64.cc
@@ -2235,7 +2235,104 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
__ xorps(dst, dst);
break;
}
- case kX64S32x4Select: {
+ case kX64I16x8Splat: {
+ XMMRegister dst = i.OutputSimd128Register();
+ __ movd(dst, i.InputRegister(0));
+ __ pshuflw(dst, dst, 0x0);
+ __ pshufhw(dst, dst, 0x0);
+ __ pshufd(dst, dst, 0x0);
+ break;
+ }
+ case kX64I16x8ExtractLane: {
+ CpuFeatureScope sse_scope(masm(), SSE4_1);
+ Register dst = i.OutputRegister();
+ __ 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
+ __ pextrw(dst, i.InputSimd128Register(0), i.InputInt8(1));
+ __ movsxwl(i.OutputRegister(), i.OutputRegister());
bbudge 2017/04/17 17:34:06 nit: use dst here.
gdeepti 2017/04/17 17:46:22 Done.
+ break;
+ }
+ case kX64I16x8ReplaceLane: {
+ CpuFeatureScope sse_scope(masm(), SSE4_1);
+ if (instr->InputAt(2)->IsRegister()) {
+ __ pinsrw(i.OutputSimd128Register(), i.InputRegister(2),
+ i.InputInt8(1));
+ } else {
+ __ pinsrw(i.OutputSimd128Register(), i.InputOperand(2), i.InputInt8(1));
+ }
+ break;
+ }
+ case kX64I16x8Shl: {
+ __ psllw(i.OutputSimd128Register(), i.InputInt8(1));
+ break;
+ }
+ case kX64I16x8ShrS: {
+ __ psraw(i.OutputSimd128Register(), i.InputInt8(1));
+ break;
+ }
+ case kX64I16x8Add: {
+ __ paddw(i.OutputSimd128Register(), i.InputSimd128Register(1));
+ break;
+ }
+ case kX64I16x8AddSaturateS: {
+ __ paddsw(i.OutputSimd128Register(), i.InputSimd128Register(1));
+ break;
+ }
+ case kX64I16x8Sub: {
+ __ psubw(i.OutputSimd128Register(), i.InputSimd128Register(1));
+ break;
+ }
+ case kX64I16x8SubSaturateS: {
+ __ psubsw(i.OutputSimd128Register(), i.InputSimd128Register(1));
+ break;
+ }
+ case kX64I16x8Mul: {
+ CpuFeatureScope sse_scope(masm(), SSE4_1);
+ __ pmullw(i.OutputSimd128Register(), i.InputSimd128Register(1));
+ break;
+ }
+ case kX64I16x8MinS: {
+ CpuFeatureScope sse_scope(masm(), SSE4_1);
+ __ pminsw(i.OutputSimd128Register(), i.InputSimd128Register(1));
+ break;
+ }
+ case kX64I16x8MaxS: {
+ CpuFeatureScope sse_scope(masm(), SSE4_1);
+ __ pmaxsw(i.OutputSimd128Register(), i.InputSimd128Register(1));
+ break;
+ }
+ case kX64I16x8Eq: {
+ __ pcmpeqw(i.OutputSimd128Register(), i.InputSimd128Register(1));
+ break;
+ }
+ case kX64I16x8Ne: {
+ __ pcmpeqw(i.OutputSimd128Register(), i.InputSimd128Register(1));
+ __ pcmpeqw(kScratchDoubleReg, kScratchDoubleReg);
+ __ pxor(i.OutputSimd128Register(), kScratchDoubleReg);
+ break;
+ }
+ case kX64I16x8ShrU: {
+ __ psrlw(i.OutputSimd128Register(), i.InputInt8(1));
+ break;
+ }
+ case kX64I16x8AddSaturateU: {
+ __ paddusw(i.OutputSimd128Register(), i.InputSimd128Register(1));
+ break;
+ }
+ case kX64I16x8SubSaturateU: {
+ __ psubusw(i.OutputSimd128Register(), i.InputSimd128Register(1));
+ break;
+ }
+ case kX64I16x8MinU: {
+ CpuFeatureScope sse_scope(masm(), SSE4_1);
+ __ pminuw(i.OutputSimd128Register(), i.InputSimd128Register(1));
+ break;
+ }
+ case kX64I16x8MaxU: {
+ CpuFeatureScope sse_scope(masm(), SSE4_1);
+ __ pmaxuw(i.OutputSimd128Register(), i.InputSimd128Register(1));
+ break;
+ }
+ case kX64S128Select: {
// Mask used here is stored in dst.
XMMRegister dst = i.OutputSimd128Register();
__ movaps(kScratchDoubleReg, i.InputSimd128Register(1));

Powered by Google App Engine
This is Rietveld 408576698