Closed Bug 915833 Opened 12 years ago Closed 12 years ago

Use immediate absolute addresses on x64 when possible

Categories

(Core :: JavaScript Engine, enhancement)

x86_64
All
enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla26

People

(Reporter: sunfish, Assigned: sunfish)

Details

Attachments

(4 files)

On x64, code sequences like this are common: [Codegen] movl $0x2e6c300, %r11d [Codegen] cmpl $0x0, 0x0(%r11) [Codegen] je ((1655)) Since 64-bit addresses can't fit into 32-bit immediate fields in general, codegen just always materializes them into a register. However, it's pretty common for these absolute addresses to actually reside within the virtual address space addressable by the 32-bit immediate value. When it does, such code can be written like this: [Codegen] cmpq $0x0, 0x2e6c300 [Codegen] jae ((1655)) The following patch sequence implements this, and harmonizes the x86 and x64 backends somewhat.
Attachment #803916 - Flags: review?(sstangl)
Attachment #803918 - Flags: review?(sstangl)
Attachment #803920 - Flags: review?(sstangl)
Attachment #803921 - Flags: review?(sstangl)
Attachment #803918 - Flags: review?(sstangl) → review+
Attachment #803920 - Flags: review?(sstangl) → review+
Comment on attachment 803921 [details] [diff] [review] operand-x64-immediate-address.patch Review of attachment 803921 [details] [diff] [review]: ----------------------------------------------------------------- Cool. ::: js/src/jit/x64/Assembler-x64.h @@ +175,5 @@ > REG, > MEM_REG_DISP, > FPREG, > + MEM_SCALE, > + MEM_ADDRESS Would MEM_ADDRESS32 be a better name?
Attachment #803921 - Flags: review?(sstangl) → review+
Comment on attachment 803916 [details] [diff] [review] operand-renames.patch Review of attachment 803916 [details] [diff] [review]: ----------------------------------------------------------------- Sounds fine, no strong opinion on naming either way.
Attachment #803916 - Flags: review?(sstangl) → review+
(In reply to Sean Stangl [:sstangl] from comment #5) > @@ +175,5 @@ > > REG, > > MEM_REG_DISP, > > FPREG, > > + MEM_SCALE, > > + MEM_ADDRESS > > Would MEM_ADDRESS32 be a better name? Works for me. https://hg.mozilla.org/integration/mozilla-inbound/rev/217c7cffc581 https://hg.mozilla.org/integration/mozilla-inbound/rev/3bc4938ad49a https://hg.mozilla.org/integration/mozilla-inbound/rev/9fac05846d6e https://hg.mozilla.org/integration/mozilla-inbound/rev/339c713fcaef
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: