[Interest] Wrong compiler caps check or missing /arch:avx?

Thiago Macieira thiago.macieira at intel.com
Mon Jan 21 17:50:02 CET 2019

On Monday, 21 January 2019 08:18:16 PST Olivier B. wrote:
> It seems that code of the cpp that is compiled "if defined
> QT_COMPILER_SUPPORTS_SSE4_1" (present in my qconfig.h) references code
> of qdrawingprimitive_sse2_p.h that is defined "if
> QT_COMPILER_SUPPORTS_HERE(SSE4_1)" (absent because __SSE_4_1__ is not
> defined in qsimd_p.h, because configure does not add /arch:avx on the
> command line)

That's an incorrect conclusion. The correct branch of qsimd_p.h for MSVC 2015 
is this:

#  define QT_COMPILER_SUPPORTS_HERE(x)    ((__ ## x ## __) || 

The second condition of that macro is QT_COMPILER_SUPPORTS_SSE4_1 again.

> I did not pass any cpu-specific type flags to configure, and i am not
> sure i want to. What is the proper fix of the cpu checks and flags
> that will make this build, without making the code dependant on avx or
> SSE4.1?

MSVC 2015 compiles out of the box and this code is enabled. Your problem is 

Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center

More information about the Interest mailing list