[PATCH] D109421: [SDAG] Add intrinsic to convert between ppc_fp128 and fp128

Qiu Chaofan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 8 00:54:44 PDT 2021


qiucf created this revision.
Herald added subscribers: dexonsmith, shchenz, hiraditya, nemanjai.
qiucf requested review of this revision.
Herald added subscribers: llvm-commits, jdoerfert.
Herald added a project: LLVM.

`ppc_fp128` and `fp128` are both 128-bit floating point types. However, we can't do conversion between them now. (trunc/ext are not allowed for same-size fp types)

This patch adds two new intrinsics: `llvm.convert.to.ppcf128` and `llvm.convert.from.ppcf128`, to support such conversion.

Actually the structure can be applied to all fp types besides `fp128`, but we already have trunc/round/ext stuff for fp types with different sizes.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D109421

Files:
  llvm/include/llvm/CodeGen/ISDOpcodes.h
  llvm/include/llvm/IR/Intrinsics.td
  llvm/include/llvm/IR/RuntimeLibcalls.def
  llvm/include/llvm/Target/TargetSelectionDAG.td
  llvm/lib/Analysis/ConstantFolding.cpp
  llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp
  llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.h
  llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
  llvm/lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp
  llvm/lib/IR/Function.cpp
  llvm/test/CodeGen/PowerPC/f128-truncateNconv.ll
  llvm/utils/TableGen/IntrinsicEmitter.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D109421.371269.patch
Type: text/x-patch
Size: 14000 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210908/f0392de4/attachment.bin>


More information about the llvm-commits mailing list