Closed Bug 589247 Opened 14 years ago Closed 6 years ago

Use the SSE3 FISTTP instruction for float->int conversion where possible

Categories

(Tamarin Graveyard :: Virtual Machine, defect)

x86_64
All
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: stejohns, Unassigned)

Details

We currently don't use any SSE3 instructions, but this one allows for truncation conversion of float->int without having to change the control word. (SSE3 is present on most recent x86-32 systems, and all x86-64.)
how is FISTTP different from CVTSD2SI?
You're right, it probably isn't -- it's probably provided solely for better x87 interop, which we rarely use. (This was a note I jotted down while tracking down an unrelated bug.)
jagermonkey is using SSE4.1 instructions that let you access 32-bit values in places in xmm registers, to compose and decompose 64-bit fatvals.
Perhaps it could be used for immediate double->int truncation when calling a function that returns a double in x86? The return value is on the floating point stack (unless we come up with a custom calling convention) and FISSTP could be immediately used to convert it to an integer. This would be better than a x87 to SSE transition just for CVTSD2SI.
the two places to look are the LIR_d2i instruction and the doubleToInt32_sse function. Maybe it makes sense to inline the doubleToInt32_sse2 function if we can do it without branching and without breaking the results we want for rounding / infinity / nan?
Flags: flashplayer-qrb+
Summary: We should use the SSE3 FISTTP instruction for float->int conversion where possible → Use the SSE3 FISTTP instruction for float->int conversion where possible
Tamarin is a dead project now. Mass WONTFIX.
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → WONTFIX
Tamarin isn't maintained anymore. WONTFIX remaining bugs.
You need to log in before you can comment on or make changes to this bug.