Commit f6291634 authored by Zhi An Ng's avatar Zhi An Ng Committed by Commit Bot

[wasm-simd][x64] Small optimization for i64x2.splat

Movddup can take a memory operand, so we can save a move from gp reg to
xmm reg in that case. No problem with unaligned memory since we are
loading 64 bits (not 128 bits).

Also drive-by comment on i32x4.splat, it uses pshufd, which can also take
a memory operand (saving a mov), but we need aligned memory for that
first.

Bug: v8:9198
Change-Id: I55969888db1debb6ed4d193f767589d0da598386
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2567538Reviewed-by: 's avatarBill Budge <bbudge@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71580}
parent 51abbb8d
......@@ -2719,10 +2719,10 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
XMMRegister dst = i.OutputSimd128Register();
if (HasRegisterInput(instr, 0)) {
__ Movq(dst, i.InputRegister(0));
__ Movddup(dst, dst);
} else {
__ Movq(dst, i.InputOperand(0));
__ Movddup(dst, i.InputOperand(0));
}
__ Movddup(dst, dst);
break;
}
case kX64I64x2ExtractLane: {
......@@ -2815,6 +2815,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
if (HasRegisterInput(instr, 0)) {
__ Movd(dst, i.InputRegister(0));
} else {
// TODO(v8:9198): Pshufd can load from aligned memory once supported.
__ Movd(dst, i.InputOperand(0));
}
__ Pshufd(dst, dst, uint8_t{0x0});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment