Open Bug 1413513 Opened 7 years ago Updated 2 years ago

Baldr: Optimize wasm alignment check

Categories

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

enhancement

Tracking

()

People

(Reporter: lth, Unassigned)

References

(Blocks 2 open bugs)

Details

The atomic ops introduce an alignment check that is not terribly expensive but could be optimized in various ways. In bug 1377576 comment 39 Benjamin speculates that foldsTo() techniques used in bug 1410429 comment 10 et seq could be brought to bear.
Component: JavaScript Engine: JIT → Javascript: Web Assembly
Type: defect → enhancement

This'll become more interesting if the emerging wasm SIMD spec sticks with aligned-only accesses.

Depends on: 1590305
Blocks: 1590305
No longer depends on: 1590305
Summary: Optimize wasm alignment check → Baldr: Optimize wasm alignment check
Blocks: wasm-simd

The situation for SIMD is that unaligned accesses are allowed. We can use unaligned-friendly instructions for access, however without an alignment guarantee we can't fuse a load with an operation on the loaded data on x86/x64, leading to higher register pressure than necessary as a temp is needed for the load. (Such fusing additionally requires that there's no bounds check and that there's only one use of the loaded data, but for typical streaming operations such as matrix multiply on x64 those are both true.)

Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.