[compiler-rt][builtins] Skip building (b)float16 support on i386-freebsd
authorDimitry Andric <dimitry@andric.com>
Sun, 16 Oct 2022 18:24:42 +0000 (20:24 +0200)
committerDimitry Andric <dimitry@andric.com>
Sun, 22 Jan 2023 21:16:51 +0000 (22:16 +0100)
commit45368c75582f0bded1f06d5c82c1f2ee023fb186
tree39b65cc3e0f5d8a5a366e5cb0f4a9a8876156f20
parentcaa99a01f5dd2f865df318a2f93abc811273a25d
[compiler-rt][builtins] Skip building (b)float16 support on i386-freebsd

Since bfloat16 and float16 support is not available for i386-freebsd,
the `truncdfbf2.c` and `truncsfbf2.c` builtin sources should be skipped
when targeting that platform, and `COMPILER_RT_HAS_FLOAT16` should not
be defined.

However, the CMake configuration stage runs its tests with the default
target, which normally is amd64-freebsd, so it will detect both bfloat16
and float16 support.

Move adding of the `COMPILER_RT_HAS_FLOAT16` define to the `foreach()`
loop where all the supported architectures are handled, and do not
enable it when targeting i386-freebsd.

Also remove the bfloat16 sources from the `i386_SOURCES` list, when
targeting i386-freebsd.

Differential Revision: https://reviews.llvm.org/D136044
compiler-rt/lib/builtins/CMakeLists.txt