-
Ng Zhi An authored
On AVX, many instructions can have 3 operands, unlike SSE which only has 2. So on SSE we use DefineSameAsFirst on the dst. But on AVX, using that will cause some unnecessary moves. This patch changes a couple of F32x4 and S128 instructions to remove this restriction when AVX is supported. We can't use AvxHelper since it duplicates the dst for the call to the AVX instruction, which isn't what we want. The alternative is to redefine Mulps and other functions here, but there are other callsites that depend on this duplicated-dst behavior, so it's harder to change. We can migrate this as we move more logic over to non-DefineSameAsFirst for AVX. With the meshopt_decoder.js in the linked bug, it removes 8 SIMD movs (from a function that has 300+ lines of assembly.) Note that from agner's microarchitecture.pdf, page 127, "Elimination of move instructions", many times such moves can be eliminated by the processor. So this change won't speed up perf, but it helps a bit with binary size, and decoder pressure. Bug: v8:10116,v8:9561 Change-Id: I125bfd44e728ef08312620bc00f6433f376e69e3 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2465653Reviewed-by: Bill Budge <bbudge@chromium.org> Commit-Queue: Zhi An Ng <zhin@chromium.org> Cr-Commit-Position: refs/heads/master@{#70462}
813ae013