[all-commits] [llvm/llvm-project] fae0df: [Clang] Add __ibm128 type to represent ppc_fp128

Qiu Chaofan via All-commits all-commits at lists.llvm.org
Mon Sep 6 03:02:16 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: fae0dfa6421ea6c02f86ba7292fa782e1e2b69d1
      https://github.com/llvm/llvm-project/commit/fae0dfa6421ea6c02f86ba7292fa782e1e2b69d1
  Author: Qiu Chaofan <qiucofan at cn.ibm.com>
  Date:   2021-09-06 (Mon, 06 Sep 2021)

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

  Log Message:
  -----------
  [Clang] Add __ibm128 type to represent ppc_fp128

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 commit, which can be done in
future ones:

- Literal suffix for __ibm128 type. w/W is suitable as GCC documented.
- __attribute__((mode(IF))) should be for __ibm128.
- Complex __ibm128 type.

Reviewed By: rjmccall

Differential Revision: https://reviews.llvm.org/D93377




More information about the All-commits mailing list