Open
Bug 1442534
Opened 6 years ago
Updated 1 year ago
ARM64: Improve code generation for atomics by avoiding fences
Categories
(Core :: JavaScript: WebAssembly, enhancement, P3)
Tracking
()
NEW
People
(Reporter: lth, Unassigned)
References
(Blocks 1 open bug)
Details
(Whiteboard: [arm64:m3])
Currently we generate an ARM-like fence + op + fence instruction sequence for ARM64 seq_cst atomics; this is safe, but we can do better. Specifically, the canonical reference [1] has optimized sequences that avoid fences by using only the acquire and release operations, even for seq_cst operation. [1] http://www.cl.cam.ac.uk/~pes20/cpp/cpp0xmappings.html
Reporter | ||
Updated•6 years ago
|
Priority: -- → P3
Updated•6 years ago
|
Whiteboard: [arm64:m3]
Reporter | ||
Comment 1•5 years ago
|
||
The optimized atomics are now about to become legal following an update to the memory model: https://github.com/tc39/ecma262/pull/1511. The executive summary is that the old memory model disallowed the use of release-acquire atomic ops for seq_cst operation in JS; the new model is slightly weaker and allows them, and the change is motivated by the desire to allow them on ARM64. (Apparently Chrome already uses weaker atomics here.)
Reporter | ||
Comment 2•3 years ago
|
||
ARMv8.1 has CAS primitives, which will help.
Also see https://github.com/WebAssembly/threads/blob/master/papers/oopsla2019.pdf for up-to-date guidance.
Reporter | ||
Updated•3 years ago
|
Component: JavaScript Engine: JIT → Javascript: WebAssembly
Reporter | ||
Comment 3•2 years ago
|
||
Note that if we update the JIT here we must also update the generated JS atomic operations, see jit/GenerateAtomicOperations.py.
Updated•2 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•