[X86] Improve for v2i32->v2f64 uint_to_fp
authorCraig Topper <craig.topper@intel.com>
Fri, 3 Jan 2020 18:56:09 +0000 (10:56 -0800)
committerCraig Topper <craig.topper@intel.com>
Fri, 3 Jan 2020 19:39:08 +0000 (11:39 -0800)
commit2875cc6b290cef6ec355a896f1d03ddfaa05e1f4
tree3e634600aab8fef4009261cd448db596c3c97f54
parentcf48101200ee192dd82e6ed0512ae42e7b3162a9
[X86] Improve for v2i32->v2f64 uint_to_fp

This uses an alternative implementation of this conversion derived
from our v2i32->v2f32 handling. We can zero extend the v2i32 to
v2i64, or it with the bit representation of 2.0^52 which will give
us 2.0^52 plus the 32-bit integer since double's mantissa is 52 bits.
Then we just need to subtract 2.0^52 as a double and let the floating
point unit normalize the remaining bits into a valid double.

This is less instructions then our previous code, but does require
a port 5 shuffle for the zero extend or unpack.

Differential Revision: https://reviews.llvm.org/D71945
llvm/lib/Target/X86/X86ISelLowering.cpp
llvm/test/CodeGen/X86/vec-strict-inttofp-128.ll
llvm/test/CodeGen/X86/vec_int_to_fp.ll
llvm/test/CodeGen/X86/vector-constrained-fp-intrinsics.ll