[CostModel][X86] fptosi/fptoui to i8/i16 are truncated from fptosi to i32
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Tue, 6 Jul 2021 16:27:46 +0000 (17:27 +0100)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Tue, 6 Jul 2021 16:28:03 +0000 (17:28 +0100)
commitb298308ba2544a00c3e2ae0c1cc06fa058a4000c
tree660d56c4a85badedb73750d5200894b760d02e30
parentf1cbea3e527547fc08c55235c11970a8d9f2637e
[CostModel][X86] fptosi/fptoui to i8/i16 are truncated from fptosi to i32

Provide a generic fallback that performs the fptosi to i32 types, then truncates to sub-i32 scalars.

These numbers can be tweaked for specific sse levels, but we should get the default handling in place first.
llvm/lib/Target/X86/X86TargetTransformInfo.cpp
llvm/test/Analysis/CostModel/X86/fptosi.ll
llvm/test/Analysis/CostModel/X86/fptoui.ll