[PATCH] D131172: [clang][llvm][doc] Add more information for the ABI change in FP16

Phoebe Wang via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 4 07:31:16 PDT 2022

pengfei created this revision.
pengfei added reviewers: kparzysz, thieta, abdulras, tstellar.
Herald added a project: All.
pengfei requested review of this revision.
Herald added projects: clang, LLVM.
Herald added subscribers: llvm-commits, cfe-commits.

  rG LLVM Github Monorepo



Index: llvm/docs/ReleaseNotes.rst
--- llvm/docs/ReleaseNotes.rst
+++ llvm/docs/ReleaseNotes.rst
@@ -186,9 +186,25 @@
 Changes to the X86 Backend
-* Support ``half`` type on SSE2 and above targets.
+* Support ``half`` type on SSE2 and above targets following X86 psABI.
 * Support ``rdpru`` instruction on Zen2 and above targets.
+During this release, ``half`` type has an ABI breaking change to provide the
+support for the ABI of ``_Float16`` type on SSE2 and above following X86 psABI.
+(`D107082 <https://reviews.llvm.org/D107082>`_)
+The change may affect the current use of ``half`` includes (but is not limited
+* Frontends generating ``half`` type in function passing and/or returning
+* Downstream runtimes providing any ``half`` conversion builtins assuming the
+old ABI.
+* Projects built with LLVM 15.0 but using early versions of compiler-rt.
+When you find failures with ``half`` type, check the calling conversion of the
+code and switch it to the new ABI.
 Changes to the OCaml bindings
Index: clang/docs/ReleaseNotes.rst
--- clang/docs/ReleaseNotes.rst
+++ clang/docs/ReleaseNotes.rst
@@ -619,6 +619,19 @@
   will be used by Linux kernel mitigations for RETBLEED. The corresponding flag
   ``-mfunction-return=keep`` may be appended to disable the feature.
+The ``_Float16`` type requires SSE2 feature and above due to the instruction
+limitations. When using it on i386 targets, you need to specify ``-msse2``
+For targets without F16C feature or above, please make sure:
+- Use GCC 12.0 and above if you are using libgcc.
+- If you are using compiler-rt, use the same version with the compiler.
+Early versions provided FP16 builtins in a different ABI. A workaround is to use
+a small code snippet to check the ABI if you cannot make sure of it.
+- If you are using downstream runtimes that provide FP16 conversions, update
+them with the new ABI.
 DWARF Support in Clang

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D131172.449980.patch
Type: text/x-patch
Size: 2165 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220804/869cf0d8/attachment.bin>

More information about the cfe-commits mailing list