[compiler] Emit vpbroadcastb for I8x16Splat on x64 if supported

Change-Id: Iec90b4821f41838eb4c2bae26035af4e30082ef9
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2762140
Reviewed-by: Zhi An Ng <zhin@chromium.org>
Commit-Queue: Frank Emrich <emrich@google.com>
Cr-Commit-Position: refs/heads/master@{#73428}
This commit is contained in:
Frank Emrich 2021-03-15 23:47:31 +01:00 committed by Commit Bot
parent 93c2406502
commit 96217d357f

View File

@ -3352,6 +3352,16 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
}
case kX64I8x16Splat: {
XMMRegister dst = i.OutputSimd128Register();
if (CpuFeatures::IsSupported(AVX2)) {
CpuFeatureScope avx_scope(tasm(), AVX);
CpuFeatureScope avx2_scope(tasm(), AVX2);
if (HasRegisterInput(instr, 0)) {
__ vmovd(kScratchDoubleReg, i.InputRegister(0));
__ vpbroadcastb(dst, kScratchDoubleReg);
} else {
__ vpbroadcastb(dst, i.InputOperand(0));
}
} else {
if (HasRegisterInput(instr, 0)) {
__ Movd(dst, i.InputRegister(0));
} else {
@ -3359,6 +3369,8 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
}
__ Xorps(kScratchDoubleReg, kScratchDoubleReg);
__ Pshufb(dst, kScratchDoubleReg);
}
break;
}
case kX64Pextrb: {