Commit e120037f authored by Erik de Castro Lopo's avatar Erik de Castro Lopo
Browse files

Fix use of FLAC__SSE_OS configure variable

parent e58b36c8
...@@ -219,11 +219,11 @@ AC_HELP_STRING([--disable-sse], [Disable SSE if the OS does not support SSE inst ...@@ -219,11 +219,11 @@ AC_HELP_STRING([--disable-sse], [Disable SSE if the OS does not support SSE inst
no) sse_os=no ;; no) sse_os=no ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-sse) ;; *) AC_MSG_ERROR(bad value ${enableval} for --enable-sse) ;;
esac],[sse_os=yes]) esac],[sse_os=yes])
AM_CONDITIONAL(FLaC__SSE_OS, test "x$sse_os" = xyes)
if test "x$sse_os" = xyes ; then if test "x$sse_os" = xyes ; then
AC_DEFINE(FLAC__SSE_OS) AC_DEFINE_UNQUOTED([FLAC__SSE_OS],[1],[Define if your operating system supports SSE instructions])
AH_TEMPLATE(FLAC__SSE_OS, [define if your operating system supports SSE instructions]) else
fi AC_DEFINE_UNQUOTED([FLAC__SSE_OS],[0])
fi
AC_ARG_ENABLE(altivec, AC_ARG_ENABLE(altivec,
AC_HELP_STRING([--disable-altivec], [Disable Altivec optimizations]), AC_HELP_STRING([--disable-altivec], [Disable Altivec optimizations]),
......
...@@ -109,7 +109,7 @@ static const unsigned FLAC__CPUINFO_IA32_CPUID_AVX2 = 0x00000020; ...@@ -109,7 +109,7 @@ static const unsigned FLAC__CPUINFO_IA32_CPUID_AVX2 = 0x00000020;
/* /*
* Extra stuff needed for detection of OS support for SSE on IA-32 * Extra stuff needed for detection of OS support for SSE on IA-32
*/ */
#if defined(FLAC__CPU_IA32) && !defined FLAC__NO_ASM && (defined FLAC__HAS_NASM || defined FLAC__HAS_X86INTRIN) && !defined FLAC__NO_SSE_OS && !defined FLAC__SSE_OS #if defined(FLAC__CPU_IA32) && !defined FLAC__NO_ASM && (defined FLAC__HAS_NASM || defined FLAC__HAS_X86INTRIN) && !FLAC__SSE_OS
# if defined(__linux__) # if defined(__linux__)
/* /*
* If the OS doesn't support SSE, we will get here with a SIGILL. We * If the OS doesn't support SSE, we will get here with a SIGILL. We
...@@ -206,11 +206,9 @@ void FLAC__cpu_info(FLAC__CPUInfo *info) ...@@ -206,11 +206,9 @@ void FLAC__cpu_info(FLAC__CPUInfo *info)
* now have to check for OS support of SSE instructions * now have to check for OS support of SSE instructions
*/ */
if(info->ia32.sse) { if(info->ia32.sse) {
#if defined FLAC__NO_SSE_OS #if !FLAC__SSE_OS
/* assume user knows better than us; turn it off */ /* assume user knows better than us; turn it off */
disable_sse(info); disable_sse(info);
#elif defined FLAC__SSE_OS
/* assume user knows better than us; leave as detected above */
#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__) || defined(__APPLE__) #elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__) || defined(__APPLE__)
int sse = 0; int sse = 0;
size_t len; size_t len;
...@@ -238,7 +236,7 @@ void FLAC__cpu_info(FLAC__CPUInfo *info) ...@@ -238,7 +236,7 @@ void FLAC__cpu_info(FLAC__CPUInfo *info)
# endif # endif
#elif defined(__ANDROID__) || defined(ANDROID) #elif defined(__ANDROID__) || defined(ANDROID)
/* no need to check OS SSE support */ /* no need to check OS SSE support */
#elif defined(__linux__) #elif defined(__linux__) && !FLAC__SSE_OS
int sse = 0; int sse = 0;
struct sigaction sigill_save; struct sigaction sigill_save;
struct sigaction sigill_sse; struct sigaction sigill_sse;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment