[wasm-simd] Optmize F64x2ReplaceLane when lane == 0

Use movsd/vmovsd instead of pblendw/vpblendw. It is two bytes shorter,
and avoids mixing integer and floating-point domain instructions.

Bug: v8:12074
Change-Id: Ia41072fbf8da7d99618a55d59634f7399a7105ce
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3088358
Reviewed-by: Deepti Gandluri <gdeepti@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#76287}
This commit is contained in:
Ng Zhi An 2021-08-12 10:43:40 -07:00 committed by V8 LUCI CQ
parent ebdc98824f
commit 8798c2380d

View File

@ -112,7 +112,7 @@ void SharedTurboAssembler::F64x2ReplaceLane(XMMRegister dst, XMMRegister src,
if (CpuFeatures::IsSupported(AVX)) {
CpuFeatureScope scope(this, AVX);
if (lane == 0) {
vpblendw(dst, src, rep, 0b00001111);
vmovsd(dst, src, rep);
} else {
vmovlhps(dst, src, rep);
}
@ -123,7 +123,7 @@ void SharedTurboAssembler::F64x2ReplaceLane(XMMRegister dst, XMMRegister src,
movaps(dst, src);
}
if (lane == 0) {
pblendw(dst, rep, 0b00001111);
movsd(dst, rep);
} else {
movlhps(dst, rep);
}