LegalizeDAG: make sure cast is unsigned before using FP_TO_UINT.
authorTim Northover <tnorthover@apple.com>
Sun, 15 Jun 2014 09:27:20 +0000 (09:27 +0000)
committerTim Northover <tnorthover@apple.com>
Sun, 15 Jun 2014 09:27:20 +0000 (09:27 +0000)
commit40ed1d89b19856777b2072ab8a0ae89d54b2e440
treecbcee58ce76a9972c569a0e763a4aea1af98a4c9
parent8bfc50e4a976476425e8f2ba7e71d7d14b48b474
LegalizeDAG: make sure cast is unsigned before using FP_TO_UINT.

It's valid to use FP_TO_SINT when asking for a smaller type (e.g. all
"unsigned int16" values fit into a "signed int32"), but the reverse
isn't true.

Unfortunately, I'm not actually aware of any architecture with
asymmetric FP_TO_SINT and FP_TO_UINT handling and the logic happens to
work in the symmetric case, so I can't actually write a test for this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210986 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/SelectionDAG/LegalizeDAG.cpp