- added a check for streflop usage for the following (in the order shown):

- SSE support
  - X86 (streflop's X87) support
  - Soft emulation is the default fallback if sse and x86 are not valid for the compiler
This commit is contained in:
Mark Vejvoda
2011-12-24 03:20:21 +00:00
parent 33c557ff35
commit 7d0cf06fe1
2 changed files with 65 additions and 11 deletions

View File

@@ -104,6 +104,34 @@ macro(special_check_for_sse _max_sse_level_desired)
endif()
endmacro(special_check_for_sse)
macro(special_check_for_x87)
# check for X87 support
include(CheckCXXSourceRuns)
if( CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX )
check_cxx_source_runs("
int main()
{
unsigned short fpu_mode;
do { asm volatile (\"fstcw %0\" : \"=m\" (fpu_mode) : ); } while (0);
fpu_mode &= 0xFCFF;
do { asm volatile (\"fclex \\\\n fldcw %0\" : : \"m\" (fpu_mode)); } while (0);
return 0;
}"
HAS_X87_SUPPORT)
if(HAS_X87_SUPPORT)
message(STATUS "Found X87 support.")
endif()
elseif(MSVC)
set(HAS_X87_SUPPORT On)
endif()
endmacro(special_check_for_x87)
macro(special_add_compile_flags target)
set(args ${ARGN})
separate_arguments(args)