[PATCH] D93377: [Clang] Add __ibm128 type to represent ppc_fp128

Qiu Chaofan via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 15 23:54:42 PST 2020


qiucf created this revision.
qiucf added reviewers: nemanjai, rjmccall, rsmith, hubert.reinterpretcast, akyrtzi, PowerPC.
Herald added subscribers: dexonsmith, steven.zhang, shchenz, arphaman, kbarton.
qiucf requested review of this revision.
Herald added a reviewer: jdoerfert.
Herald added subscribers: cfe-commits, sstefan1.
Herald added a project: clang.

Currently, we have no front-end type for `ppc_fp128` type in IR. PowerPC target generates `ppc_fp128` type from `long double` now, but there's option (`-mabi=(ieee|ibm)longdouble`) to control it and we're going to do transition from IBM extended double-double `ppc_fp128` to IEEE `fp128` in the future.

This patch adds type `__ibm128` which always represents `ppc_fp128` in IR, as what GCC did for that type. Without this type in Clang, compilation will fail if compiling against future version of libstdcxx (which uses `__ibm128` in headers).

Although all operations in backend for `__ibm128` is done by software, only PowerPC enables support for it.

There's something not implemented in this patch and can be done in future ones:

1. Literal suffix for `__ibm128` type. `w/W` is suitable as GCC documented (https://gcc.gnu.org/onlinedocs/gcc/Floating-Types.html) but I believe they haven't implemented it yet.
2. `__attribute__((mode(IF)))` should be for `__ibm128`.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D93377

Files:
  clang/bindings/python/clang/cindex.py
  clang/include/clang-c/Index.h
  clang/include/clang/AST/ASTContext.h
  clang/include/clang/AST/BuiltinTypes.def
  clang/include/clang/AST/Type.h
  clang/include/clang/AST/TypeLoc.h
  clang/include/clang/Basic/Specifiers.h
  clang/include/clang/Basic/TargetInfo.h
  clang/include/clang/Basic/TokenKinds.def
  clang/include/clang/Sema/DeclSpec.h
  clang/include/clang/Serialization/ASTBitCodes.h
  clang/lib/AST/ASTContext.cpp
  clang/lib/AST/ItaniumMangle.cpp
  clang/lib/AST/MicrosoftMangle.cpp
  clang/lib/AST/NSAPI.cpp
  clang/lib/AST/PrintfFormatString.cpp
  clang/lib/AST/StmtPrinter.cpp
  clang/lib/AST/Type.cpp
  clang/lib/AST/TypeLoc.cpp
  clang/lib/Basic/TargetInfo.cpp
  clang/lib/Basic/Targets/PPC.h
  clang/lib/CodeGen/CGDebugInfo.cpp
  clang/lib/CodeGen/CGExprScalar.cpp
  clang/lib/CodeGen/CodeGenTypes.cpp
  clang/lib/CodeGen/ItaniumCXXABI.cpp
  clang/lib/CodeGen/TargetInfo.cpp
  clang/lib/Format/FormatToken.cpp
  clang/lib/Parse/ParseDecl.cpp
  clang/lib/Parse/ParseExpr.cpp
  clang/lib/Parse/ParseExprCXX.cpp
  clang/lib/Parse/ParseTentative.cpp
  clang/lib/Sema/DeclSpec.cpp
  clang/lib/Sema/SemaDecl.cpp
  clang/lib/Sema/SemaExpr.cpp
  clang/lib/Sema/SemaOverload.cpp
  clang/lib/Sema/SemaTemplateVariadic.cpp
  clang/lib/Sema/SemaType.cpp
  clang/lib/Serialization/ASTCommon.cpp
  clang/lib/Serialization/ASTReader.cpp
  clang/test/CodeGenCXX/ibm128-declarations.cpp
  clang/test/Sema/128bitfloat.cpp
  clang/tools/libclang/CXType.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D93377.312129.patch
Type: text/x-patch
Size: 36117 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20201216/6688d759/attachment-0001.bin>


More information about the cfe-commits mailing list