[TargetLowering] expandFP_TO_UINT - improve fp16 support
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Mon, 19 Nov 2018 19:16:13 +0000 (19:16 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Mon, 19 Nov 2018 19:16:13 +0000 (19:16 +0000)
commitde3605f56b3e781a0938d401f1093e4b9ed659f9
tree7dd2374973ffd62b0e2218fc712977c82c12c3c0
parentf28480321314674bbcf3481320d4d9920b1a9d62
[TargetLowering] expandFP_TO_UINT - improve fp16 support

As discussed on D53794, for float types with ranges smaller than the destination integer type, then we should be able to just use a regular FP_TO_SINT opcode.

I thought we'd need to provide MSA test cases for very small integer types as well (fp16 -> i8 etc.), but it turns out that promotion will kick in so they're unnecessary.

Differential Revision: https://reviews.llvm.org/D54703

llvm-svn: 347251
llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
llvm/test/CodeGen/Mips/msa/f16-llvm-ir.ll