Closed Bug 1594204 Opened 5 months ago Closed 5 months ago

Add basic inline code path for memory.copy and memory.fill

Categories

(Core :: Javascript: WebAssembly, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
mozilla72
Tracking Status
firefox72 --- fixed

People

(Reporter: rhunt, Assigned: rhunt)

References

(Blocks 1 open bug)

Details

Attachments

(2 files)

Bug 1591047 improved the performance of our OOL path for memory.copy and memory.fill. This bug will track adding a basic inline code path.

This path may not use SIMD as it looks like it may be easiest to use only GPR's to start with.

Patch with baseline/ion inlines paths for memory.copy (with constant length) and memory.fill (with constant length and value) [1]. It uses up to 64bit registers, but no SIMD.

[1] https://treeherder.mozilla.org/#/jobs?repo=try&revision=6d9326058070ea27921b26837ad9c2b8516e10e0

This commit adds an inline code path for memory.copy/fill for Ion and Baseline
for all platforms. To keep things simple, I reused the plain wasm load/store
codegen with integer types up to 64bits. A future commit can add SIMD support
as needed.

A copy with constant length is reduced to a series of loads (from low-to-high)
onto the value stack (for baseline), or onto a stack of definitions (for ion).
Then a series of stores are emitted (from high-to-low) from the value stack or
temp definition stack.

A fill with constant length and value is reduced to a series of stores (from
high-to-low). The stores use the widest transfer width as possible, and the
value is splatted as appropriate to fill the whole integer.

Depends on D50380

Attachment #9107109 - Attachment description: Bug 1594204 - Split out 'emitMemCopy' function for dedicated optimizations. → Bug 1594204 - Split out 'emitMemCopy' function for dedicated optimizations. r?lth
Attachment #9107110 - Attachment description: Bug 1594204 - Generate inline code for memory.copy and memory.fill. → Bug 1594204 - Generate inline code for memory.copy and memory.fill. r?lth
Attachment #9107109 - Attachment description: Bug 1594204 - Split out 'emitMemCopy' function for dedicated optimizations. r?lth → Bug 1594204 - Split out 'emitMemCopy' function for dedicated optimizations. r=lth
Attachment #9107110 - Attachment description: Bug 1594204 - Generate inline code for memory.copy and memory.fill. r?lth → Bug 1594204 - Generate inline code for memory.copy and memory.fill. r=lth
Pushed by rhunt@eqrion.net:
https://hg.mozilla.org/integration/autoland/rev/36d41bbf2f46
Split out 'emitMemCopy' function for dedicated optimizations. r=lth
https://hg.mozilla.org/integration/autoland/rev/b0545db75058
Generate inline code for memory.copy and memory.fill. r=lth

I need to stop skimping on try runs. Missed no-jit compile error from not adding an entry to MacroAssembler-none.

Flags: needinfo?(rhunt)
Pushed by rhunt@eqrion.net:
https://hg.mozilla.org/integration/autoland/rev/6295568b6ea4
Split out 'emitMemCopy' function for dedicated optimizations. r=lth
https://hg.mozilla.org/integration/autoland/rev/74cc3a413cb0
Generate inline code for memory.copy and memory.fill. r=lth
Pushed by rhunt@eqrion.net:
https://hg.mozilla.org/integration/autoland/rev/26c65691696b
Split out 'emitMemCopy' function for dedicated optimizations. r=lth
https://hg.mozilla.org/integration/autoland/rev/c06659c20d41
Generate inline code for memory.copy and memory.fill. r=lth
Status: NEW → RESOLVED
Closed: 5 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla72
Blocks: 1597790
You need to log in before you can comment on or make changes to this bug.