~ubuntu-branches/ubuntu/vivid/rtfilter/vivid

« back to all changes in this revision

Viewing changes to m4/fastmath.m4

  • Committer: Package Import Robot
  • Author(s): Nicolas Bourdaud
  • Date: 2011-12-01 12:09:30 UTC
  • Revision ID: package-import@ubuntu.com-20111201120930-lmia8ytlwmif9yta
Tags: upstream-1.1
ImportĀ upstreamĀ versionĀ 1.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
AC_DEFUN([AC_CHECK_FASTMATH_FLAG],
 
2
[
 
3
  AC_REQUIRE([AC_PROG_CC])
 
4
  AC_MSG_CHECKING([for fast math compiler flag])
 
5
  fm_save_CFLAGS="$CFLAGS"
 
6
  CFLAGS="-ffast-math $CFLAGS"
 
7
  FASTMATH_CFLAG=
 
8
  AC_TRY_COMPILE(
 
9
        [],
 
10
        [],
 
11
        gl_cv_cc_fastmath=yes,
 
12
        gl_cv_cc_fastmath=no)
 
13
  CFLAGS="$fm_save_CFLAGS"
 
14
  if test $gl_cv_cc_fastmath = yes; then
 
15
    FASTMATH_CFLAG="-ffast-math"
 
16
  fi
 
17
  AC_MSG_RESULT([$gl_cv_cc_fastmath])
 
18
  AC_SUBST([FASTMATH_CFLAG])
 
19
])
 
20
 
 
21
 
 
22
AC_DEFUN([AC_USE_SSEMATH],
 
23
[
 
24
  AC_REQUIRE([AC_PROG_CC])
 
25
  AC_MSG_CHECKING([for sse based math flag])
 
26
  sm_save_CFLAGS="$CFLAGS"
 
27
  CFLAGS="-mfpmath=sse $CFLAGS"
 
28
  AC_TRY_COMPILE(
 
29
        [],
 
30
        [],
 
31
        gl_cv_cc_ssemath=yes,
 
32
        gl_cv_cc_ssemath=no)
 
33
  CFLAGS="$sm_save_CFLAGS"
 
34
  if test $gl_cv_cc_ssemath = yes; then
 
35
    CFLAGS="-mfpmath=sse $CFLAGS"
 
36
  fi
 
37
  AC_MSG_RESULT([$gl_cv_cc_ssemath])
 
38
  AC_SUBST([CFLAGS])
 
39
])
 
40