Rewrite simd.prf to share more code
This was a long-time coming. One innovation from this commit is that it will add the source to SOURCES if the compiler is already generating code for that specific target. That is currently always the case for Neon, and the MIPS DSPs since that is the only condition in which configure will enable those targets. And because of qt_module.prf, it's also always the case for SSE2 (but not for SSE3 or higher). So simplify the .pri files by removing always-true conditions. Change-Id: Ib24af74717b652c9a6be246e3c17a839470f37da Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>bb10
parent
86ac3a98b5
commit
1f0823cc27
|
|
@ -18,298 +18,82 @@ QT_CPU_FEATURES = $$eval(QT_CPU_FEATURES.$$QT_ARCH)
|
|||
#
|
||||
# Set up compilers for SIMD (SSE/AVX, NEON etc)
|
||||
#
|
||||
gcc { # includes intel_icc and clang variants
|
||||
sse2 {
|
||||
HEADERS += $$SSE2_HEADERS
|
||||
defineTest(addSimdCompiler) {
|
||||
name = $$1
|
||||
upname = $$upper($$name)
|
||||
headers_var = $${upname}_HEADERS
|
||||
sources_var = $${upname}_SOURCES
|
||||
asm_var = $${upname}_ASM
|
||||
|
||||
sse2_compiler.commands = $$QMAKE_CXX -c $(CXXFLAGS)
|
||||
!contains(QT_CPU_FEATURES, sse2):sse2_compiler.commands += $$QMAKE_CFLAGS_SSE2
|
||||
sse2_compiler.commands += $(INCPATH) ${QMAKE_FILE_IN} -o ${QMAKE_FILE_OUT}
|
||||
sse2_compiler.dependency_type = TYPE_C
|
||||
sse2_compiler.output = ${QMAKE_VAR_OBJECTS_DIR}${QMAKE_FILE_BASE}$${first(QMAKE_EXT_OBJ)}
|
||||
sse2_compiler.input = SSE2_SOURCES
|
||||
sse2_compiler.variable_out = OBJECTS
|
||||
sse2_compiler.name = compiling[sse2] ${QMAKE_FILE_IN}
|
||||
silent:sse2_compiler.commands = @echo compiling[sse2] ${QMAKE_FILE_IN} && $$sse2_compiler.commands
|
||||
QMAKE_EXTRA_COMPILERS += sse2_compiler
|
||||
CONFIG($$1) {
|
||||
cflags = $$eval(QMAKE_CFLAGS_$${upname})
|
||||
contains(QT_CPU_FEATURES, $$name) {
|
||||
# Default compiler settings include this feature, so just add to SOURCES
|
||||
SOURCES += $$eval($$sources_var)
|
||||
export(SOURCES)
|
||||
} else {
|
||||
# We need special compiler flags
|
||||
$${name}_compiler.commands = $$QMAKE_CXX -c $(CXXFLAGS) $$cflags $(INCPATH) ${QMAKE_FILE_IN}
|
||||
msvc: $${name}_compiler.commands += -Fo${QMAKE_FILE_OUT}
|
||||
else: $${name}_compiler.commands += -o ${QMAKE_FILE_OUT}
|
||||
|
||||
$${name}_compiler.dependency_type = TYPE_C
|
||||
$${name}_compiler.output = ${QMAKE_VAR_OBJECTS_DIR}${QMAKE_FILE_BASE}$${first(QMAKE_EXT_OBJ)}
|
||||
$${name}_compiler.input = $$sources_var
|
||||
$${name}_compiler.variable_out = OBJECTS
|
||||
$${name}_compiler.name = compiling[$${name}] ${QMAKE_FILE_IN}
|
||||
silent: $${name}_compiler.commands = @echo compiling[$${name}] ${QMAKE_FILE_IN} && $$eval($${name}_compiler.commands)
|
||||
QMAKE_EXTRA_COMPILERS += $${name}_compiler
|
||||
|
||||
export($${name}_compiler.commands)
|
||||
export($${name}_compiler.dependency_type)
|
||||
export($${name}_compiler.output)
|
||||
export($${name}_compiler.input)
|
||||
export($${name}_compiler.variable_out)
|
||||
export($${name}_compiler.name)
|
||||
}
|
||||
|
||||
# We always need an assembler (need to run the C compiler and without precompiled headers)
|
||||
msvc {
|
||||
# Don't know how to run MSVC's assembler...
|
||||
!isEmpty($$asm_var): error("Sorry, not implemented: assembling $$upname for MSVC.")
|
||||
} else: false {
|
||||
# This is just for the IDE
|
||||
SOURCES += $$eval($$asm_var)
|
||||
export(SOURCES)
|
||||
} else {
|
||||
$${name}_assembler.commands = $$QMAKE_CC -c $(CFLAGS)
|
||||
!contains(QT_CPU_FEATURES, $${name}): $${name}_assembler.commands += $$cflags
|
||||
clang:no_clang_integrated_as: $${name}_assembler.commands += -fno-integrated-as
|
||||
$${name}_assembler.commands += $(INCPATH) ${QMAKE_FILE_IN} -o ${QMAKE_FILE_OUT}
|
||||
$${name}_assembler.dependency_type = TYPE_C
|
||||
$${name}_assembler.output = ${QMAKE_VAR_OBJECTS_DIR}${QMAKE_FILE_BASE}$${first(QMAKE_EXT_OBJ)}
|
||||
$${name}_assembler.input = $$asm_var
|
||||
$${name}_assembler.variable_out = OBJECTS
|
||||
$${name}_assembler.name = assembling[$${name}] ${QMAKE_FILE_IN}
|
||||
silent: $${name}_assembler.commands = @echo assembling[$${name}] ${QMAKE_FILE_IN} && $$eval($${name}_assembler.commands)
|
||||
QMAKE_EXTRA_COMPILERS += $${name}_assembler
|
||||
|
||||
export($${name}_assembler.commands)
|
||||
export($${name}_assembler.dependency_type)
|
||||
export($${name}_assembler.output)
|
||||
export($${name}_assembler.input)
|
||||
export($${name}_assembler.variable_out)
|
||||
export($${name}_assembler.name)
|
||||
}
|
||||
|
||||
HEADERS += $$eval($$headers_var)
|
||||
export(HEADERS)
|
||||
export(QMAKE_EXTRA_COMPILERS)
|
||||
}
|
||||
sse3 {
|
||||
HEADERS += $$SSE3_HEADERS
|
||||
|
||||
sse3_compiler.commands = $$QMAKE_CXX -c $(CXXFLAGS)
|
||||
!contains(QT_CPU_FEATURES, sse3):sse3_compiler.commands += $$QMAKE_CFLAGS_SSE3
|
||||
sse3_compiler.commands += $(INCPATH) ${QMAKE_FILE_IN} -o ${QMAKE_FILE_OUT}
|
||||
sse3_compiler.dependency_type = TYPE_C
|
||||
sse3_compiler.output = ${QMAKE_VAR_OBJECTS_DIR}${QMAKE_FILE_BASE}$${first(QMAKE_EXT_OBJ)}
|
||||
sse3_compiler.input = SSE3_SOURCES
|
||||
sse3_compiler.variable_out = OBJECTS
|
||||
sse3_compiler.name = compiling[sse3] ${QMAKE_FILE_IN}
|
||||
silent:sse3_compiler.commands = @echo compiling[sse3] ${QMAKE_FILE_IN} && $$sse3_compiler.commands
|
||||
QMAKE_EXTRA_COMPILERS += sse3_compiler
|
||||
}
|
||||
ssse3 {
|
||||
HEADERS += $$SSSE3_HEADERS
|
||||
|
||||
ssse3_compiler.commands = $$QMAKE_CXX -c $(CXXFLAGS)
|
||||
!contains(QT_CPU_FEATURES, ssse3):ssse3_compiler.commands += $$QMAKE_CFLAGS_SSSE3
|
||||
ssse3_compiler.commands += $(INCPATH) ${QMAKE_FILE_IN} -o ${QMAKE_FILE_OUT}
|
||||
ssse3_compiler.dependency_type = TYPE_C
|
||||
ssse3_compiler.output = ${QMAKE_VAR_OBJECTS_DIR}${QMAKE_FILE_BASE}$${first(QMAKE_EXT_OBJ)}
|
||||
ssse3_compiler.input = SSSE3_SOURCES
|
||||
ssse3_compiler.variable_out = OBJECTS
|
||||
ssse3_compiler.name = compiling[ssse3] ${QMAKE_FILE_IN}
|
||||
silent:ssse3_compiler.commands = @echo compiling[ssse3] ${QMAKE_FILE_IN} && $$ssse3_compiler.commands
|
||||
QMAKE_EXTRA_COMPILERS += ssse3_compiler
|
||||
}
|
||||
sse4_1 {
|
||||
HEADERS += $$SSE4_1_HEADERS
|
||||
|
||||
sse4_1_compiler.commands = $$QMAKE_CXX -c $(CXXFLAGS)
|
||||
!contains(QT_CPU_FEATURES, sse4_1):sse4_1_compiler.commands += $$QMAKE_CFLAGS_SSE4_1
|
||||
sse4_1_compiler.commands += $(INCPATH) ${QMAKE_FILE_IN} -o ${QMAKE_FILE_OUT}
|
||||
sse4_1_compiler.dependency_type = TYPE_C
|
||||
sse4_1_compiler.output = ${QMAKE_VAR_OBJECTS_DIR}${QMAKE_FILE_BASE}$${first(QMAKE_EXT_OBJ)}
|
||||
sse4_1_compiler.input = SSE4_1_SOURCES
|
||||
sse4_1_compiler.variable_out = OBJECTS
|
||||
sse4_1_compiler.name = compiling[sse4_1] ${QMAKE_FILE_IN}
|
||||
silent:sse4_1_compiler.commands = @echo compiling[sse4_1] ${QMAKE_FILE_IN} && $$sse4_1_compiler.commands
|
||||
QMAKE_EXTRA_COMPILERS += sse4_1_compiler
|
||||
}
|
||||
sse4_2 {
|
||||
HEADERS += $$SSE4_2_HEADERS
|
||||
|
||||
sse4_2_compiler.commands = $$QMAKE_CXX -c $(CXXFLAGS)
|
||||
!contains(QT_CPU_FEATURES, sse4_2):sse4_2_compiler.commands += $$QMAKE_CFLAGS_SSE4_2
|
||||
sse4_2_compiler.commands += $(INCPATH) ${QMAKE_FILE_IN} -o ${QMAKE_FILE_OUT}
|
||||
sse4_2_compiler.dependency_type = TYPE_C
|
||||
sse4_2_compiler.output = ${QMAKE_VAR_OBJECTS_DIR}${QMAKE_FILE_BASE}$${first(QMAKE_EXT_OBJ)}
|
||||
sse4_2_compiler.input = SSE4_2_SOURCES
|
||||
sse4_2_compiler.variable_out = OBJECTS
|
||||
sse4_2_compiler.name = compiling[sse4_2] ${QMAKE_FILE_IN}
|
||||
silent:sse4_2_compiler.commands = @echo compiling[sse4_2] ${QMAKE_FILE_IN} && $$sse4_2_compiler.commands
|
||||
QMAKE_EXTRA_COMPILERS += sse4_2_compiler
|
||||
}
|
||||
avx {
|
||||
HEADERS += $$AVX_HEADERS
|
||||
|
||||
avx_compiler.commands = $$QMAKE_CXX -c $(CXXFLAGS)
|
||||
!contains(QT_CPU_FEATURES, avx):avx_compiler.commands += $$QMAKE_CFLAGS_AVX
|
||||
avx_compiler.commands += $(INCPATH) ${QMAKE_FILE_IN} -o ${QMAKE_FILE_OUT}
|
||||
avx_compiler.dependency_type = TYPE_C
|
||||
avx_compiler.output = ${QMAKE_VAR_OBJECTS_DIR}${QMAKE_FILE_BASE}$${first(QMAKE_EXT_OBJ)}
|
||||
avx_compiler.input = AVX_SOURCES
|
||||
avx_compiler.variable_out = OBJECTS
|
||||
avx_compiler.name = compiling[avx] ${QMAKE_FILE_IN}
|
||||
silent:avx_compiler.commands = @echo compiling[avx] ${QMAKE_FILE_IN} && $$avx_compiler.commands
|
||||
QMAKE_EXTRA_COMPILERS += avx_compiler
|
||||
}
|
||||
avx2 {
|
||||
HEADERS += $$AVX2_HEADERS
|
||||
|
||||
avx2_compiler.commands = $$QMAKE_CXX -c $(CXXFLAGS)
|
||||
!contains(QT_CPU_FEATURES, avx2):avx2_compiler.commands += $$QMAKE_CFLAGS_AVX2
|
||||
avx2_compiler.commands += $(INCPATH) ${QMAKE_FILE_IN} -o ${QMAKE_FILE_OUT}
|
||||
avx2_compiler.dependency_type = TYPE_C
|
||||
avx2_compiler.output = ${QMAKE_VAR_OBJECTS_DIR}${QMAKE_FILE_BASE}$${first(QMAKE_EXT_OBJ)}
|
||||
avx2_compiler.input = AVX2_SOURCES
|
||||
avx2_compiler.variable_out = OBJECTS
|
||||
avx2_compiler.name = compiling[avx2] ${QMAKE_FILE_IN}
|
||||
silent:avx2_compiler.commands = @echo compiling[avx2] ${QMAKE_FILE_IN} && $$avx2_compiler.commands
|
||||
QMAKE_EXTRA_COMPILERS += avx2_compiler
|
||||
}
|
||||
neon {
|
||||
HEADERS += $$NEON_HEADERS
|
||||
|
||||
neon_compiler.commands = $$QMAKE_CXX -c $(CXXFLAGS)
|
||||
!contains(QT_CPU_FEATURES, neon):neon_compiler.commands += $$QMAKE_CFLAGS_NEON
|
||||
neon_compiler.commands += $(INCPATH) ${QMAKE_FILE_IN} -o ${QMAKE_FILE_OUT}
|
||||
neon_compiler.dependency_type = TYPE_C
|
||||
neon_compiler.output = ${QMAKE_VAR_OBJECTS_DIR}${QMAKE_FILE_BASE}$${first(QMAKE_EXT_OBJ)}
|
||||
neon_compiler.input = NEON_SOURCES
|
||||
neon_compiler.variable_out = OBJECTS
|
||||
neon_compiler.name = compiling[neon] ${QMAKE_FILE_IN}
|
||||
silent:neon_compiler.commands = @echo compiling[neon] ${QMAKE_FILE_IN} && $$neon_compiler.commands
|
||||
neon_assembler.commands = $$QMAKE_CC -c $(CFLAGS)
|
||||
!contains(QT_CPU_FEATURES, neon):neon_assembler.commands += $$QMAKE_CFLAGS_NEON
|
||||
neon_assembler.commands += $(INCPATH) ${QMAKE_FILE_IN} -o ${QMAKE_FILE_OUT}
|
||||
clang:no_clang_integrated_as:neon_assembler.commands += -fno-integrated-as
|
||||
neon_assembler.dependency_type = TYPE_C
|
||||
neon_assembler.output = ${QMAKE_VAR_OBJECTS_DIR}${QMAKE_FILE_BASE}$${first(QMAKE_EXT_OBJ)}
|
||||
neon_assembler.input = NEON_ASM
|
||||
neon_assembler.variable_out = OBJECTS
|
||||
neon_assembler.name = assembling[neon] ${QMAKE_FILE_IN}
|
||||
silent:neon_assembler.commands = @echo assembling[neon] ${QMAKE_FILE_IN} && $$neon_assembler.commands
|
||||
QMAKE_EXTRA_COMPILERS += neon_compiler neon_assembler
|
||||
}
|
||||
iwmmxt {
|
||||
HEADERS += $$IWMMXT_HEADERS
|
||||
|
||||
iwmmxt_compiler.commands = $$QMAKE_CXX -c $(CXXFLAGS)
|
||||
iwmmxt_compiler.commands += $$QMAKE_CFLAGS_IWMMXT
|
||||
iwmmxt_compiler.commands += $(INCPATH) ${QMAKE_FILE_IN} -o ${QMAKE_FILE_OUT}
|
||||
iwmmxt_compiler.dependency_type = TYPE_C
|
||||
iwmmxt_compiler.output = ${QMAKE_VAR_OBJECTS_DIR}${QMAKE_FILE_BASE}$${first(QMAKE_EXT_OBJ)}
|
||||
iwmmxt_compiler.input = IWMMXT_SOURCES
|
||||
iwmmxt_compiler.variable_out = OBJECTS
|
||||
iwmmxt_compiler.name = compiling[iwmmxt] ${QMAKE_FILE_IN}
|
||||
silent:iwmmxt_compiler.commands = @echo compiling[iwmmxt] ${QMAKE_FILE_IN} && $$iwmmxt_compiler.commands
|
||||
QMAKE_EXTRA_COMPILERS += iwmmxt_compiler
|
||||
}
|
||||
mips_dsp {
|
||||
HEADERS += $$MIPS_DSP_HEADERS
|
||||
|
||||
mips_dsp_compiler.commands = $$QMAKE_CXX -c
|
||||
mips_dsp_compiler.commands += $(CXXFLAGS) $(INCPATH) ${QMAKE_FILE_IN} -o ${QMAKE_FILE_OUT}
|
||||
mips_dsp_compiler.dependency_type = TYPE_C
|
||||
mips_dsp_compiler.output = ${QMAKE_VAR_OBJECTS_DIR}${QMAKE_FILE_BASE}$${first(QMAKE_EXT_OBJ)}
|
||||
mips_dsp_compiler.input = MIPS_DSP_SOURCES
|
||||
mips_dsp_compiler.variable_out = OBJECTS
|
||||
mips_dsp_compiler.name = compiling[mips_dsp] ${QMAKE_FILE_IN}
|
||||
silent:mips_dsp_compiler.commands = @echo compiling[mips_dsp] ${QMAKE_FILE_IN} && $$mips_dsp_compiler.commands
|
||||
mips_dsp_assembler.commands = $$QMAKE_CC -c
|
||||
mips_dsp_assembler.commands += $(CFLAGS) $(INCPATH) ${QMAKE_FILE_IN} -o ${QMAKE_FILE_OUT}
|
||||
mips_dsp_assembler.dependency_type = TYPE_C
|
||||
mips_dsp_assembler.output = ${QMAKE_VAR_OBJECTS_DIR}${QMAKE_FILE_BASE}$${first(QMAKE_EXT_OBJ)}
|
||||
mips_dsp_assembler.input = MIPS_DSP_ASM
|
||||
mips_dsp_assembler.variable_out = OBJECTS
|
||||
mips_dsp_assembler.name = assembling[mips_dsp] ${QMAKE_FILE_IN}
|
||||
silent:mips_dsp_assembler.commands = @echo assembling[mips_dsp] ${QMAKE_FILE_IN} && $$mips_dsp_assembler.commands
|
||||
QMAKE_EXTRA_COMPILERS += mips_dsp_compiler
|
||||
QMAKE_EXTRA_COMPILERS += mips_dsp_assembler
|
||||
}
|
||||
mips_dspr2 {
|
||||
HEADERS += $$MIPS_DSP_HEADERS
|
||||
|
||||
mips_dspr2_compiler.commands = $$QMAKE_CXX -c
|
||||
mips_dspr2_compiler.commands += $(CXXFLAGS) $(INCPATH) ${QMAKE_FILE_IN} -o ${QMAKE_FILE_OUT}
|
||||
mips_dspr2_compiler.dependency_type = TYPE_C
|
||||
mips_dspr2_compiler.output = ${QMAKE_VAR_OBJECTS_DIR}${QMAKE_FILE_BASE}$${first(QMAKE_EXT_OBJ)}
|
||||
mips_dspr2_compiler.input = MIPS_DSPR2_SOURCES
|
||||
mips_dspr2_compiler.variable_out = OBJECTS
|
||||
mips_dspr2_compiler.name = compiling[mips_dspr2] ${QMAKE_FILE_IN}
|
||||
silent:mips_dspr2_compiler.commands = @echo compiling[mips_dspr2] ${QMAKE_FILE_IN} && $$mips_dspr2_compiler.commands
|
||||
mips_dspr2_assembler.commands = $$QMAKE_CC -c
|
||||
mips_dspr2_assembler.commands += $(CFLAGS) $(INCPATH) ${QMAKE_FILE_IN} -o ${QMAKE_FILE_OUT}
|
||||
mips_dspr2_assembler.dependency_type = TYPE_C
|
||||
mips_dspr2_assembler.output = ${QMAKE_VAR_OBJECTS_DIR}${QMAKE_FILE_BASE}$${first(QMAKE_EXT_OBJ)}
|
||||
mips_dspr2_assembler.input = MIPS_DSPR2_ASM
|
||||
mips_dspr2_assembler.variable_out = OBJECTS
|
||||
mips_dspr2_assembler.name = assembling[mips_dspr2] ${QMAKE_FILE_IN}
|
||||
silent:mips_dspr2_assembler.commands = @echo assembling[mips_dspr2] ${QMAKE_FILE_IN} && $$mips_dspr2_assembler.commands
|
||||
QMAKE_EXTRA_COMPILERS += mips_dspr2_compiler
|
||||
QMAKE_EXTRA_COMPILERS += mips_dspr2_assembler
|
||||
}
|
||||
} else:msvc {
|
||||
sse2 {
|
||||
HEADERS += $$SSE2_HEADERS
|
||||
|
||||
sse2_compiler.commands = $$QMAKE_CXX -c $(CXXFLAGS)
|
||||
!contains(QT_CPU_FEATURES, sse2):sse2_compiler.commands += $$QMAKE_CFLAGS_SSE2
|
||||
sse2_compiler.commands += $(INCPATH) ${QMAKE_FILE_IN} -Fo${QMAKE_FILE_OUT}
|
||||
sse2_compiler.dependency_type = TYPE_C
|
||||
sse2_compiler.output = ${QMAKE_VAR_OBJECTS_DIR}${QMAKE_FILE_BASE}$${first(QMAKE_EXT_OBJ)}
|
||||
sse2_compiler.input = SSE2_SOURCES
|
||||
sse2_compiler.variable_out = OBJECTS
|
||||
sse2_compiler.name = compiling[sse2] ${QMAKE_FILE_IN}
|
||||
silent:sse2_compiler.commands = @echo compiling[sse2] ${QMAKE_FILE_IN} && $$sse2_compiler.commands
|
||||
QMAKE_EXTRA_COMPILERS += sse2_compiler
|
||||
}
|
||||
# MSVC doesn't have an option for anything higher than SSE2 specifically, so check if SSE2 is
|
||||
# already enabled instead (this is for code generation - intrinsics should still be supported)
|
||||
sse3 {
|
||||
HEADERS += $$SSE3_HEADERS
|
||||
|
||||
sse3_compiler.commands = $$QMAKE_CXX -c $(CXXFLAGS)
|
||||
!contains(QT_CPU_FEATURES, sse2):sse3_compiler.commands += $$QMAKE_CFLAGS_SSE3
|
||||
sse3_compiler.commands += $(INCPATH) ${QMAKE_FILE_IN} -Fo${QMAKE_FILE_OUT}
|
||||
sse3_compiler.dependency_type = TYPE_C
|
||||
sse3_compiler.output = ${QMAKE_VAR_OBJECTS_DIR}${QMAKE_FILE_BASE}$${first(QMAKE_EXT_OBJ)}
|
||||
sse3_compiler.input = SSE3_SOURCES
|
||||
sse3_compiler.variable_out = OBJECTS
|
||||
sse3_compiler.name = compiling[sse3] ${QMAKE_FILE_IN}
|
||||
silent:sse3_compiler.commands = @echo compiling[sse3] ${QMAKE_FILE_IN} && $$sse3_compiler.commands
|
||||
QMAKE_EXTRA_COMPILERS += sse3_compiler
|
||||
}
|
||||
ssse3 {
|
||||
HEADERS += $$SSSE3_HEADERS
|
||||
|
||||
ssse3_compiler.commands = $$QMAKE_CXX -c $(CXXFLAGS)
|
||||
!contains(QT_CPU_FEATURES, sse2):ssse3_compiler.commands += $$QMAKE_CFLAGS_SSSE3
|
||||
ssse3_compiler.commands += $(INCPATH) ${QMAKE_FILE_IN} -Fo${QMAKE_FILE_OUT}
|
||||
ssse3_compiler.dependency_type = TYPE_C
|
||||
ssse3_compiler.output = ${QMAKE_VAR_OBJECTS_DIR}${QMAKE_FILE_BASE}$${first(QMAKE_EXT_OBJ)}
|
||||
ssse3_compiler.input = SSSE3_SOURCES
|
||||
ssse3_compiler.variable_out = OBJECTS
|
||||
ssse3_compiler.name = compiling[ssse3] ${QMAKE_FILE_IN}
|
||||
silent:ssse3_compiler.commands = @echo compiling[ssse3] ${QMAKE_FILE_IN} && $$ssse3_compiler.commands
|
||||
QMAKE_EXTRA_COMPILERS += ssse3_compiler
|
||||
}
|
||||
sse4_1 {
|
||||
HEADERS += $$SSE4_1_HEADERS
|
||||
|
||||
sse4_1_compiler.commands = $$QMAKE_CXX -c $(CXXFLAGS)
|
||||
!contains(QT_CPU_FEATURES, sse2):sse4_1_compiler.commands += $$QMAKE_CFLAGS_SSE4_1
|
||||
sse4_1_compiler.commands += $(INCPATH) ${QMAKE_FILE_IN} -Fo${QMAKE_FILE_OUT}
|
||||
sse4_1_compiler.dependency_type = TYPE_C
|
||||
sse4_1_compiler.output = ${QMAKE_VAR_OBJECTS_DIR}${QMAKE_FILE_BASE}$${first(QMAKE_EXT_OBJ)}
|
||||
sse4_1_compiler.input = SSE4_1_SOURCES
|
||||
sse4_1_compiler.variable_out = OBJECTS
|
||||
sse4_1_compiler.name = compiling[sse4_1] ${QMAKE_FILE_IN}
|
||||
silent:sse4_1_compiler.commands = @echo compiling[sse4_1] ${QMAKE_FILE_IN} && $$sse4_1_compiler.commands
|
||||
QMAKE_EXTRA_COMPILERS += sse4_1_compiler
|
||||
}
|
||||
sse4_2 {
|
||||
HEADERS += $$SSE4_2_HEADERS
|
||||
|
||||
sse4_2_compiler.commands = $$QMAKE_CXX -c $(CXXFLAGS)
|
||||
!contains(QT_CPU_FEATURES, sse2):sse4_2_compiler.commands += $$QMAKE_CFLAGS_SSE4_2
|
||||
sse4_2_compiler.commands += $(INCPATH) ${QMAKE_FILE_IN} -Fo${QMAKE_FILE_OUT}
|
||||
sse4_2_compiler.dependency_type = TYPE_C
|
||||
sse4_2_compiler.output = ${QMAKE_VAR_OBJECTS_DIR}${QMAKE_FILE_BASE}$${first(QMAKE_EXT_OBJ)}
|
||||
sse4_2_compiler.input = SSE4_2_SOURCES
|
||||
sse4_2_compiler.variable_out = OBJECTS
|
||||
sse4_2_compiler.name = compiling[sse4_2] ${QMAKE_FILE_IN}
|
||||
silent:sse4_2_compiler.commands = @echo compiling[sse4_2] ${QMAKE_FILE_IN} && $$sse4_2_compiler.commands
|
||||
QMAKE_EXTRA_COMPILERS += sse4_2_compiler
|
||||
}
|
||||
# Similarly for AVX2 - just uses AVX
|
||||
avx {
|
||||
HEADERS += $$AVX_HEADERS
|
||||
|
||||
avx_compiler.commands = $$QMAKE_CXX -c $(CXXFLAGS) -D_M_AVX
|
||||
!contains(QT_CPU_FEATURES, avx):avx_compiler.commands += $$QMAKE_CFLAGS_AVX
|
||||
avx_compiler.commands += $(INCPATH) ${QMAKE_FILE_IN} -Fo${QMAKE_FILE_OUT}
|
||||
avx_compiler.dependency_type = TYPE_C
|
||||
avx_compiler.output = ${QMAKE_VAR_OBJECTS_DIR}${QMAKE_FILE_BASE}$${first(QMAKE_EXT_OBJ)}
|
||||
avx_compiler.input = AVX_SOURCES
|
||||
avx_compiler.variable_out = OBJECTS
|
||||
avx_compiler.name = compiling[avx] ${QMAKE_FILE_IN}
|
||||
silent:avx_compiler.commands = @echo compiling[avx] ${QMAKE_FILE_IN} && $$avx_compiler.commands
|
||||
QMAKE_EXTRA_COMPILERS += avx_compiler
|
||||
}
|
||||
avx2 {
|
||||
HEADERS += $$AVX2_HEADERS
|
||||
|
||||
avx2_compiler.commands = $$QMAKE_CXX -c $(CXXFLAGS)
|
||||
!contains(QT_CPU_FEATURES, avx):avx2_compiler.commands += $$QMAKE_CFLAGS_AVX2
|
||||
avx2_compiler.commands += $(INCPATH) ${QMAKE_FILE_IN} -Fo${QMAKE_FILE_OUT}
|
||||
avx2_compiler.dependency_type = TYPE_C
|
||||
avx2_compiler.output = ${QMAKE_VAR_OBJECTS_DIR}${QMAKE_FILE_BASE}$${first(QMAKE_EXT_OBJ)}
|
||||
avx2_compiler.input = AVX2_SOURCES
|
||||
avx2_compiler.variable_out = OBJECTS
|
||||
avx2_compiler.name = compiling[avx2] ${QMAKE_FILE_IN}
|
||||
silent:avx2_compiler.commands = @echo compiling[avx2] ${QMAKE_FILE_IN} && $$avx2_compiler.commands
|
||||
QMAKE_EXTRA_COMPILERS += avx2_compiler
|
||||
}
|
||||
} else:false {
|
||||
# This allows an IDE like Creator to know that these files are part of the sources
|
||||
SOURCES += \
|
||||
$$SSE2_SOURCES $$SSE3_SOURCES $$SSSE3_SOURCES $$SSE4_1_SOURCES $$SSE4_2_SOURCES \
|
||||
$$AVX_SOURCES $$AVX2_SOURCES \
|
||||
$$NEON_SOURCES $$NEON_ASM \
|
||||
$$IWMMXT_SOURCES \
|
||||
$$MIPS_DSP_SOURCES $$MIPS_DSPR2_SOURCES $$MIPS_DSP_ASM $$MIPS_DSPR2_ASM
|
||||
|
||||
# Headers are already done in the above sections.
|
||||
}
|
||||
|
||||
addSimdCompiler(sse2)
|
||||
addSimdCompiler(sse3)
|
||||
addSimdCompiler(ssse3)
|
||||
addSimdCompiler(sse4_1)
|
||||
addSimdCompiler(sse4_2)
|
||||
addSimdCompiler(avx)
|
||||
addSimdCompiler(avx2)
|
||||
addSimdCompiler(neon)
|
||||
addSimdCompiler(mips_dsp)
|
||||
addSimdCompiler(mips_dspr2)
|
||||
|
|
|
|||
|
|
@ -78,10 +78,8 @@ contains(QT_CONFIG, jpeg):include($$PWD/qjpeghandler.pri)
|
|||
contains(QT_CONFIG, gif):include($$PWD/qgifhandler.pri)
|
||||
|
||||
# SIMD
|
||||
contains(QT_CPU_FEATURES.$$QT_ARCH, sse2) {
|
||||
SOURCES += image/qimage_sse2.cpp
|
||||
SSSE3_SOURCES += image/qimage_ssse3.cpp
|
||||
}
|
||||
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
|
||||
|
|
|
|||
|
|
@ -91,13 +91,11 @@ SOURCES += \
|
|||
painting/qpaintbuffer.cpp \
|
||||
painting/qpathsimplifier.cpp
|
||||
|
||||
contains(QT_CPU_FEATURES.$$QT_ARCH, sse2) {
|
||||
SOURCES += painting/qdrawhelper_sse2.cpp
|
||||
SSSE3_SOURCES += painting/qdrawhelper_ssse3.cpp
|
||||
}
|
||||
SSE2_SOURCES += painting/qdrawhelper_sse2.cpp
|
||||
SSSE3_SOURCES += painting/qdrawhelper_ssse3.cpp
|
||||
IWMMXT_SOURCES += painting/qdrawhelper_iwmmxt.cpp
|
||||
|
||||
!ios:neon {
|
||||
!ios {
|
||||
CONFIG += no_clang_integrated_as
|
||||
NEON_SOURCES += painting/qdrawhelper_neon.cpp
|
||||
NEON_HEADERS += painting/qdrawhelper_neon_p.h
|
||||
|
|
|
|||
Loading…
Reference in New Issue