[PATCH] D149573: [Clang][C++23] Implement core language changes from P1467R9 extended floating-point types and standard names and introduce Bfloat16 arithmetic type.

M. Zeeshan Siddiqui via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Apr 30 23:41:54 PDT 2023


codemzs created this revision.
codemzs added reviewers: erichkeane, tahonermann, asmith.
Herald added subscribers: steakhal, kosarev, mattd, gchakrabarti, asavonic, carlosgalvezp, kerbowa, arphaman, jvesely.
Herald added a reviewer: NoQ.
Herald added a reviewer: njames93.
Herald added a project: All.
codemzs requested review of this revision.
Herald added subscribers: cfe-commits, jholewinski.
Herald added a project: clang-tools-extra.

This commit implements Core language changes based on P1467R9 Extended floating-point types and standard names and also introduces Bfloat16 arithmetic type for internal representation (not token kind). The implementation is restricted to C++23 and supports Bfloat16 arithmetic type only when the hardware natively supports bfloat16 operations. The two extended floating types introduced are Float16 (aka _Float16) and Bfloat16 (aka decltype (0.0bf16)). Future work can extend this to support other floating-point types such as Float32, Float64, and Float128, as well as targets without native bfloat16 arithmetic operations support. The change assumes bfloat16 Itanium mangling is 'DF16b' but guards it with an experimental flag since the mangling is still being finalized (see https://github.com/itanium-cxx-abi/cxx-abi/pull/147).

RFC: https://discourse.llvm.org/t/rfc-c-23-p1467r9-extended-floating-point-types-and-standard-names/70033


https://reviews.llvm.org/D149573

Files:
  clang-tools-extra/clang-tidy/modernize/LoopConvertCheck.cpp
  clang-tools-extra/clang-tidy/readability/SuspiciousCallArgumentCheck.cpp
  clang/include/clang/AST/ASTContext.h
  clang/include/clang/AST/BuiltinTypes.def
  clang/include/clang/AST/Type.h
  clang/include/clang/Basic/DiagnosticSemaKinds.td
  clang/include/clang/Basic/LangOptions.def
  clang/include/clang/Basic/TargetInfo.h
  clang/include/clang/Driver/Options.td
  clang/include/clang/Lex/LiteralSupport.h
  clang/include/clang/Serialization/ASTBitCodes.h
  clang/include/clang/StaticAnalyzer/Core/PathSensitive/SMTConv.h
  clang/lib/AST/ASTContext.cpp
  clang/lib/AST/Interp/ByteCodeExprGen.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/Targets/AArch64.h
  clang/lib/Basic/Targets/AMDGPU.h
  clang/lib/Basic/Targets/ARM.h
  clang/lib/Basic/Targets/NVPTX.h
  clang/lib/Basic/Targets/X86.h
  clang/lib/CodeGen/CGDebugInfo.cpp
  clang/lib/CodeGen/CGExpr.cpp
  clang/lib/CodeGen/CGExprScalar.cpp
  clang/lib/CodeGen/CodeGenTypes.cpp
  clang/lib/CodeGen/ItaniumCXXABI.cpp
  clang/lib/Frontend/InitPreprocessor.cpp
  clang/lib/Index/USRGeneration.cpp
  clang/lib/Lex/LiteralSupport.cpp
  clang/lib/Sema/Sema.cpp
  clang/lib/Sema/SemaCast.cpp
  clang/lib/Sema/SemaChecking.cpp
  clang/lib/Sema/SemaExpr.cpp
  clang/lib/Sema/SemaExprCXX.cpp
  clang/lib/Sema/SemaObjCProperty.cpp
  clang/lib/Sema/SemaOpenMP.cpp
  clang/lib/Sema/SemaOverload.cpp
  clang/lib/Serialization/ASTCommon.cpp
  clang/lib/Serialization/ASTReader.cpp
  clang/test/CodeGenCXX/cxx2b-fp-ext-std-names-p1467r9.cpp
  clang/test/Sema/cxx2b-fp-ext-std-names-p1467r9.cpp
  libcxxabi/test/test_demangle.pass.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D149573.518405.patch
Type: text/x-patch
Size: 109644 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230501/ad57ff57/attachment-0001.bin>


More information about the cfe-commits mailing list