Restore Neon "detection" in Qt
We don't actually detect whether the compiler can create Neon code or provides Neon intrinsics. Most of them do, so that test would be mostly moot. We removed the detection previously because we couldn't automatically enable Neon due to leakage of instructions outside the areas protected at runtime. Instead, we rely on the mkspec properly passing the necessary flags that enable Neon support. This commit does not change that. All it does is verify whether the arch detection found "neon" as part of the target CPU features. In other words, it moves the test that was in simd.prf to configure. It does fix the Neon detection in configure.exe, which was always failing for trying to run a test that didn't exist (config.tests/unix/neon). Change-Id: Id561dfb2db7d3dca7b8c29afef63181693bdc0aa Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
This commit is contained in:
parent
875ba6e80c
commit
86ac3a98b5
11
configure
vendored
11
configure
vendored
@ -4127,6 +4127,16 @@ if [ "$CFG_IWMMXT" = "yes" ]; then
|
||||
fi
|
||||
fi
|
||||
|
||||
# check Neon support
|
||||
if [ "$CFG_NEON" = "auto" ]; then
|
||||
# no compile test, just check what the compiler has
|
||||
case "$CFG_CPUFEATURES" in
|
||||
*neon*)
|
||||
CFG_NEON=yes
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
# detect mips_dsp support
|
||||
if [ "$CFG_ARCH" = "mips" ] && [ "${CFG_MIPS_DSP}" = "auto" ]; then
|
||||
if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/mips_dsp "mips_dsp" $L_FLAGS $I_FLAGS $D_FLAGS $l_FLAGS; then
|
||||
@ -5634,6 +5644,7 @@ fi
|
||||
[ "$CFG_AVX" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG avx"
|
||||
[ "$CFG_AVX2" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG avx2"
|
||||
[ "$CFG_IWMMXT" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG iwmmxt"
|
||||
[ "$CFG_NEON" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG neon"
|
||||
if [ "$CFG_ARCH" = "mips" ]; then
|
||||
[ "$CFG_MIPS_DSP" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG mips_dsp"
|
||||
[ "$CFG_MIPS_DSPR2" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG mips_dspr2"
|
||||
|
@ -117,7 +117,7 @@ gcc { # includes intel_icc and clang variants
|
||||
silent:avx2_compiler.commands = @echo compiling[avx2] ${QMAKE_FILE_IN} && $$avx2_compiler.commands
|
||||
QMAKE_EXTRA_COMPILERS += avx2_compiler
|
||||
}
|
||||
contains(QT_CPU_FEATURES.$$QT_ARCH, neon) {
|
||||
neon {
|
||||
HEADERS += $$NEON_HEADERS
|
||||
|
||||
neon_compiler.commands = $$QMAKE_CXX -c $(CXXFLAGS)
|
||||
|
@ -78,12 +78,10 @@ contains(QT_CONFIG, jpeg):include($$PWD/qjpeghandler.pri)
|
||||
contains(QT_CONFIG, gif):include($$PWD/qgifhandler.pri)
|
||||
|
||||
# SIMD
|
||||
contains(QT_CPU_FEATURES.$$QT_ARCH, neon) {
|
||||
SOURCES += image/qimage_neon.cpp
|
||||
}
|
||||
contains(QT_CPU_FEATURES.$$QT_ARCH, sse2) {
|
||||
SOURCES += image/qimage_sse2.cpp
|
||||
SSSE3_SOURCES += image/qimage_ssse3.cpp
|
||||
}
|
||||
NEON_SOURCES += image/qimage_neon.cpp
|
||||
MIPS_DSPR2_SOURCES += image/qimage_mips_dspr2.cpp
|
||||
MIPS_DSPR2_ASM += image/qimage_mips_dspr2_asm.S
|
||||
|
@ -97,10 +97,10 @@ contains(QT_CPU_FEATURES.$$QT_ARCH, sse2) {
|
||||
}
|
||||
IWMMXT_SOURCES += painting/qdrawhelper_iwmmxt.cpp
|
||||
|
||||
!ios:contains(QT_CPU_FEATURES.$$QT_ARCH, neon) {
|
||||
!ios:neon {
|
||||
CONFIG += no_clang_integrated_as
|
||||
SOURCES += painting/qdrawhelper_neon.cpp
|
||||
HEADERS += painting/qdrawhelper_neon_p.h
|
||||
NEON_SOURCES += painting/qdrawhelper_neon.cpp
|
||||
NEON_HEADERS += painting/qdrawhelper_neon_p.h
|
||||
NEON_ASM += ../3rdparty/pixman/pixman-arm-neon-asm.S painting/qdrawhelper_neon_asm.S
|
||||
}
|
||||
|
||||
|
@ -2280,7 +2280,7 @@ bool Configure::checkAvailability(const QString &part)
|
||||
available = (platform() == QNX || platform() == BLACKBERRY)
|
||||
&& tryCompileProject("unix/lgmon");
|
||||
} else if (part == "NEON") {
|
||||
available = (dictionary["QT_ARCH"] == "arm") && tryCompileProject("unix/neon");
|
||||
available = dictionary["QT_CPU_FEATURES"].contains("neon");
|
||||
} else if (part == "FONT_CONFIG") {
|
||||
available = tryCompileProject("unix/fontconfig");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user