Closed Bug 582785 Opened 14 years ago Closed 14 years ago

JM: Use SSE4.1 when available to load doubles faster

Categories

(Core :: JavaScript Engine, defect)

x86
Windows 7
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: dvander, Unassigned)

References

Details

Attachments

(1 file, 1 obsolete file)

+++ This bug was initially created as a clone of Bug #582152 +++

We've seen that loading doubles is very hot. We can do better on x86 when SSE4.1 is present.

From Moh:

On Penryn (SSE 4.1), we have other good instructions for this purpose.
More specifically, instead of the original sequence:

    mov [ebx + 0x80], eax
    mov [ebx + 0x84], ecx
    movsd xmm0, [ebx + 0x80]

a much better sequence is:
    movd   xmm0, eax 
    pinsrd xmm0, ecx, 1
Attached patch patch v1 (obsolete) (deleted) — Splinter Review
Introduces SSE4.1 checking and changes the assembler to use the movd and pinsrd instructions to load doubles.
Attachment #465526 - Flags: review?(dvander)
Attached patch patch v2 (deleted) — Splinter Review
moved s_sseCheckState out of an #ifdef
Attachment #465529 - Flags: review?(dvander)
Attachment #465526 - Attachment is obsolete: true
Attachment #465526 - Flags: review?(dvander)
Comment on attachment 465529 [details] [diff] [review]
patch v2

Nice work! Seems like math heavy pieces of SunSpider get 1-2% faster.
Attachment #465529 - Flags: review?(dvander) → review+
One nit: usage of pinsrd_rr() should assert that the SSE check resulted in 4.1.
OS: Mac OS X → Windows 7
http://hg.mozilla.org/projects/jaegermonkey/rev/a16f3ba4b87c
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: