Closed Bug 1624258 Opened 4 years ago Closed 3 years ago

Add testing mode to force avx encoding

Categories

(Core :: JavaScript Engine: JIT, task, P3)

x86_64
All
task

Tracking

()

RESOLVED WONTFIX

People

(Reporter: lth, Unassigned)

References

(Blocks 1 open bug)

Details

We use a run-time switch to determine whether to emit old-timey SSE encodings or new-fangled AVX encodings, see the useLegacySSEEncoding*() predicates in BaseAssembler-x86-shared.h.

In some (probably many) cases we use the predicate useLegacySSEEncoding(), which chooses the SSE encodings if they are possible, even if AVX encodings are available. There may be a code size benefit to doing so. The SSE encodings are possible when the first src register equals the destination register, which is basically always for the wasm baseline compiler, since for simplicity the compiler maintains that invariant in order to be compatible with non-AVX systems.

As a consequence, we are basically not testing our AVX encodings at all. It would be helpful to have a shell testing flag to force the decision to go the other way when possible, so that we can do a --test-also run with this flag.

(This is not a huge problem - not only are we not testing the avx encodings, but we are also not using them in production. But it's good to test what we can test, to avoid surprises later.)

Ironically this matters even less than I thought, as AVX is disabled by default in the engine, is only enabled in the shell with --enable-avx, and is never enabled in the browser. So far as I can tell, no test cases in the tree pass --enable-avx either.

Chatted with Benjamin about this. At the time the code was written, only a small portion of our user base appeared to have AVX, and there were also issues with AVX sometimes being slower because the AVX unit on the chip might be switched off to save power and there would be significant latency in turning it on. Benjamin said Dan would know more.

No longer blocks: 1478632
Blocks: wasm-simd
See Also: → 1648697

There is no AVX support at present, reopen when we start thinking about it again.

Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.