diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/configure/configureapp.cpp | 64 | ||||
-rw-r--r-- | tools/configure/configureapp.h | 1 |
2 files changed, 51 insertions, 14 deletions
diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index 1fdc4bb657..f688647009 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -160,6 +160,7 @@ Configure::Configure(int& argc, char** argv) : verbose(0) dictionary[ "SSE4_2" ] = "auto"; dictionary[ "AVX" ] = "auto"; dictionary[ "AVX2" ] = "auto"; + dictionary[ "AVX512" ] = "auto"; dictionary[ "SYNCQT" ] = "auto"; dictionary[ "CE_CRT" ] = "no"; dictionary[ "CETEST" ] = "auto"; @@ -279,7 +280,6 @@ Configure::Configure(int& argc, char** argv) : verbose(0) dictionary[ "STYLE_FUSION" ] = "yes"; dictionary[ "STYLE_WINDOWSCE" ] = "no"; dictionary[ "STYLE_WINDOWSMOBILE" ] = "no"; - dictionary[ "STYLE_GTK" ] = "no"; dictionary[ "SQL_MYSQL" ] = "no"; dictionary[ "SQL_ODBC" ] = "no"; @@ -305,7 +305,7 @@ Configure::Configure(int& argc, char** argv) : verbose(0) dictionary[ "NATIVE_GESTURES" ] = "yes"; dictionary[ "MSVC_MP" ] = "no"; - if (dictionary["QMAKESPEC"] == QString("win32-g++")) { + if (dictionary["QMAKESPEC"].startsWith("win32-g++")) { const QString zero = QStringLiteral("0"); const QStringList parts = Environment::gccVersion().split(QLatin1Char('.')); dictionary["QT_GCC_MAJOR_VERSION"] = parts.value(0, zero); @@ -889,6 +889,10 @@ void Configure::parseCmdLine() dictionary[ "AVX2" ] = "no"; else if (configCmdLine.at(i) == "-avx2") dictionary[ "AVX2" ] = "yes"; + else if (configCmdLine.at(i) == "-no-avx512") + dictionary[ "AVX512" ] = ""; + else if (configCmdLine.at(i) == "-avx512") + dictionary[ "AVX512" ] = "auto"; else if (configCmdLine.at(i) == "-no-ssl") { dictionary[ "SSL"] = "no"; @@ -1429,7 +1433,7 @@ void Configure::parseCmdLine() dictionary[ "QMAKESPEC" ].endsWith("-msvc2015")) { if (dictionary[ "MAKE" ].isEmpty()) dictionary[ "MAKE" ] = "nmake"; dictionary[ "QMAKEMAKEFILE" ] = "Makefile.win32"; - } else if (dictionary[ "QMAKESPEC" ] == QString("win32-g++")) { + } else if (dictionary[ "QMAKESPEC" ].startsWith(QLatin1String("win32-g++"))) { if (dictionary[ "MAKE" ].isEmpty()) dictionary[ "MAKE" ] = "mingw32-make"; dictionary[ "QMAKEMAKEFILE" ] = "Makefile.unix"; } else { @@ -1705,6 +1709,7 @@ void Configure::applySpecSpecifics() dictionary[ "SSE4_2" ] = "no"; dictionary[ "AVX" ] = "no"; dictionary[ "AVX2" ] = "no"; + dictionary[ "AVX512" ] = "no"; dictionary[ "CE_CRT" ] = "yes"; dictionary[ "LARGE_FILE" ] = "no"; dictionary[ "ANGLE" ] = "no"; @@ -2020,6 +2025,8 @@ bool Configure::displayHelp() desc("AVX", "yes", "-avx", "Compile with use of AVX instructions."); desc("AVX2", "no", "-no-avx2", "Do not compile with use of AVX2 instructions."); desc("AVX2", "yes", "-avx2", "Compile with use of AVX2 instructions.\n"); + desc("AVX512", "no", "-no-avx512", "Do not compile with use of AVX512 instructions."); + desc("AVX512", "yes", "-avx512", "Compile with use of AVX512 instructions.\n"); desc("SSL", "no", "-no-ssl", "Do not compile support for SSL."); desc("SSL", "yes", "-ssl", "Enable run-time SSL support."); desc("OPENSSL", "no", "-no-openssl", "Do not compile support for OpenSSL."); @@ -2208,6 +2215,24 @@ bool Configure::checkAngleAvailability(QString *errorMessage /* = 0 */) const return true; } +QString Configure::checkAvx512Availability() +{ + static const char avx512features[][5] = { "cd", "er", "pf", "bw", "dq", "vl", "ifma", "vbmi" }; + + // try AVX512 Foundation. No Foundation, nothing else works. + if (!tryCompileProject("common/avx512", "AVX512=F")) + return QString(); + + QString available = "avx512f"; + for (int i = 0; i < sizeof(avx512features)/sizeof(avx512features[0]); ++i) { + if (tryCompileProject("common/avx512", QStringLiteral("AVX512=%0").arg(avx512features[i]).toUpper())) { + available += " avx512"; + available += avx512features[i]; + } + } + return available; +} + /*! Checks the system for the availability of a feature. Returns true if the feature is available, else false. @@ -2483,6 +2508,8 @@ void Configure::autoDetection() dictionary["AVX"] = checkAvailability("AVX") ? "yes" : "no"; if (dictionary["AVX2"] == "auto") dictionary["AVX2"] = checkAvailability("AVX2") ? "yes" : "no"; + if (dictionary["AVX512"] == "auto") + dictionary["AVX512"] = checkAvx512Availability(); if (dictionary["NEON"] == "auto") dictionary["NEON"] = checkAvailability("NEON") ? "yes" : "no"; if (dictionary["SSL"] == "auto") { @@ -3203,6 +3230,8 @@ void Configure::generateCachefile() moduleStream << " avx"; if (dictionary[ "AVX2" ] == "yes") moduleStream << " avx2"; + if (!dictionary[ "AVX512" ].isEmpty()) + moduleStream << ' ' << dictionary[ "AVX512" ]; if (dictionary[ "NEON" ] == "yes") moduleStream << " neon"; if (dictionary[ "LARGE_FILE" ] == "yes") @@ -3682,6 +3711,8 @@ void Configure::generateConfigfiles() tmpStream << "#define QT_COMPILER_SUPPORTS_AVX 1" << endl; if (dictionary[ "AVX2" ] == "yes") tmpStream << "#define QT_COMPILER_SUPPORTS_AVX2 1" << endl; + foreach (const QString &avx512feature, dictionary[ "AVX512" ].split(' ', QString::SkipEmptyParts)) + tmpStream << "#define QT_COMPILER_SUPPRTS_" << avx512feature.toUpper() << " 1" << endl; if (dictionary["QREAL"] != "double") { tmpStream << "#define QT_COORD_TYPE " << dictionary["QREAL"] << endl; @@ -3698,7 +3729,6 @@ void Configure::generateConfigfiles() if (dictionary["STYLE_WINDOWSVISTA"] != "yes") qconfigList += "QT_NO_STYLE_WINDOWSVISTA"; if (dictionary["STYLE_WINDOWSCE"] != "yes") qconfigList += "QT_NO_STYLE_WINDOWSCE"; if (dictionary["STYLE_WINDOWSMOBILE"] != "yes") qconfigList += "QT_NO_STYLE_WINDOWSMOBILE"; - if (dictionary["STYLE_GTK"] != "yes") qconfigList += "QT_NO_STYLE_GTK"; if (dictionary["GIF"] == "yes") qconfigList += "QT_BUILTIN_GIF_READER=1"; if (dictionary["PNG"] != "yes") qconfigList += "QT_NO_IMAGEFORMAT_PNG"; @@ -3848,13 +3878,19 @@ void Configure::displayConfig() sout << "Link Time Code Generation..." << dictionary[ "LTCG" ] << endl; sout << "Accessibility support......." << dictionary[ "ACCESSIBILITY" ] << endl; sout << "RTTI support................" << dictionary[ "RTTI" ] << endl; - sout << "SSE2 support................" << dictionary[ "SSE2" ] << endl; - sout << "SSE3 support................" << dictionary[ "SSE3" ] << endl; - sout << "SSSE3 support..............." << dictionary[ "SSSE3" ] << endl; - sout << "SSE4.1 support.............." << dictionary[ "SSE4_1" ] << endl; - sout << "SSE4.2 support.............." << dictionary[ "SSE4_2" ] << endl; - sout << "AVX support................." << dictionary[ "AVX" ] << endl; - sout << "AVX2 support................" << dictionary[ "AVX2" ] << endl; + sout << "SSE support................." + << (dictionary[ "SSE2" ] == "no" ? "<none>" : "SSE2") + << (dictionary[ "SSE3" ] == "no" ? "" : " SSE3") + << (dictionary[ "SSSE3" ] == "no" ? "" : " SSSE3") + << (dictionary[ "SSE4_1" ] == "no" ? "" : " SSE4.1") + << (dictionary[ "SSE4_2" ] == "no" ? "" : " SSE4.2") + << endl; + sout << "AVX support................." + << (dictionary[ "AVX" ] == "no" ? "<none>" : "AVX") + << (dictionary[ "AVX2" ] == "no" ? "" : " AVX2") + << endl; + sout << "AVX512 support.............." + << (dictionary[ "AVX512" ].isEmpty() ? QString("<none>") : dictionary[ "AVX512" ].toUpper()) << endl; sout << "NEON support................" << dictionary[ "NEON" ] << endl; sout << "OpenGL support.............." << dictionary[ "OPENGL" ] << endl; sout << "Large File support.........." << dictionary[ "LARGE_FILE" ] << endl; @@ -4310,10 +4346,10 @@ void Configure::buildQmake() << "QT_MAJOR_VERSION = " << dictionary["VERSION_MAJOR"] << endl << "QT_MINOR_VERSION = " << dictionary["VERSION_MINOR"] << endl << "QT_PATCH_VERSION = " << dictionary["VERSION_PATCH"] << endl; - if (dictionary[ "QMAKESPEC" ] == QString("win32-g++")) { - stream << "QMAKESPEC = $(SOURCE_PATH)\\mkspecs\\win32-g++" << endl + if (dictionary[ "QMAKESPEC" ].startsWith("win32-g++")) { + stream << "QMAKESPEC = $(SOURCE_PATH)\\mkspecs\\" << dictionary[ "QMAKESPEC" ] << endl << "EXTRA_CFLAGS = -DUNICODE -ffunction-sections" << endl - << "EXTRA_CXXFLAGS = -DUNICODE -ffunction-sections" << endl + << "EXTRA_CXXFLAGS = -std=c++11 -DUNICODE -ffunction-sections" << endl << "EXTRA_LFLAGS = -Wl,--gc-sections" << endl << "QTOBJS = qfilesystemengine_win.o \\" << endl << " qfilesystemiterator_win.o \\" << endl diff --git a/tools/configure/configureapp.h b/tools/configure/configureapp.h index 78cc118a9d..5361cc2b1d 100644 --- a/tools/configure/configureapp.h +++ b/tools/configure/configureapp.h @@ -92,6 +92,7 @@ public: private: bool checkAngleAvailability(QString *errorMessage = 0) const; + QString checkAvx512Availability(); int verbose; |