From c3a4ec5d0bbd5f2710f4fd1d3bd4a2d7f0f507ad Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 23 May 2018 00:54:19 -0300 Subject: SIMD: Add a haswell sub-architecture selection to our support As the comment says, Haswell is a nice divider and is a good optimization target. I'm using -march=core-avx2 instead of -march=haswell because the latter form was only added to GCC 4.9 but we still support 4.7 and that has support for AVX2. This commit changes the AVX2-optimized code in QtGui to Haswell- optimized instead. That means, for example, that qdrawhelper_avx2.cpp can now use the FMA instructions. Change-Id: If025d476890745368955fffd153129c1716ba006 Reviewed-by: Lars Knoll Reviewed-by: Allan Sandfeld Jensen --- src/gui/painting/painting.pri | 2 +- src/gui/painting/qdrawhelper.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/gui/painting') diff --git a/src/gui/painting/painting.pri b/src/gui/painting/painting.pri index 749cc221ff..c3585a4647 100644 --- a/src/gui/painting/painting.pri +++ b/src/gui/painting/painting.pri @@ -127,7 +127,7 @@ SSE2_SOURCES += painting/qdrawhelper_sse2.cpp SSSE3_SOURCES += painting/qdrawhelper_ssse3.cpp SSE4_1_SOURCES += painting/qdrawhelper_sse4.cpp \ painting/qimagescale_sse4.cpp -AVX2_SOURCES += painting/qdrawhelper_avx2.cpp +ARCH_HASWELL_SOURCES += painting/qdrawhelper_avx2.cpp NEON_SOURCES += painting/qdrawhelper_neon.cpp painting/qimagescale_neon.cpp NEON_HEADERS += painting/qdrawhelper_neon_p.h diff --git a/src/gui/painting/qdrawhelper.cpp b/src/gui/painting/qdrawhelper.cpp index 5892d59a64..235bba7206 100644 --- a/src/gui/painting/qdrawhelper.cpp +++ b/src/gui/painting/qdrawhelper.cpp @@ -5772,7 +5772,7 @@ static void qInitDrawhelperFunctions() #endif #if defined(QT_COMPILER_SUPPORTS_AVX2) - if (qCpuHasFeature(AVX2)) { + if (qCpuHasFeature(ArchHaswell)) { extern void qt_blend_rgb32_on_rgb32_avx2(uchar *destPixels, int dbpl, const uchar *srcPixels, int sbpl, int w, int h, int const_alpha); -- cgit v1.2.3