Closed Bug 1132920 Opened 9 years ago Closed 9 years ago

SIMD x86: use SSE3 movddup / AVX vmovddup for shuffle pattern (0, 1, 0, 1)

Categories

(Core :: JavaScript Engine: JIT, defect)

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla39
Tracking Status
firefox39 --- fixed

People

(Reporter: bbouvier, Assigned: bbouvier)

Details

Attachments

(1 file)

movddup, aka Move One Double-FP and Duplicate, corresponds to the shuffle pattern (1, 2, 1, 2), so we could probably optimize it in the JITs.
Flags: needinfo?(benj)
Oops, the shuffle pattern is actually (0, 1, 0, 1), and it's already optimized with vmovlhps, which is SSE2, hence more spread.  My bad.  (Perhaps it could be useful for the float64x2 shuffle pattern (0, 0), though)
Status: NEW → RESOLVED
Closed: 9 years ago
Flags: needinfo?(benj)
Resolution: --- → INVALID
movddup wouldn't require a the inputCopy, so it would actually be slightly nicer, at least on pre-AVX machines (or AVX machines too, until we re-enable AVX (bug 1124751)).
Flags: needinfo?(benj)
Status: RESOLVED → REOPENED
Flags: needinfo?(benj)
Resolution: INVALID → ---
Summary: SIMD x86: use SSE3 movddup / AVX vmovddup for shuffle pattern (1, 2, 1, 2) → SIMD x86: use SSE3 movddup / AVX vmovddup for shuffle pattern (0, 1, 0, 1)
Attached patch movddup.patchSplinter Review
The use of twoByteOpSimdFlags is unfortunate, because it doesn't seem to relate to flags in any ways, but that seems to be the one variant that fits. Should I rename it, or add a comment that contrarily to the name, it doesn't affect flags?
Assignee: nobody → benj
Status: REOPENED → ASSIGNED
Attachment #8571973 - Flags: review?(sunfish)
Comment on attachment 8571973 [details] [diff] [review]
movddup.patch

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

The way this kind of encoding is handled elsewhere is to use the regular twoByteOpSimd and pass invalid_xmm as the src0. However, if you want to rename twoByteOpSimdFlags and use that instead, I'm cool with that too. But do rename it if you do :-).
Attachment #8571973 - Flags: review?(sunfish) → review+
I've slightly changed the condition, so that we emit movddup if we have SSE3 but not AVX, to follow the remark in comment 2.

https://hg.mozilla.org/integration/mozilla-inbound/rev/73bddae4f266
https://hg.mozilla.org/mozilla-central/rev/73bddae4f266
Status: ASSIGNED → RESOLVED
Closed: 9 years ago9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla39
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: