Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/intern
diff options
context:
space:
mode:
authorSv. Lockal <lockalsash@gmail.com>2014-02-03 17:22:50 +0400
committerSv. Lockal <lockalsash@gmail.com>2014-02-03 17:22:50 +0400
commit04984430ce18a61560f793d0adf9b7acba4a05d4 (patch)
tree41b515d9b45716fd2f4f626a5d79e0b0fc95919b /intern
parentd484eb8c25137d7ecb9d722e593e7b70cedad458 (diff)
Cycles: enable /arch:AVX in msvc 11 and later versions for avx kernel
This enables VEX-encoding in AVX kernel for windows msvc builds and gives 5-10% speedup for different scenes. Reviewers: juicyfruit, dingto, brecht Reviewed By: brecht CC: brecht Differential Revision: https://developer.blender.org/D284
Diffstat (limited to 'intern')
-rw-r--r--intern/cycles/CMakeLists.txt11
1 files changed, 9 insertions, 2 deletions
diff --git a/intern/cycles/CMakeLists.txt b/intern/cycles/CMakeLists.txt
index f8c4ca68572..5c8d68b07ee 100644
--- a/intern/cycles/CMakeLists.txt
+++ b/intern/cycles/CMakeLists.txt
@@ -15,17 +15,24 @@ include(cmake/external_libs.cmake)
# todo: refactor this code to match scons
if(WIN32 AND MSVC)
+ # /arch:AVX for VC2012 and above
+ if(NOT MSVC_VERSION LESS 1700)
+ set(CYCLES_AVX_ARCH_FLAGS "/arch:AVX")
+ elseif(NOT CMAKE_CL_64)
+ set(CYCLES_AVX_ARCH_FLAGS "/arch:SSE2")
+ endif()
+
# there is no /arch:SSE3, but intrinsics are available anyway
if(CMAKE_CL_64)
set(CYCLES_SSE2_KERNEL_FLAGS "/fp:fast -D_CRT_SECURE_NO_WARNINGS /Gs-")
set(CYCLES_SSE3_KERNEL_FLAGS "/fp:fast -D_CRT_SECURE_NO_WARNINGS /Gs-")
set(CYCLES_SSE41_KERNEL_FLAGS "/fp:fast -D_CRT_SECURE_NO_WARNINGS /Gs-")
- set(CYCLES_AVX_KERNEL_FLAGS "/fp:fast -D_CRT_SECURE_NO_WARNINGS /Gs-") #/arch:AVX for VC2012 and above
+ set(CYCLES_AVX_KERNEL_FLAGS "${CYCLES_AVX_ARCH_FLAGS} /fp:fast -D_CRT_SECURE_NO_WARNINGS /Gs-")
else()
set(CYCLES_SSE2_KERNEL_FLAGS "/arch:SSE2 /fp:fast -D_CRT_SECURE_NO_WARNINGS /Gs-")
set(CYCLES_SSE3_KERNEL_FLAGS "/arch:SSE2 /fp:fast -D_CRT_SECURE_NO_WARNINGS /Gs-")
set(CYCLES_SSE41_KERNEL_FLAGS "/arch:SSE2 /fp:fast -D_CRT_SECURE_NO_WARNINGS /Gs-")
- set(CYCLES_AVX_KERNEL_FLAGS "/arch:SSE2 /fp:fast -D_CRT_SECURE_NO_WARNINGS /Gs-") #/arch:AVX for VC2012 and above
+ set(CYCLES_AVX_KERNEL_FLAGS "${CYCLES_AVX_ARCH_FLAGS} /fp:fast -D_CRT_SECURE_NO_WARNINGS /Gs-")
endif()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /fp:fast -D_CRT_SECURE_NO_WARNINGS /Gs-")