summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortico-tico <sergei.ivn@gmx.com>2019-01-25 16:40:16 +0300
committerThomas Daede <daede003@umn.edu>2019-01-28 15:53:46 -0800
commitc8e0bf6620499100402ddd823c1dc07d339808a0 (patch)
treeb1563a29a64713934b65466f0ce20819b659f463
parent3a1344bc67ca006c102c4ca891aba9b5100e3e30 (diff)
downloadlibvorbis-git-c8e0bf6620499100402ddd823c1dc07d339808a0.tar.gz
Check for sse2 math before using it.
-rw-r--r--lib/os.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/os.h b/lib/os.h
index e0989263..e589a336 100644
--- a/lib/os.h
+++ b/lib/os.h
@@ -80,7 +80,7 @@ void *_alloca(size_t size);
/* Special i386 GCC implementation */
-#if defined(__i386__) && defined(__GNUC__) && !defined(__BEOS__)
+#if defined(__i386__) && defined(__GNUC__) && !defined(__BEOS__) && !defined(__SSE2_MATH__)
# define VORBIS_FPU_CONTROL
/* both GCC and MSVC are kinda stupid about rounding/casting to int.
Because of encapsulation constraints (GCC can't see inside the asm
@@ -147,7 +147,7 @@ static __inline void vorbis_fpu_restore(vorbis_fpu_control fpu){
/* Optimized code path for x86_64 builds. Uses SSE2 intrinsics. This can be
done safely because all x86_64 CPUs supports SSE2. */
-#if (defined(_MSC_VER) && defined(_WIN64)) || (defined(__GNUC__) && defined (__x86_64__))
+#if (defined(_MSC_VER) && defined(_WIN64)) || (defined(__GNUC__) && defined (__SSE2_MATH__))
# define VORBIS_FPU_CONTROL
typedef ogg_int16_t vorbis_fpu_control;