From 8241d51f7049d48912ce25fbd49ef4d22c58e340 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Sat, 1 Apr 2017 18:50:32 -0700 Subject: x86: Detect F16C with the Intel compiler too The .pro file requires the QMAKE_CFLAGS_F16C to be set to something. So set it to AVX, as the instructions require the VEX prefix anyway (ICC has no dedicated option for just F16C). Change-Id: I27b55fdf514247549455fffd14b171940afd35a2 Reviewed-by: Allan Sandfeld Jensen --- mkspecs/win32-icc/qmake.conf | 1 + 1 file changed, 1 insertion(+) (limited to 'mkspecs/win32-icc') diff --git a/mkspecs/win32-icc/qmake.conf b/mkspecs/win32-icc/qmake.conf index 6e2589b4c4..d73f7a03ef 100644 --- a/mkspecs/win32-icc/qmake.conf +++ b/mkspecs/win32-icc/qmake.conf @@ -33,6 +33,7 @@ QMAKE_CFLAGS_AVX512PF += -QxMIC-AVX512 QMAKE_CFLAGS_AVX512DQ += -QxCORE-AVX512 QMAKE_CFLAGS_AVX512BW += -QxCORE-AVX512 QMAKE_CFLAGS_AVX512VL += -QxCORE-AVX512 +QMAKE_CFLAGS_F16C = -QxAVX QMAKE_CXX = $$QMAKE_CC QMAKE_CXXFLAGS = $$QMAKE_CFLAGS /Zc:forScope -- cgit v1.2.3 From 280e321e52fd4e86545f3f0d4bd4e047786a897e Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Mon, 3 Apr 2017 16:05:18 -0700 Subject: Fix detection of F16C for the Intel compiler (again) and Visual Studio Neither the Intel compiler nor Visual C++ have a dedicated switch to enable F16C support, like GCC and Clang do. So we used the AVX switch for that in commit 8241d51f7049d48912ce25fbd49ef4d22c58e340, as it was the closest, lowest denominator. That was incorrect and insufficient. The Intel compiler silently miscompiles the intrinsics with -xAVX, making calls to out-of-line functions like _mm_cvtps_ph, which don't exist. So we actually have to use AVX2 support to generate correct code. That might be a problem later, since Ivy Bridge supports F16C but not AVX2. Visual C++ is able to generate F16C code with just -arch:AVX. Either way, since there's no dedicated command-line switch, there's also no dedicated preprocessor macro. We're using __AVX2__ for both compilers, as that's a sufficient condition to indicate a processor that supports F16C. Change-Id: I27b55fdf514247549455fffd14b205b8d8b86da7 Reviewed-by: Allan Sandfeld Jensen --- mkspecs/win32-icc/qmake.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mkspecs/win32-icc') diff --git a/mkspecs/win32-icc/qmake.conf b/mkspecs/win32-icc/qmake.conf index d73f7a03ef..ab0be95543 100644 --- a/mkspecs/win32-icc/qmake.conf +++ b/mkspecs/win32-icc/qmake.conf @@ -33,7 +33,7 @@ QMAKE_CFLAGS_AVX512PF += -QxMIC-AVX512 QMAKE_CFLAGS_AVX512DQ += -QxCORE-AVX512 QMAKE_CFLAGS_AVX512BW += -QxCORE-AVX512 QMAKE_CFLAGS_AVX512VL += -QxCORE-AVX512 -QMAKE_CFLAGS_F16C = -QxAVX +QMAKE_CFLAGS_F16C = $$QMAKE_CFLAGS_AVX2 QMAKE_CXX = $$QMAKE_CC QMAKE_CXXFLAGS = $$QMAKE_CFLAGS /Zc:forScope -- cgit v1.2.3