Open
Bug 1077036
Opened 10 years ago
Updated 2 years ago
x86 atomics: Generate better code for byte-sized atomic operations (32-bit only)
Categories
(Core :: JavaScript Engine: JIT, defect, P5)
Tracking
()
NEW
People
(Reporter: lth, Unassigned)
References
(Blocks 1 open bug)
Details
Followup work on bug 979594. Currently the code generator constrains the register allocator quite a lot in several ways when it implements atomic operations on byte arrays: - it requires the use of specific registers that have byte parts (ebx, ecx) - it requires the use of a full register with a byte part in situations where it could work around that and pick any full register Also it does not conserve registers as well as it could: - it does not allow use of the "high" registers (ah, bh) - it does not allow the use of immediate values when it would sometimes be possible to do so
Reporter | ||
Updated•10 years ago
|
Reporter | ||
Comment 1•10 years ago
|
||
These optimization opportunities (modulo immediate value) apply to 32-bit only, see bug 1138348 for the 64-bit case.
Hardware: x86_64 → x86
Summary: x86 atomics: Generate better code for byte-sized atomic operations → x86 atomics: Generate better code for byte-sized atomic operations (32-bit only)
Reporter | ||
Comment 2•10 years ago
|
||
I also think that in the case of a properly in-range immediate argument the final movzbl / movsbl in the atomic binops with a result (AND, OR, NOT) can be avoided provided that the initial load performs the proper zero/sign extension. That would be true also for 16-bit operations and also for x64.
Reporter | ||
Comment 3•9 years ago
|
||
Observe also that in the case of Atomics.sub() we sometimes end up with movl src, eax neg eax lock xadd al, ... movsbl al, eax and it seems that if the initial mov is necessary then it would be desirable to combine it with the neg, I'm sensing there may be some LEA solution.
Reporter | ||
Updated•8 years ago
|
Priority: -- → P5
Reporter | ||
Updated•8 years ago
|
Assignee: lhansen → nobody
Reporter | ||
Updated•8 years ago
|
No longer blocks: shared-array-buffer
Updated•2 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•