Closed Bug 1131289 Opened 9 years ago Closed 9 years ago

SpiderMonkey: Use the vmovq encoding for vmovq

Categories

(Core :: JavaScript Engine: JIT, enhancement)

x86
All
enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla38
Tracking Status
firefox38 --- fixed

People

(Reporter: sunfish, Assigned: sunfish)

Details

Attachments

(1 file)

Attached patch vmovq.patchSplinter Review
Confusingly enough, it turns out that there are two different kinds of instructions which go by the name "movq" on x86/x64 -- real movq, and movd with a REX prefix modifying it to be 64-bit. While some of their variants differ, their xmm-to-memory and memory-to-xmm forms are semantically interchangeable, with the only exception being that movd-with-REX doesn't work on 32-bit x86, due to needing a REX prefix.

SpiderMonkey currently uses the movd-with-REX encoding of movq for implementing the movq_rm and movq_mr which operate on XMM registers. This works, but it's desirable to be able to use these operations on 32-bit x86 too, and the REX prefix also makes the instructions one byte longer.

The attached patch implements these movq operations via the movq encoding, updates them to use twoByteOpSimd so that they use VEX encodings, enables them on 32-bit x86, and updates a few places in the CodeGenerator to make use of them.
Attachment #8561671 - Flags: review?(benj)
Comment on attachment 8561671 [details] [diff] [review]
vmovq.patch

Review of attachment 8561671 [details] [diff] [review]:
-----------------------------------------------------------------

Nice, thanks for doing this.  Can we now add the verifyHeapAccessDisassembly checks in codegen for SIMD loads/stores as well?
Attachment #8561671 - Flags: review?(benj) → review+
I've added verifyHeapAccessDisassembly checks to in my upcoming updated patch for bug 986981.

https://hg.mozilla.org/integration/mozilla-inbound/rev/017859925cf3
https://hg.mozilla.org/mozilla-central/rev/017859925cf3
Assignee: nobody → sunfish
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla38
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: