[PowerPC] Avoid unnecessary fadd for unsigned to ppcf128
authorQiu Chaofan <qiucofan@cn.ibm.com>
Sun, 1 Nov 2020 15:22:47 +0000 (23:22 +0800)
committerQiu Chaofan <qiucofan@cn.ibm.com>
Sun, 1 Nov 2020 15:22:47 +0000 (23:22 +0800)
commit1f852ba8534cc773c114165e77acba411ac25a93
treea48449538a910f01148f170705fd95659ab12f00
parentba447f38f6e53e5de68fa264797690b74cb750c0
[PowerPC] Avoid unnecessary fadd for unsigned to ppcf128

Unsigned 32-bit or shorter integer to ppcf128 conversion are currently
expanded as signed-to-double with an extra fadd to 'complement'. But on
PowerPC we have native instruction to directly convert unsigned to
double since ISA v2.06. This patch exploits it.

Reviewed By: efriedma

Differential Revision: https://reviews.llvm.org/D89786
llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp
llvm/test/CodeGen/PowerPC/ppcf128-constrained-fp-intrinsics.ll
llvm/test/CodeGen/PowerPC/uint-to-ppcfp128-crash.ll