[X86] Fix fptoui conversions
authorMichael Kuperstein <michael.m.kuperstein@intel.com>
Tue, 25 Aug 2015 07:42:09 +0000 (07:42 +0000)
committerMichael Kuperstein <michael.m.kuperstein@intel.com>
Tue, 25 Aug 2015 07:42:09 +0000 (07:42 +0000)
commitf48b1beeec4f20986130566f935721e0aec3acac
tree707128fa982c901e0ad6d44337d835b6269d8a7a
parent46ff6da86067575f805e745f5ac9f4d584f15b0a
[X86] Fix fptoui conversions

This fixes two issues in x86 fptoui lowering.
1) Makes conversions from f80 go through the right path on AVX-512.
2) Implements an inline sequence for fptoui i64 instead of a library
call. This improves performance by 6X on SSE3+ and 3X otherwise.
Incidentally, it also removes the use of ftol2 for fptoui, which was
wrong to begin with, as ftol2 converts to a signed i64, producing
wrong results for values >= 2^63.

Patch by: mitch.l.bodart@intel.com
Differential Revision: http://reviews.llvm.org/D11316

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245924 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/X86ISelLowering.cpp
lib/Target/X86/X86ISelLowering.h
test/CodeGen/X86/pr17631.ll
test/CodeGen/X86/scalar-fp-to-i64.ll [new file with mode: 0644]
test/CodeGen/X86/win_ftol2.ll