mirror of
https://github.com/yuzu-emu/FasTC
synced 2024-11-23 01:43:39 +00:00
Remove SIMD path at the moment. It needs to be reworked.
This commit is contained in:
parent
5dd1fbbd48
commit
aaf16eacc8
1 changed files with 92 additions and 92 deletions
|
@ -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 <smmintrin.h>
|
||||
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 <smmintrin.h>
|
||||
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 <smmintrin.h>
|
||||
# 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 <smmintrin.h>
|
||||
# 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 )
|
||||
|
|
Loading…
Reference in a new issue