From f3640d908633b0e512077f24c41eca851879f0ed Mon Sep 17 00:00:00 2001 From: Mario Emmenlauer Date: Mon, 7 Mar 2022 14:48:32 +0100 Subject: [PATCH] Fix for ClangCl missing F16C intrinsics in qfloat16.h Done-with: Thiago Macieira Fixes: QTBUG-101175 Change-Id: I46ef5c473f174e54a8cffffd16e5334d3b5944b8 Reviewed-by: Allan Sandfeld Jensen --- src/corelib/global/qfloat16.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/corelib/global/qfloat16.h b/src/corelib/global/qfloat16.h index d9fd89215d3..eef5a6152a3 100644 --- a/src/corelib/global/qfloat16.h +++ b/src/corelib/global/qfloat16.h @@ -48,12 +48,13 @@ #include #if defined(QT_COMPILER_SUPPORTS_F16C) && defined(__AVX2__) && !defined(__F16C__) -// All processors that support AVX2 do support F16C too. That doesn't mean -// we're allowed to use the intrinsics directly, so we'll do it only for -// the Intel and Microsoft's compilers. -# if defined(Q_CC_INTEL) || defined(Q_CC_MSVC) +// All processors that support AVX2 do support F16C too, so we could enable the +// feature unconditionally if __AVX2__ is defined. However, all currently +// supported compilers except Microsoft's are able to define __F16C__ on their +// own when the user enables the feature, so we'll trust them. +# if defined(Q_CC_MSVC) && !defined(Q_CC_CLANG) # define __F16C__ 1 -# endif +# endif #endif #if defined(QT_COMPILER_SUPPORTS_F16C) && defined(__F16C__)