Closed
Bug 1070985
Opened 10 years ago
Closed 10 years ago
IonMonkey x64: add some move instructions with a constant address operand, and fix the formatters to emit REX prefixes.
Categories
(Core :: JavaScript Engine: JIT, defect)
Tracking
()
RESOLVED
FIXED
mozilla35
People
(Reporter: dougc, Assigned: dougc)
Details
Attachments
(1 file, 1 obsolete file)
The x64 supports an immediate 32 bit constant in the addressing mode. There is already some support for move instructions with 32 bit constant operand addresses but these are only enabled on the x86 and the formatters for these did not set the REX prefix. I would at least like to see the formatters fixed as I use these instructions in some experimental code and don't want other developers to waste time tracking down the subtle bugs that occur when the REX prefixes are not emitted - bugs show up under register pressure.
Assignee | ||
Comment 1•10 years ago
|
||
Assignee | ||
Comment 2•10 years ago
|
||
Comment on attachment 8493071 [details] [diff] [review] Add some move instructions with a constant address operand, and fix the formatters to emit REX prefixes. This patch enables a number of instruction for the x64 that were only compiled for the x86. These are all supported on the x64, but perhaps were disabled because they had not immediate use. When enabled for the x64 there were problems in the formatters due to missing REX prefixes. I would at least like to get the REX prefixes fixed, but am open to not enabling the unused instructions for the x64 in which case I'll split the patch? I use the enabled instruction in some experimental code.
Attachment #8493071 -
Flags: review?(nicolas.b.pierron)
Comment 3•10 years ago
|
||
Comment on attachment 8493071 [details] [diff] [review] Add some move instructions with a constant address operand, and fix the formatters to emit REX prefixes. Review of attachment 8493071 [details] [diff] [review]: ----------------------------------------------------------------- ::: js/src/jit/shared/BaseAssembler-x86-shared.h @@ +4388,5 @@ > +#ifdef JS_CODEGEN_X86 > + MOZ_ASSERT(!byteRegRequiresRex(reg)); > +#endif > + m_buffer.ensureSpace(maxInstructionSize); > + emitRexIf(byteRegRequiresRex(reg), reg, 0, 0); nit: Use emitRexIfNeeded, and move the above assertion into emitRexIfNeeded, as well as doing it for all registers.
Attachment #8493071 -
Flags: review?(nicolas.b.pierron) → review+
Assignee | ||
Comment 4•10 years ago
|
||
(In reply to Nicolas B. Pierron [:nbp] from comment #3) > Comment on attachment 8493071 [details] [diff] [review] > Add some move instructions with a constant address operand, and fix the > formatters to emit REX prefixes. > > Review of attachment 8493071 [details] [diff] [review]: > ----------------------------------------------------------------- > > ::: js/src/jit/shared/BaseAssembler-x86-shared.h > @@ +4388,5 @@ > > +#ifdef JS_CODEGEN_X86 > > + MOZ_ASSERT(!byteRegRequiresRex(reg)); > > +#endif > > + m_buffer.ensureSpace(maxInstructionSize); > > + emitRexIf(byteRegRequiresRex(reg), reg, 0, 0); > > nit: Use emitRexIfNeeded, and move the above assertion into emitRexIfNeeded, > as well as doing it for all registers. Thank you for the quick review. emitRexIfNeeded is used for word sized operands. In this case the 'reg' is a byte sized operand so it needs to use byteRegRequiresRex, see the comments for emitRexIf. It's because there are ah, and al, etc for byte sized operands, but only eax or rax for large sized operands. Thus the above code looks correct as-is, and can it be left as-is?
Flags: needinfo?(nicolas.b.pierron)
Comment 5•10 years ago
|
||
(In reply to Douglas Crosher [:dougc] from comment #4) > (In reply to Nicolas B. Pierron [:nbp] from comment #3) > > Comment on attachment 8493071 [details] [diff] [review] > > Add some move instructions with a constant address operand, and fix the > > formatters to emit REX prefixes. > > > > Review of attachment 8493071 [details] [diff] [review]: > > ----------------------------------------------------------------- > > > > ::: js/src/jit/shared/BaseAssembler-x86-shared.h > > @@ +4388,5 @@ > > > +#ifdef JS_CODEGEN_X86 > > > + MOZ_ASSERT(!byteRegRequiresRex(reg)); > > > +#endif > > > + m_buffer.ensureSpace(maxInstructionSize); > > > + emitRexIf(byteRegRequiresRex(reg), reg, 0, 0); > > > > nit: Use emitRexIfNeeded, and move the above assertion into emitRexIfNeeded, > > as well as doing it for all registers. > > Thank you for the quick review. emitRexIfNeeded is used for word sized > operands. In this case the 'reg' is a byte sized operand so it needs to use > byteRegRequiresRex, see the comments for emitRexIf. It's because there are > ah, and al, etc for byte sized operands, but only eax or rax for large sized > operands. Thus the above code looks correct as-is, and can it be left as-is? Indeed, I guess I confused byteRegRequiresRex with regRequiresRex. So, yes .
Flags: needinfo?(nicolas.b.pierron)
Assignee | ||
Comment 6•10 years ago
|
||
Rebase. Carrying forward r+.
Attachment #8493071 -
Attachment is obsolete: true
Attachment #8496872 -
Flags: review+
Assignee | ||
Comment 7•10 years ago
|
||
https://tbpl.mozilla.org/?tree=Try&rev=36958a0afb77
Assignee | ||
Updated•10 years ago
|
Keywords: checkin-needed
Comment 8•10 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/6f6b6ba01341
Keywords: checkin-needed
Comment 9•10 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/6f6b6ba01341
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla35
You need to log in
before you can comment on or make changes to this bug.
Description
•