[all-commits] [llvm/llvm-project] e62175: [Clang][BFloat16] Upgrade __bf16 to arithmetic typ...

M. Zeeshan Siddiqui via All-commits all-commits at lists.llvm.org
Fri May 26 22:34:05 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: e62175736551abf40a3410bc246f58e650eb8158
      https://github.com/llvm/llvm-project/commit/e62175736551abf40a3410bc246f58e650eb8158
  Author: M. Zeeshan Siddiqui <mzs at microsoft.com>
  Date:   2023-05-27 (Sat, 27 May 2023)

  Changed paths:
    M clang/docs/LanguageExtensions.rst
    M clang/include/clang/Basic/DiagnosticSemaKinds.td
    M clang/include/clang/Basic/FPOptions.def
    M clang/include/clang/Basic/LangOptions.def
    M clang/include/clang/Basic/TargetInfo.h
    M clang/include/clang/Driver/Options.td
    M clang/lib/AST/Type.cpp
    M clang/lib/Basic/TargetInfo.cpp
    M clang/lib/Basic/Targets/AMDGPU.h
    M clang/lib/Basic/Targets/ARM.cpp
    M clang/lib/Basic/Targets/NVPTX.h
    M clang/lib/Basic/Targets/X86.cpp
    M clang/lib/Basic/Targets/X86.h
    M clang/lib/CodeGen/CGExprScalar.cpp
    M clang/lib/Driver/ToolChains/Clang.cpp
    M clang/lib/Sema/SemaCast.cpp
    M clang/lib/Sema/SemaExpr.cpp
    M clang/lib/Sema/SemaOverload.cpp
    M clang/test/CodeGen/X86/avx512bf16-error.c
    M clang/test/CodeGen/X86/bfloat-mangle.cpp
    A clang/test/CodeGen/X86/bfloat16.cpp
    A clang/test/CodeGen/X86/fexcess-precision-bfloat16.c
    M clang/test/CodeGenCUDA/amdgpu-bf16.cu
    M clang/test/CodeGenCUDA/bf16.cu
    M clang/test/Driver/fexcess-precision.c
    R clang/test/Sema/arm-bf16-forbidden-ops.c
    R clang/test/Sema/arm-bf16-forbidden-ops.cpp
    M clang/test/Sema/arm-bfloat.cpp
    M clang/test/SemaCUDA/amdgpu-bf16.cu
    M clang/test/SemaCUDA/bf16.cu

  Log Message:
  -----------
  [Clang][BFloat16] Upgrade __bf16 to arithmetic type, change mangling, and extend excess precision support

Pursuant to discussions at
https://discourse.llvm.org/t/rfc-c-23-p1467r9-extended-floating-point-types-and-standard-names/70033/22,
this commit enhances the handling of the __bf16 type in Clang.
- Firstly, it upgrades __bf16 from a storage-only type to an arithmetic
  type.
- Secondly, it changes the mangling of __bf16 to DF16b on all
  architectures except ARM. This change has been made in
  accordance with the finalization of the mangling for the
  std::bfloat16_t type, as discussed at
  https://github.com/itanium-cxx-abi/cxx-abi/pull/147.
- Finally, this commit extends the existing excess precision support to
  the __bf16 type. This applies to hardware architectures that do not
  natively support bfloat16 arithmetic.
Appropriate tests have been added to verify the effects of these
changes and ensure no regressions in other areas of the compiler.

Reviewed By: rjmccall, pengfei, zahiraam

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




More information about the All-commits mailing list