HomePhabricator

[X86] When handling i64->f32 sint_to_fp on 32-bit targets only bitcast to f64…

Authored by craig.topper on Jan 15 2020, 6:07 PM.

Description

[X86] When handling i64->f32 sint_to_fp on 32-bit targets only bitcast to f64 if sse2 is enabled.

The code is trying to copy the i64 value to an xmm register to
use a 64-bit store so that the 64-bit fild can benefit from
store forwarding.

But this trick only works if f64 is going to be stored in an
XMM register. If we only have SSE1 then only float is in xmm
register. So this trick just causes 2 stores i32 stores, an f64
load into the x87, an f64 from x87, and a 64-bit fild. So we end
up with an extra stack temporary and still didn't get store forwarding.

We might be able to use v2f32 here instead, but I didn't check. I
just wanted the code to make sense.

Found by inspection as I continue to stare too hard at our
int_to_fp conversions.

Details

Committed
craig.topperJan 15 2020, 6:26 PM
Parents
rGbff9f84dc85b: [X86] Add 32-bit mode sse1 command line to scalar-int-to-fp.ll. NFC
Branches
Unknown
Tags
Unknown