From aaf16eacc8b0f4cd21383f0a9789061d4517dd8a Mon Sep 17 00:00:00 2001 From: Pavel Krajcevski Date: Mon, 28 Jan 2013 16:37:20 -0500 Subject: [PATCH] Remove SIMD path at the moment. It needs to be reworked. --- BPTCEncoder/CMakeLists.txt | 184 ++++++++++++++++++------------------- 1 file changed, 92 insertions(+), 92 deletions(-) diff --git a/BPTCEncoder/CMakeLists.txt b/BPTCEncoder/CMakeLists.txt index e24f16c..9298f6c 100644 --- a/BPTCEncoder/CMakeLists.txt +++ b/BPTCEncoder/CMakeLists.txt @@ -47,98 +47,98 @@ INCLUDE_DIRECTORIES(${TexC_BINARY_DIR}/BPTCEncoder/include) INCLUDE(CheckCXXSourceRuns) -SET(OLD_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS}) -IF(CMAKE_COMPILER_IS_GNUCC) - - # Test whether or not the compiler allows inline - # assmbly... - CHECK_CXX_SOURCE_RUNS(" - \#ifdef _MSC_VER - int main() { - int x = 1, y = 0; - __asm { - mov eax, x - mov y, eax - } - return !y; - } - \#else - int main() { - int x = 1, y = 0; - __asm__ (\"movl %1, %%eax;\" - \"movl %%eax, %0;\" - :\"=r\"(y) /* output */ - :\"r\"(x) /* input */ - :\"%eax\" /* clobbered register */ - ); - - return !y; - } - \#endif" - HAS_INLINE_ASSEMBLY - ) - - # If the compiler doesn't allow it, then try with a - # compiler flag... - IF( NOT HAS_INLINE_ASSEMBLY ) - SET(CMAKE_REQUIRED_FLAGS -fasm-blocks) - CHECK_CXX_SOURCE_RUNS(" - \#ifdef _MSC_VER - int main() { - int x = 1, y = 0; - __asm { - mov eax, x - mov y, eax - } - return !y; - } - \#else - int main() { - int x = 1, y = 0; - __asm__ (\"movl %1, %%eax;\" - \"movl %%eax, %0;\" - :\"=r\"(y) /* output */ - :\"r\"(x) /* input */ - :\"%eax\" /* clobbered register */ - ); - - return !y; - } - \#endif" - HAS_INLINE_ASSEMBLY_WITH_FLAGS - ) - ENDIF() - - SET(CMAKE_REQUIRED_FLAGS -msse4.1) - CHECK_CXX_SOURCE_RUNS(" - #include - int main() { - const __m128 fv = _mm_set1_ps(1.0f); - const __m128 fv2 = _mm_set1_ps(2.0f); - - const __m128 ans = _mm_blend_ps(fv, fv2, 2); - - return ((int *)(&ans))[0]; - }" - HAS_SSE_41 - ) - - IF(HAS_SSE_41) - SET(CMAKE_REQUIRED_FLAGS -msse4.2) - CHECK_CXX_SOURCE_RUNS(" - #include - int main() { - const unsigned int testMe = 5; - return !(2 == _mm_popcnt_u32(testMe)); - }" - HAS_SSE_POPCNT - ) - ENDIF(HAS_SSE_41) - -ELSEIF(MSVC) -#!FIXME! -ENDIF() -SET(CMAKE_REQUIRED_FLAGS ${OLD_CMAKE_REQUIRED_FLAGS}) +#SET(OLD_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS}) +#IF(CMAKE_COMPILER_IS_GNUCC) +# +# # Test whether or not the compiler allows inline +# # assmbly... +# CHECK_CXX_SOURCE_RUNS(" +# \#ifdef _MSC_VER +# int main() { +# int x = 1, y = 0; +# __asm { +# mov eax, x +# mov y, eax +# } +# return !y; +# } +# \#else +# int main() { +# int x = 1, y = 0; +# __asm__ (\"movl %1, %%eax;\" +# \"movl %%eax, %0;\" +# :\"=r\"(y) /* output */ +# :\"r\"(x) /* input */ +# :\"%eax\" /* clobbered register */ +# ); +# +# return !y; +# } +# \#endif" +# HAS_INLINE_ASSEMBLY +# ) +# +# # If the compiler doesn't allow it, then try with a +# # compiler flag... +# IF( NOT HAS_INLINE_ASSEMBLY ) +# SET(CMAKE_REQUIRED_FLAGS -fasm-blocks) +# CHECK_CXX_SOURCE_RUNS(" +# \#ifdef _MSC_VER +# int main() { +# int x = 1, y = 0; +# __asm { +# mov eax, x +# mov y, eax +# } +# return !y; +# } +# \#else +# int main() { +# int x = 1, y = 0; +# __asm__ (\"movl %1, %%eax;\" +# \"movl %%eax, %0;\" +# :\"=r\"(y) /* output */ +# :\"r\"(x) /* input */ +# :\"%eax\" /* clobbered register */ +# ); +# +# return !y; +# } +# \#endif" +# HAS_INLINE_ASSEMBLY_WITH_FLAGS +# ) +# ENDIF() +# +# SET(CMAKE_REQUIRED_FLAGS -msse4.1) +# CHECK_CXX_SOURCE_RUNS(" +# #include +# int main() { +# const __m128 fv = _mm_set1_ps(1.0f); +# const __m128 fv2 = _mm_set1_ps(2.0f); +# +# const __m128 ans = _mm_blend_ps(fv, fv2, 2); +# +# return ((int *)(&ans))[0]; +# }" +# HAS_SSE_41 +# ) +# +# IF(HAS_SSE_41) +# SET(CMAKE_REQUIRED_FLAGS -msse4.2) +# CHECK_CXX_SOURCE_RUNS(" +# #include +# int main() { +# const unsigned int testMe = 5; +# return !(2 == _mm_popcnt_u32(testMe)); +# }" +# HAS_SSE_POPCNT +# ) +# ENDIF(HAS_SSE_41) +# +#ELSEIF(MSVC) +##!FIXME! +#ENDIF() +#SET(CMAKE_REQUIRED_FLAGS ${OLD_CMAKE_REQUIRED_FLAGS}) IF( NOT HAS_INLINE_ASSEMBLY AND NOT HAS_INLINE_ASSEMBLY_WITH_FLAGS ) SET( NO_INLINE_ASSEMBLY true )