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

Unified Diff: src/compiler/x64/code-generator-x64.cc

Issue 2767983002: [wasm] Implement wasm x64 I16x8 Ops (Closed)
Patch Set: Bill's review 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
« no previous file with comments | « src/compiler/instruction-selector.cc ('k') | src/compiler/x64/instruction-codes-x64.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..6bcb085b90fc88c436e05da85076e169d704666b 100644
--- a/src/compiler/x64/code-generator-x64.cc
+++ b/src/compiler/x64/code-generator-x64.cc
@@ -2235,7 +2235,103 @@ 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();
+ __ pextrw(dst, i.InputSimd128Register(0), i.InputInt8(1));
+ __ movsxwl(dst, dst);
+ 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));
« no previous file with comments | « src/compiler/instruction-selector.cc ('k') | src/compiler/x64/instruction-codes-x64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698