Fix the confusion caused by the QT_ALWAYS_HAVE_xxx macros
authorThiago Macieira <thiago.macieira@intel.com>
Wed, 30 May 2012 12:43:06 +0000 (14:43 +0200)
committerQt by Nokia <qt-info@nokia.com>
Thu, 31 May 2012 15:55:43 +0000 (17:55 +0200)
commit05dc32ef6cc0d7279642839ea21100dee40a81c4
treea83e6e2eebc9bdd5d522f6fb695bdde80c9ae9d6
parent398c8513b172d4605a27dfa6125045b55e7cb29e
Fix the confusion caused by the QT_ALWAYS_HAVE_xxx macros

The QT_ALWAYS_HAVE_xxx macros are gone: they were hard to use and not
defined properly. It indicated that the compiler was producing code
that required that particular instruction set, so we could use it in
our code unconditionally. Instead, let's use the GCC-style __SSE2__
and __ARM_NEON__. MSVC does not generate the __SSE2__ macro, so let's
do it for the compiler. Also, define __AVX__ and the macros for the
technologies leading to it when we manage to detect an /arch:AVX build
(currently not possible, see note in the header).

ICC and MSVC allow one to use the intrinsics anywhere, but for Qt all
uses of the intrinsics are either in specially-built files, protected
by runtime checks, or they are unconditional (qstring.cpp). So we only
use the intrinsics when the compiler was instructed to generate code
for that instruction set anyway.

Change-Id: If8382f30422cee0e5831d051b003acf036824abf
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
src/corelib/tools/qsimd.cpp
src/corelib/tools/qsimd_p.h
src/corelib/tools/qstring.cpp
src/gui/painting/qdrawhelper.cpp