[PATCH] D64662: [FPEnv] [PowerPC] Lower ppc_fp128 StrictFP Nodes to libcalls

Andrew J Wock via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 12 13:01:53 PDT 2019


ajwock created this revision.
ajwock added reviewers: kpn, hfinkel, kbarton, andrew.w.kaylor, cameron.mcinally.
ajwock added a project: LLVM.
Herald added subscribers: llvm-commits, jsji, MaskRay, nemanjai.

ppc_libcalls

This change allows strictfp nodes with the type ppc_fp128 to be lowered to libcalls in the same manner that regular ppc_fp128 opcodes are.  Unlike regular opcodes, whose expansions chain to the entry node and typically leave a dangling chain, these libcalls use the chain input of the original strictfp node and their chain outputs are used by the users of the original node.

A couple of opcodes are not lowered to libcalls- STRICT_FP_ROUND and STRICT_FP_EXTEND.  Since the ppc_fp128 type is an f64 pair, truncation or extension from/to the ppc_fp128 type requires disposing one of the doubles or pairing with a new one.  The code behind these also parallels normal opcodes, with a little chain finangling.

One caveat to this change is that hardware looping in the IR optimization stage does not know to expect these expansions yet, particularly when checking to see if the intrinsic will clobber the CTR register.  I have a fix for this locally to be added later.


Repository:
  rL LLVM

https://reviews.llvm.org/D64662

Files:
  include/llvm/CodeGen/TargetLowering.h
  lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp
  lib/CodeGen/SelectionDAG/LegalizeTypes.cpp
  lib/CodeGen/SelectionDAG/LegalizeTypes.h
  lib/CodeGen/SelectionDAG/TargetLowering.cpp
  test/CodeGen/PowerPC/ppcf128-constrained-fp-instrinsics.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D64662.209570.patch
Type: text/x-patch
Size: 105759 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190712/455626eb/attachment-0001.bin>


More information about the llvm-commits mailing list