Remove SIMD path at the moment. It needs to be reworked.

This commit is contained in:
Pavel Krajcevski 2013-01-28 16:37:20 -05:00
parent 5dd1fbbd48
commit aaf16eacc8

View file

@ -47,98 +47,98 @@ INCLUDE_DIRECTORIES(${TexC_BINARY_DIR}/BPTCEncoder/include)
INCLUDE(CheckCXXSourceRuns) INCLUDE(CheckCXXSourceRuns)
SET(OLD_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS}) #SET(OLD_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS})
IF(CMAKE_COMPILER_IS_GNUCC) #IF(CMAKE_COMPILER_IS_GNUCC)
#
# Test whether or not the compiler allows inline # # Test whether or not the compiler allows inline
# assmbly... # # assmbly...
CHECK_CXX_SOURCE_RUNS(" # CHECK_CXX_SOURCE_RUNS("
\#ifdef _MSC_VER # \#ifdef _MSC_VER
int main() { # int main() {
int x = 1, y = 0; # int x = 1, y = 0;
__asm { # __asm {
mov eax, x # mov eax, x
mov y, eax # mov y, eax
} # }
return !y; # return !y;
} # }
\#else # \#else
int main() { # int main() {
int x = 1, y = 0; # int x = 1, y = 0;
__asm__ (\"movl %1, %%eax;\" # __asm__ (\"movl %1, %%eax;\"
\"movl %%eax, %0;\" # \"movl %%eax, %0;\"
:\"=r\"(y) /* output */ # :\"=r\"(y) /* output */
:\"r\"(x) /* input */ # :\"r\"(x) /* input */
:\"%eax\" /* clobbered register */ # :\"%eax\" /* clobbered register */
); # );
#
return !y; # return !y;
} # }
\#endif" # \#endif"
HAS_INLINE_ASSEMBLY # HAS_INLINE_ASSEMBLY
) # )
#
# If the compiler doesn't allow it, then try with a # # If the compiler doesn't allow it, then try with a
# compiler flag... # # compiler flag...
IF( NOT HAS_INLINE_ASSEMBLY ) # IF( NOT HAS_INLINE_ASSEMBLY )
SET(CMAKE_REQUIRED_FLAGS -fasm-blocks) # SET(CMAKE_REQUIRED_FLAGS -fasm-blocks)
CHECK_CXX_SOURCE_RUNS(" # CHECK_CXX_SOURCE_RUNS("
\#ifdef _MSC_VER # \#ifdef _MSC_VER
int main() { # int main() {
int x = 1, y = 0; # int x = 1, y = 0;
__asm { # __asm {
mov eax, x # mov eax, x
mov y, eax # mov y, eax
} # }
return !y; # return !y;
} # }
\#else # \#else
int main() { # int main() {
int x = 1, y = 0; # int x = 1, y = 0;
__asm__ (\"movl %1, %%eax;\" # __asm__ (\"movl %1, %%eax;\"
\"movl %%eax, %0;\" # \"movl %%eax, %0;\"
:\"=r\"(y) /* output */ # :\"=r\"(y) /* output */
:\"r\"(x) /* input */ # :\"r\"(x) /* input */
:\"%eax\" /* clobbered register */ # :\"%eax\" /* clobbered register */
); # );
#
return !y; # return !y;
} # }
\#endif" # \#endif"
HAS_INLINE_ASSEMBLY_WITH_FLAGS # HAS_INLINE_ASSEMBLY_WITH_FLAGS
) # )
ENDIF() # ENDIF()
#
SET(CMAKE_REQUIRED_FLAGS -msse4.1) # SET(CMAKE_REQUIRED_FLAGS -msse4.1)
CHECK_CXX_SOURCE_RUNS(" # CHECK_CXX_SOURCE_RUNS("
#include <smmintrin.h> # #include <smmintrin.h>
int main() { # int main() {
const __m128 fv = _mm_set1_ps(1.0f); # const __m128 fv = _mm_set1_ps(1.0f);
const __m128 fv2 = _mm_set1_ps(2.0f); # const __m128 fv2 = _mm_set1_ps(2.0f);
#
const __m128 ans = _mm_blend_ps(fv, fv2, 2); # const __m128 ans = _mm_blend_ps(fv, fv2, 2);
#
return ((int *)(&ans))[0]; # return ((int *)(&ans))[0];
}" # }"
HAS_SSE_41 # HAS_SSE_41
) # )
#
IF(HAS_SSE_41) # IF(HAS_SSE_41)
SET(CMAKE_REQUIRED_FLAGS -msse4.2) # SET(CMAKE_REQUIRED_FLAGS -msse4.2)
CHECK_CXX_SOURCE_RUNS(" # CHECK_CXX_SOURCE_RUNS("
#include <smmintrin.h> # #include <smmintrin.h>
int main() { # int main() {
const unsigned int testMe = 5; # const unsigned int testMe = 5;
return !(2 == _mm_popcnt_u32(testMe)); # return !(2 == _mm_popcnt_u32(testMe));
}" # }"
HAS_SSE_POPCNT # HAS_SSE_POPCNT
) # )
ENDIF(HAS_SSE_41) # ENDIF(HAS_SSE_41)
#
ELSEIF(MSVC) #ELSEIF(MSVC)
#!FIXME! ##!FIXME!
ENDIF() #ENDIF()
SET(CMAKE_REQUIRED_FLAGS ${OLD_CMAKE_REQUIRED_FLAGS}) #SET(CMAKE_REQUIRED_FLAGS ${OLD_CMAKE_REQUIRED_FLAGS})
IF( NOT HAS_INLINE_ASSEMBLY AND NOT HAS_INLINE_ASSEMBLY_WITH_FLAGS ) IF( NOT HAS_INLINE_ASSEMBLY AND NOT HAS_INLINE_ASSEMBLY_WITH_FLAGS )
SET( NO_INLINE_ASSEMBLY true ) SET( NO_INLINE_ASSEMBLY true )