File: FindSIMD64.cmake

package info (click to toggle)
libsoxr 0.1.3-4.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 840 kB
  • sloc: ansic: 8,011; sh: 284; cpp: 40; makefile: 13
file content (29 lines) | stat: -rw-r--r-- 788 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# SoX Resampler Library       Copyright (c) 2007-16 robs@users.sourceforge.net
# Licence for this file: LGPL v2.1                  See LICENCE for details.

# - Finds SIMD64 support
#
# The following variables are set:
#   SIMD64_C_FLAGS - flags to add to the C compiler for this package.
#   SIMD64_FOUND - true if support for this package is found.

if (DEFINED SIMD64_C_FLAGS OR CMAKE_SYSTEM_PROCESSOR MATCHES "^arm")
  set (TRIAL_C_FLAGS)
else ()
  set (TRIAL_C_FLAGS
    "-mavx" # Gcc
    "/arch:AVX" # MSVC
  )
  set (TEST_C_SOURCE "
    #ifndef __AVX__
      #error
    #endif
    #include <immintrin.h>
    int main() {return 0;}
    ")
endif ()

include (FindCFlags)

FindCFlags ("SIMD64" "FLOAT-64 (double-precision) SIMD vectorization"
  "${TRIAL_C_FLAGS}" "${TEST_C_SOURCE}")