[X86] Add custom type legalization and lowering for scalar STRICT_FP_TO_SINT/UINT
authorCraig Topper <craig.topper@intel.com>
Tue, 19 Nov 2019 23:51:19 +0000 (15:51 -0800)
committerCraig Topper <craig.topper@intel.com>
Wed, 20 Nov 2019 00:05:22 +0000 (16:05 -0800)
commit85589f8077a229a6fbc7c245ae28bec06b88c5fb
tree97fbb8bce948b509390f86824c3fbc955f46a82c
parent72fac0663a3305e66be4c63d1089ea8a85270c9b
[X86] Add custom type legalization and lowering for scalar STRICT_FP_TO_SINT/UINT

This is a first pass at Custom lowering for these operations. I also updated some of the vector code where it was obviously easy and straightforward. More work needed in follow up.

This enables these operations to be handled with X87 where special rounding control adjustments are needed to perform a truncate.

Still need to fix Promotion in the target independent code in LegalizeDAG.
llrint/llround split into separate test file because we can't make a strict libcall properly yet either and we need to do that when i64 isn't a legal type.

This does not include any isel support. So we still rely on the mutation in SelectionDAGIsel to remove the strict from this stuff later. Except for the X87 stuff which goes through custom nodes that already had chains.

Differential Revision: https://reviews.llvm.org/D70214
llvm/lib/Target/X86/X86ISelLowering.cpp
llvm/lib/Target/X86/X86ISelLowering.h
llvm/test/CodeGen/X86/fp-intrinsics.ll
llvm/test/CodeGen/X86/vector-constrained-fp-intrinsics.ll