diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2014-01-22 15:18:57 -0800 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-02-01 00:58:58 +0100 |
commit | 8930839acbfb5cbc231cc73cbbe2d1f83236fb58 (patch) | |
tree | 28b80cf2f19376edeed9cde22e8de7cbb630c0e7 /src/corelib/tools | |
parent | 2c985e8048110fa0ba8ca36c015929d77545a254 (diff) |
Update the macro that MSVC 2013 defines for AVX code generation
http://msdn.microsoft.com/en-us/library/b0084kay(v=vs.120).aspx says:
__AVX__ Defined when /arch:AVX is specified.
Now we know what flag it is, we don't need to use our _M_AVX flag
anymore. We're also now assuming that Microsoft will follow the same
pattern for AVX2 (i.e., __AVX2__), so this commit also removes the
check for _M_AVX2.
The other defines that were defined alongside AVX2 are removed because
they have no use currently in Qt.
Change-Id: I64a026b2206dbd0d2dffa7c803bee969c9b94a94
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/tools')
-rw-r--r-- | src/corelib/tools/qsimd_p.h | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/src/corelib/tools/qsimd_p.h b/src/corelib/tools/qsimd_p.h index dd720f88da..d293532f1d 100644 --- a/src/corelib/tools/qsimd_p.h +++ b/src/corelib/tools/qsimd_p.h @@ -56,7 +56,8 @@ * * We will try to include all headers possible under this configuration. * - * MSVC does not define __SSE2__ & family, so we will define them. + * MSVC does not define __SSE2__ & family, so we will define them. MSVC 2013 & + * up do define __AVX__ if the -arch:AVX option is passed on the command-line. * * Supported XXX are: * Flag | Arch | GCC | Intel CC | MSVC | @@ -118,23 +119,18 @@ // immintrin.h is the ultimate header, we don't need anything else after this #include <immintrin.h> -# if defined(Q_CC_MSVC) && defined(_M_AVX) +# if defined(Q_CC_MSVC) && (defined(_M_AVX) || defined(__AVX__)) // MS Visual Studio 2010 has no macro pre-defined to identify the use of /arch:AVX +// MS Visual Studio 2013 adds it: __AVX__ // See: http://connect.microsoft.com/VisualStudio/feedback/details/605858/arch-avx-should-define-a-predefined-macro-in-x64-and-set-a-unique-value-for-m-ix86-fp-in-win32 -// When such a macro exists, add it above, replacing _M_AVX as appropriate # define __SSE3__ 1 # define __SSSE3__ 1 // no Intel CPU supports SSE4a, so don't define it # define __SSE4_1__ 1 # define __SSE4_2__ 1 -# define __AVX__ 1 -# ifdef _M_AVX2 -// replace the macro above with the proper MS macro when it exists -// All processors with AVX2 will support BMI1 and FMA -# define __AVX2__ 1 -# define __BMI__ 1 -# define __FMA__ 1 -# endif +# ifndef __AVX__ +# define __AVX__ 1 +# endif # endif #endif |