use _Float16 only when SSE2 is enabled
authorDmitry Shachnev <mitya57@debian.org>
Sun, 2 Feb 2025 12:00:45 +0000 (13:00 +0100)
committerSandro Knauß <hefee@debian.org>
Sun, 2 Feb 2025 12:00:45 +0000 (13:00 +0100)
commitc3083a913c3926e5a82932a2f86305e6356a5f92
tree3e6b10a18abf2af2103615772d7c8437f4f6048b
parent250ed50de9f68088c9b75d4a09301f55915e6afa
use _Float16 only when SSE2 is enabled

Forwarded: https://codereview.qt-project.org/c/qt/qtbase/+/579205
Last-Update: 2024-08-01

The GCC documentation [1] says: “On x86 targets with SSE2 enabled, GCC
supports half-precision (16-bit) floating point via the _Float16 type”.

On non-SSE2 x86 (such as Debian i386 baseline [2]), __FLT16_MAX__ is
defined starting with GCC 14 [3], however any non-trivial use of the
_Float16 type results in an error:

error: operation not permitted on type ‘_Float16’ without option ‘-msse2’

which makes some packages fail to build on i386 architecture [4].

[1]: https://gcc.gnu.org/onlinedocs/gcc/Half-Precision.html
[2]: https://wiki.debian.org/ArchitectureSpecificsMemo#i386-1
[3]: https://gcc.gnu.org/g:9a19fa8b616f83474c35cc5b34a3865073ced829
[4]: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1076986

Gbp-Pq: Name use_float16_only_with_sse2.patch
src/corelib/global/qtypes.h