[all-commits] [llvm/llvm-project] ce6d40: [compiler-rt] [builtins] Detect _Float16 support a...

Dimitry Andric via All-commits all-commits at lists.llvm.org
Fri Jul 29 11:59:26 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ce6d40f5c23923a807388c58b82b4c343eced0ce
      https://github.com/llvm/llvm-project/commit/ce6d40f5c23923a807388c58b82b4c343eced0ce
  Author: Dimitry Andric <dimitry at andric.com>
  Date:   2022-07-29 (Fri, 29 Jul 2022)

  Changed paths:
    M compiler-rt/cmake/builtin-config-ix.cmake
    M compiler-rt/lib/builtins/CMakeLists.txt
    M compiler-rt/lib/builtins/extendhftf2.c
    M compiler-rt/lib/builtins/fp_extend.h
    M compiler-rt/lib/builtins/fp_trunc.h
    M compiler-rt/lib/builtins/int_types.h
    M compiler-rt/lib/builtins/trunctfhf2.c
    M compiler-rt/test/builtins/CMakeLists.txt
    M compiler-rt/test/builtins/Unit/extendhftf2_test.c
    M compiler-rt/test/builtins/Unit/fp_test.h
    M compiler-rt/test/builtins/Unit/trunctfhf2_test.c

  Log Message:
  -----------
  [compiler-rt] [builtins] Detect _Float16 support at compile time

Instead of detecting `_Float16` support at CMake configuration time,
detect it at compile time by checking for the predefined (by the
compiler) macro `__FLT16_MAX__` instead.

This solves the issue where compiler-rt is built simultaneously for both
x86_64 and i386 targets, and the CMake configuration uses x86_64
compilation to detect `_Float16` support, while it may not be supported
by the i386 target (if it does not have SSE2).

While here, rename `COMPILERT_RT_HAS_FLOAT16` to `CRT_HAS_FLOAT16`, to
conform more to the naming style used in `int_lib.h` and `int_types.h`.

Reviewed By: MaskRay

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




More information about the All-commits mailing list