Commit d58ef12c authored by Ng Zhi An's avatar Ng Zhi An Committed by V8 LUCI CQ

[wasm-simd] Optimize S16x8Dup and S8x16Dup

Use punpcklqdq/punpckhqdq instead of pshufd.

Bug: v8:12075
Change-Id: I0260136d3727fde7bae4359df015d2b0090e8b29
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3092554Reviewed-by: 's avatarDeepti Gandluri <gdeepti@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#76272}
parent a3b2c4ec
......@@ -3539,10 +3539,10 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
uint8_t half_dup = lane4 | (lane4 << 2) | (lane4 << 4) | (lane4 << 6);
if (lane < 4) {
__ Pshuflw(dst, src, half_dup);
__ Pshufd(dst, dst, uint8_t{0});
__ Punpcklqdq(dst, dst);
} else {
__ Pshufhw(dst, src, half_dup);
__ Pshufd(dst, dst, uint8_t{0xaa});
__ Punpckhqdq(dst, dst);
}
break;
}
......@@ -3570,10 +3570,10 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
uint8_t half_dup = lane4 | (lane4 << 2) | (lane4 << 4) | (lane4 << 6);
if (lane < 4) {
__ Pshuflw(dst, dst, half_dup);
__ Pshufd(dst, dst, uint8_t{0});
__ Punpcklqdq(dst, dst);
} else {
__ Pshufhw(dst, dst, half_dup);
__ Pshufd(dst, dst, uint8_t{0xaa});
__ Punpckhqdq(dst, dst);
}
break;
}
......
......@@ -3903,10 +3903,10 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
uint8_t half_dup = lane4 | (lane4 << 2) | (lane4 << 4) | (lane4 << 6);
if (lane < 4) {
ASSEMBLE_SIMD_IMM_INSTR(Pshuflw, dst, 0, half_dup);
__ Pshufd(dst, dst, uint8_t{0});
__ Punpcklqdq(dst, dst);
} else {
ASSEMBLE_SIMD_IMM_INSTR(Pshufhw, dst, 0, half_dup);
__ Pshufd(dst, dst, uint8_t{0xaa});
__ Punpckhqdq(dst, dst);
}
break;
}
......@@ -3924,10 +3924,10 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
uint8_t half_dup = lane4 | (lane4 << 2) | (lane4 << 4) | (lane4 << 6);
if (lane < 4) {
__ Pshuflw(dst, dst, half_dup);
__ Pshufd(dst, dst, uint8_t{0});
__ Punpcklqdq(dst, dst);
} else {
__ Pshufhw(dst, dst, half_dup);
__ Pshufd(dst, dst, uint8_t{0xaa});
__ Punpckhqdq(dst, dst);
}
break;
}
......
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