[PATCH] D92242: [compiler-rt] [builtins] Support conversion between fp16 and fp128

Adhemerval Zanella via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 27 11:47:57 PST 2020


zatrazz created this revision.
zatrazz added reviewers: ostannard, bryanpkc, atrosinenko, MaskRay.
Herald added subscribers: Sanitizers, kristof.beyls, mgorny, dberris.
Herald added a project: Sanitizers.
zatrazz requested review of this revision.

This patch adds both extendhftf2 and trunctfhf2 to support
conversion between half-precision and quad-precision floating-point
values. They are built iff the compiler supports _Float16.

Some notes on ARM plaforms: while fp16 is supported on all
architectures, _Float16 is supported only for 32-bit ARM, 64-bit ARM,
and SPIR (as indicated by clang/docs/LanguageExtensions.rst). Also,
fp16 is a storage format and 64-bit ARM supports floating-point
convert precision to half as base armv8-a instruction.

This patch does not change the ABI for 32-bit ARM, it will continue
to pass _Float16 as uint16.

This re-enabled revert done by https://reviews.llvm.org/rGb534beabeed3ba1777cd0ff9ce552d077e496726


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D92242

Files:
  compiler-rt/lib/builtins/CMakeLists.txt
  compiler-rt/lib/builtins/extendhftf2.c
  compiler-rt/lib/builtins/trunctfhf2.c
  compiler-rt/test/builtins/Unit/extendhftf2_test.c
  compiler-rt/test/builtins/Unit/trunctfhf2_test.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D92242.308098.patch
Type: text/x-patch
Size: 9179 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201127/d8485ff8/attachment.bin>


More information about the llvm-commits mailing list