Lower SIMD compares so as to respect predicates available in hardware
Categories
(Core :: JavaScript: WebAssembly, enhancement, P3)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox84 | --- | fixed |
People
(Reporter: lth, Assigned: lth)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
For float compares (compareFloat32x4 and compareFloat32x4 masm abstractions) the architecture has =, <, <=, and != but not > or >=. Currently we swap operands in masm to synthesize the missing operators, and that looks clean, but in vcmpps() in Assembler-x86-shared.h there are additional hacks to move operands around and use temp regs for this if some conditions hold (and I expect they commonly do), it's all pretty ugly. By swapping operations during lowering (at the latest), we can perhaps avoid this.
For int compares, we have = and > and we can synthesize the others by swapping operands and/or negating the result. Swapping the operands in masm is not always clean and lowering should do a better job setting things up for good code generation.
Closely related to bug 1640662.
| Assignee | ||
Updated•5 years ago
|
| Assignee | ||
Updated•5 years ago
|
| Assignee | ||
Comment 1•5 years ago
|
||
Swap operands and/or change the operation of SIMD compares during
lowering to generate better code. Introduce test cases for the
generated code.
The tests are a little brittle, but how else would we test this? And
if the register allocator can't be counted on not to insert spurious
moves when presented with an optimal scenario, what can it be counted
on to do?
Drive-by fixes: Clean up some comments, and remove a small masm
abstraction that did not pay for itself.
Comment 3•5 years ago
|
||
Backed out 13 changesets (bug 1641595, bug 1671998, bug 1672770, bug 1641641, bug 1672697, bug 1672911, bug 1671996, bug 1671907, bug 1640662) for causing sm failures in splat-x64-ion-codegen.js
Backout link: https://hg.mozilla.org/integration/autoland/rev/c2c595aa8fe1dc18803bf80df3bca7ca07443038
Failure log: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=319728899&repo=autoland&lineNumber=44748
Comment 5•5 years ago
|
||
| bugherder | ||
Description
•