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

RESOLVED WONTFIX

Status

RESOLVED WONTFIX
8 years ago
2 days ago

People

(Reporter: stejohns, Unassigned)

Tracking

unspecified
x86_64
All
Bug Flags:
flashplayer-qrb +

Details

(Reporter)

Description

8 years ago
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.)

Comment 1

8 years ago
how is FISTTP different from CVTSD2SI?
(Reporter)

Comment 2

8 years ago
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.)

Comment 3

8 years ago
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.

Comment 4

8 years ago
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.

Comment 5

8 years ago
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?

Updated

7 years ago
Flags: flashplayer-qrb+

Updated

7 years ago
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
Last Resolved: 2 days 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.