Enable compilation of improved x86 code generation with MSVC
authorThiago Macieira <thiago.macieira@intel.com>
Thu, 31 May 2012 15:49:10 +0000 (17:49 +0200)
committerQt by Nokia <qt-info@nokia.com>
Tue, 12 Jun 2012 02:29:47 +0000 (04:29 +0200)
Now that we know the compiler flags for asking MSVC to produce SSE2 code
properly as well as AVX code (technically, just VEX-prefixed SSE2), we
may as well use it.

The SSE2 code generation is enabled by this commit. The AVX one
requires a change to configure to detect the support in the compiler.

Change-Id: Ib6970daaedf450500ee73600e6bf9722eddb9a0c
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
src/gui/gui.pro

index 7498f48..5fa1de8 100644 (file)
@@ -122,15 +122,48 @@ win32:!contains(QT_CONFIG, directwrite) {
             silent:mips_dsp_compiler.commands = @echo compiling[mips_dsp] ${QMAKE_FILE_IN} && $$mips_dsp_compiler.commands
             QMAKE_EXTRA_COMPILERS += mips_dsp_compiler
         }
-} else {
-    # This serves two purposes:
-    # 1) it allows an IDE like Creator to know that these files are part of the sources
-    # 2) with MSVC, we are allowed to build the extra helpers
-    #    but we only build the SSE2 and SSSE3 ones for now since the AVX ones are just
-    #    the other two with the VEX prefix
-    win32-msvc*: SOURCES += $$SSE2_SOURCES $$SSSE3_SOURCES
-    false: SOURCES += $$NEON_SOURCES $$NEON_ASM \
-                $$IWMMXT_SOURCES \
+} else:win32-msvc* {
+        sse2 {
+            sse2_compiler.commands = $$QMAKE_CXX -c $(CXXFLAGS)
+            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
+        }
+        ssse3 {
+            ssse3_compiler.commands = $$QMAKE_CXX -c $(CXXFLAGS)
+            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
+        }
+        avx {
+            avx_compiler.commands = $$QMAKE_CXX -c $(CXXFLAGS) -D_M_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
+        }
+} else:false {
+    # This allows an IDE like Creator to know that these files are part of the sources
+    SOURCES += $$SSE2_SOURCES $$SSSE3_SOURCES \
                 $$AVX_SOURCES \
+                $$NEON_SOURCES $$NEON_ASM \
+                $$IWMMXT_SOURCES \
                 $$MIPS_DSP_SOURCES $$MIPS_DSP_ASM $$MIPS_DSPR2_ASM
 }