[PATCH] D89786: [PowerPC] Avoid unnecessary fadd for unsigned to ppcf128
Qiu Chaofan via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 20 03:24:07 PDT 2020
qiucf created this revision.
Herald added subscribers: llvm-commits, steven.zhang, shchenz, kbarton, hiraditya, nemanjai.
Herald added a project: LLVM.
qiucf requested review of this revision.
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.
Another point about this: is it safe to change `fadd ppc_fp128` to `fadd double` to eliminate libcall? Not all i64 integers are fully representable in double. So for those numbers in ppcf128 (lower part is not all-zero), can we only do addition for both higher parts?
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D89786
Files:
llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp
llvm/test/CodeGen/PowerPC/ppcf128-constrained-fp-intrinsics.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D89786.299320.patch
Type: text/x-patch
Size: 4577 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201020/a6254efd/attachment.bin>
More information about the llvm-commits
mailing list