CMakeLists.txt
changeset 10835 0e9e7a128391
parent 10777 2883d23b5a28
child 10848 7764aba2f211
equal deleted inserted replaced
10834:336efe4fc373 10835:0e9e7a128391
   260 set_option(SSEMATH             "Allow GCC to use SSE floating point math" ${OPT_DEF_SSEMATH})
   260 set_option(SSEMATH             "Allow GCC to use SSE floating point math" ${OPT_DEF_SSEMATH})
   261 set_option(MMX                 "Use MMX assembly routines" ${OPT_DEF_ASM})
   261 set_option(MMX                 "Use MMX assembly routines" ${OPT_DEF_ASM})
   262 set_option(3DNOW               "Use 3Dnow! MMX assembly routines" ${OPT_DEF_ASM})
   262 set_option(3DNOW               "Use 3Dnow! MMX assembly routines" ${OPT_DEF_ASM})
   263 set_option(SSE                 "Use SSE assembly routines" ${OPT_DEF_ASM})
   263 set_option(SSE                 "Use SSE assembly routines" ${OPT_DEF_ASM})
   264 set_option(SSE2                "Use SSE2 assembly routines" ${OPT_DEF_SSEMATH})
   264 set_option(SSE2                "Use SSE2 assembly routines" ${OPT_DEF_SSEMATH})
       
   265 set_option(SSE3                "Use SSE3 assembly routines" ${OPT_DEF_SSEMATH})
   265 set_option(ALTIVEC             "Use Altivec assembly routines" ${OPT_DEF_ASM})
   266 set_option(ALTIVEC             "Use Altivec assembly routines" ${OPT_DEF_ASM})
   266 set_option(DISKAUDIO           "Support the disk writer audio driver" ON)
   267 set_option(DISKAUDIO           "Support the disk writer audio driver" ON)
   267 set_option(DUMMYAUDIO          "Support the dummy audio driver" ON)
   268 set_option(DUMMYAUDIO          "Support the dummy audio driver" ON)
   268 set_option(VIDEO_DIRECTFB      "Use DirectFB video driver" OFF)
   269 set_option(VIDEO_DIRECTFB      "Use DirectFB video driver" OFF)
   269 dep_option(DIRECTFB_SHARED     "Dynamically load directfb support" ON "VIDEO_DIRECTFB" OFF)
   270 dep_option(DIRECTFB_SHARED     "Dynamically load directfb support" ON "VIDEO_DIRECTFB" OFF)
   514         list(APPEND EXTRA_CFLAGS "-msse2")
   515         list(APPEND EXTRA_CFLAGS "-msse2")
   515       endif()
   516       endif()
   516       set(CMAKE_REQUIRED_FLAGS ${ORIG_CMAKE_REQUIRED_FLAGS})
   517       set(CMAKE_REQUIRED_FLAGS ${ORIG_CMAKE_REQUIRED_FLAGS})
   517     endif()
   518     endif()
   518 
   519 
       
   520     if(SSE3)
       
   521       set(CMAKE_REQUIRED_FLAGS "-msse3")
       
   522       check_c_source_compiles("
       
   523           #ifdef __MINGW32__
       
   524           #include <_mingw.h>
       
   525           #ifdef __MINGW64_VERSION_MAJOR
       
   526           #include <intrin.h>
       
   527           #else
       
   528           #include <pmmintrin.h>
       
   529           #endif
       
   530           #else
       
   531           #include <pmmintrin.h>
       
   532           #endif
       
   533           #ifndef __SSE3__
       
   534           #error Assembler CPP flag not enabled
       
   535           #endif
       
   536           int main(int argc, char **argv) { }" HAVE_SSE3)
       
   537       if(HAVE_SSE3)
       
   538         list(APPEND EXTRA_CFLAGS "-msse3")
       
   539       endif()
       
   540       set(CMAKE_REQUIRED_FLAGS ${ORIG_CMAKE_REQUIRED_FLAGS})
       
   541     endif()
       
   542 
   519     if(SSEMATH)
   543     if(SSEMATH)
   520       if(SSE OR SSE2)
   544       if(SSE OR SSE2 OR SSE3)
   521         if(USE_GCC)
   545         if(USE_GCC)
   522           list(APPEND EXTRA_CFLAGS "-mfpmath=387")
   546           list(APPEND EXTRA_CFLAGS "-mfpmath=387")
   523         endif()
   547         endif()
   524         set(HAVE_SSEMATH TRUE)
   548         set(HAVE_SSEMATH TRUE)
   525       endif()
   549       endif()
   555       set(HAVE_MMX TRUE)
   579       set(HAVE_MMX TRUE)
   556       set(HAVE_3DNOW TRUE)
   580       set(HAVE_3DNOW TRUE)
   557     endif()
   581     endif()
   558     set(HAVE_SSE TRUE)
   582     set(HAVE_SSE TRUE)
   559     set(HAVE_SSE2 TRUE)
   583     set(HAVE_SSE2 TRUE)
       
   584     set(HAVE_SSE3 TRUE)
   560     set(SDL_ASSEMBLY_ROUTINES 1)
   585     set(SDL_ASSEMBLY_ROUTINES 1)
   561   endif()
   586   endif()
   562 # TODO:
   587 # TODO:
   563 #else()
   588 #else()
   564 #  if(USE_GCC OR USE_CLANG)
   589 #  if(USE_GCC OR USE_CLANG)
   565 #    list(APPEND EXTRA_CFLAGS "-mno-sse" "-mno-sse2" "-mno-mmx")
   590 #    list(APPEND EXTRA_CFLAGS "-mno-sse" "-mno-sse2" "-mno-sse3" "-mno-mmx")
   566 #  endif()
   591 #  endif()
   567 endif()
   592 endif()
   568 
   593 
   569 # TODO: Can't deactivate on FreeBSD? w/o LIBC, SDL_stdinc.h can't define
   594 # TODO: Can't deactivate on FreeBSD? w/o LIBC, SDL_stdinc.h can't define
   570 # anything.
   595 # anything.