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

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

Issue 2829483002: [wasm] Implement first set of SIMD I8x16 ops (Closed)
Patch Set: 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 6bcb085b90fc88c436e05da85076e169d704666b..f62f0ce9880a3afe8e6f143e07c69d25a76d0d43 100644
--- a/src/compiler/x64/code-generator-x64.cc
+++ b/src/compiler/x64/code-generator-x64.cc
@@ -2331,6 +2331,85 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
__ pmaxuw(i.OutputSimd128Register(), i.InputSimd128Register(1));
break;
}
+ case kX64I8x16Splat: {
+ CpuFeatureScope sse_scope(masm(), SSSE3);
+ XMMRegister dst = i.OutputSimd128Register();
+ __ movd(dst, i.InputRegister(0));
+ __ xorps(kScratchDoubleReg, kScratchDoubleReg);
+ __ pshufb(dst, kScratchDoubleReg);
+ break;
+ }
+ case kX64I8x16ExtractLane: {
+ CpuFeatureScope sse_scope(masm(), SSE4_1);
+ Register dst = i.OutputRegister();
+ __ pextrb(dst, i.InputSimd128Register(0), i.InputInt8(1));
+ __ movsxbl(dst, dst);
+ break;
+ }
+ case kX64I8x16ReplaceLane: {
+ CpuFeatureScope sse_scope(masm(), SSE4_1);
+ if (instr->InputAt(2)->IsRegister()) {
+ __ pinsrb(i.OutputSimd128Register(), i.InputRegister(2),
+ i.InputInt8(1));
+ } else {
+ __ pinsrb(i.OutputSimd128Register(), i.InputOperand(2), i.InputInt8(1));
+ }
+ break;
+ }
+ case kX64I8x16Add: {
+ __ paddb(i.OutputSimd128Register(), i.InputSimd128Register(1));
+ break;
+ }
+ case kX64I8x16AddSaturateS: {
+ __ paddsb(i.OutputSimd128Register(), i.InputSimd128Register(1));
+ break;
+ }
+ case kX64I8x16Sub: {
+ __ psubb(i.OutputSimd128Register(), i.InputSimd128Register(1));
+ break;
+ }
+ case kX64I8x16SubSaturateS: {
+ __ psubsb(i.OutputSimd128Register(), i.InputSimd128Register(1));
+ break;
+ }
+ case kX64I8x16MinS: {
+ CpuFeatureScope sse_scope(masm(), SSE4_1);
+ __ pminsb(i.OutputSimd128Register(), i.InputSimd128Register(1));
+ break;
+ }
+ case kX64I8x16MaxS: {
+ CpuFeatureScope sse_scope(masm(), SSE4_1);
+ __ pmaxsb(i.OutputSimd128Register(), i.InputSimd128Register(1));
+ break;
+ }
+ case kX64I8x16Eq: {
+ __ pcmpeqb(i.OutputSimd128Register(), i.InputSimd128Register(1));
+ break;
+ }
+ case kX64I8x16Ne: {
+ __ pcmpeqb(i.OutputSimd128Register(), i.InputSimd128Register(1));
+ __ pcmpeqb(kScratchDoubleReg, kScratchDoubleReg);
+ __ pxor(i.OutputSimd128Register(), kScratchDoubleReg);
+ break;
+ }
+ case kX64I8x16AddSaturateU: {
+ __ paddusb(i.OutputSimd128Register(), i.InputSimd128Register(1));
+ break;
+ }
+ case kX64I8x16SubSaturateU: {
+ __ psubusb(i.OutputSimd128Register(), i.InputSimd128Register(1));
+ break;
+ }
+ case kX64I8x16MinU: {
+ CpuFeatureScope sse_scope(masm(), SSE4_1);
+ __ pminub(i.OutputSimd128Register(), i.InputSimd128Register(1));
+ break;
+ }
+ case kX64I8x16MaxU: {
+ CpuFeatureScope sse_scope(masm(), SSE4_1);
+ __ pmaxub(i.OutputSimd128Register(), i.InputSimd128Register(1));
+ break;
+ }
case kX64S128Select: {
// Mask used here is stored in dst.
XMMRegister dst = i.OutputSimd128Register();
« 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