Skip to content

Commit

Permalink
Better handling of multiple SIMD args (such as USE_SIMD=avx,f16c).
Browse files Browse the repository at this point in the history
It botched this when passing along to precompiling for LLVM.
  • Loading branch information
lgritz committed Feb 8, 2016
1 parent ff4d97a commit 1fb848c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,7 @@ if (USE_LIBCPLUSPLUS AND CMAKE_COMPILER_IS_CLANG)
add_definitions ("-stdlib=libc++")
endif ()

set (OSL_SIMD_FLAGS "")
if (NOT USE_SIMD STREQUAL "")
message (STATUS "Compiling with SIMD level ${USE_SIMD}")
if (USE_SIMD STREQUAL "0")
Expand All @@ -301,8 +302,10 @@ if (NOT USE_SIMD STREQUAL "")
endif ()
if (MSVC OR CMAKE_COMPILER_IS_INTEL)
add_definitions ("/arch:${feature}")
set (OSL_SIMD_FLAGS ${OSL_SIMD_FLAGS} "/arch:${feature}")
else ()
add_definitions ("-m${feature}")
set (OSL_SIMD_FLAGS ${OSL_SIMD_FLAGS} "-m${feature}")
endif ()
endforeach()
endif ()
Expand Down
4 changes: 1 addition & 3 deletions src/liboslexec/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,7 @@ MACRO ( LLVM_COMPILE llvm_src srclist )
foreach (def ${CURRENT_DEFINITIONS})
set (LLVM_COMPILE_FLAGS ${LLVM_COMPILE_FLAGS} "-D${def}")
endforeach()
if (USE_SIMD)
set (LLVM_COMPILE_FLAGS ${LLVM_COMPILE_FLAGS} "-m${USE_SIMD}")
endif ()
set (LLVM_COMPILE_FLAGS ${LLVM_COMPILE_FLAGS} ${OSL_SIMD_FLAGS})

# Figure out what program we will use to make the bitcode.
if (NOT LLVM_BC_GENERATOR)
Expand Down

0 comments on commit 1fb848c

Please sign in to comment.