[PATCH] D71945: [X86] Potential improvement for v2i32->v2f64 uint_to_fp

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 27 12:37:40 PST 2019


craig.topper created this revision.
craig.topper added reviewers: spatel, RKSimon.
Herald added a subscriber: hiraditya.
Herald added a project: LLVM.

This patch proposes an alternate implementation for 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.


https://reviews.llvm.org/D71945

Files:
  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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D71945.235442.patch
Type: text/x-patch
Size: 23494 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191227/8d6e86ac/attachment.bin>


More information about the llvm-commits mailing list