summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Schleef <ds@ginger.bigkitten.com>2008-05-12 17:08:50 -0700
committerDavid Schleef <ds@ginger.bigkitten.com>2008-05-12 17:08:50 -0700
commite1c2b6e84c82615200172d627d9e0214def3f141 (patch)
treee8295c35e5b528e3c466311ec28bcffc7a43c4d0
parentec0d0c9de2064953a57c076751741945b0dff87c (diff)
Check for gcc-4.2 for intrinsics, since we need gcc to realign the
stack when higher-level libraries (this means you, mozilla) unalign it. Fixes #11145.
-rw-r--r--m4/as-intrinsics.m424
1 files changed, 21 insertions, 3 deletions
diff --git a/m4/as-intrinsics.m4 b/m4/as-intrinsics.m4
index 9fb5829..4781ebd 100644
--- a/m4/as-intrinsics.m4
+++ b/m4/as-intrinsics.m4
@@ -43,7 +43,13 @@ AC_DEFUN([AS_SSE_INTRINSICS],
save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -msse"
- AC_TRY_COMPILE([#include <xmmintrin.h>], [__m128 a; a = _mm_or_ps(a,a)], [flag_ok=yes], [flag_ok=no])
+ AC_TRY_COMPILE([#include <xmmintrin.h>], [
+#ifdef __GNUC_MINOR__
+#if (__GNUC__ * 1000 + __GNUC_MINOR__) < 4002
+#error GCC before 4.2 has critical bugs compiling SSE intrinsics
+#endif
+#endif
+__m128 a; a = _mm_or_ps(a,a)], [flag_ok=yes], [flag_ok=no])
CFLAGS="$save_CFLAGS"
$1="-msse"
@@ -69,7 +75,13 @@ AC_DEFUN([AS_SSE2_INTRINSICS],
save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -msse2"
- AC_TRY_COMPILE([#include <emmintrin.h>], [__m128i a; a = _mm_setzero_si128(); a = _mm_srli_epi16(a,8)], [flag_ok=yes], [flag_ok=no])
+ AC_TRY_COMPILE([#include <emmintrin.h>], [
+#ifdef __GNUC_MINOR__
+#if (__GNUC__ * 1000 + __GNUC_MINOR__) < 4002
+#error GCC before 4.2 has critical bugs compiling SSE2 intrinsics
+#endif
+#endif
+__m128i a; a = _mm_setzero_si128(); a = _mm_srli_epi16(a,8)], [flag_ok=yes], [flag_ok=no])
CFLAGS="$save_CFLAGS"
$1="-msse2"
@@ -95,7 +107,13 @@ AC_DEFUN([AS_SSE3_INTRINSICS],
save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -msse3"
- AC_TRY_COMPILE([#include <pmmintrin.h>], [__m128 a; a = _mm_addsub_ps(a,a)], [flag_ok=yes], [flag_ok=no])
+ AC_TRY_COMPILE([#include <pmmintrin.h>], [
+#ifdef __GNUC_MINOR__
+#if (__GNUC__ * 1000 + __GNUC_MINOR__) < 4002
+#error GCC before 4.2 has critical bugs compiling SSE2 intrinsics
+#endif
+#endif
+__m128 a; a = _mm_addsub_ps(a,a)], [flag_ok=yes], [flag_ok=no])
CFLAGS="$save_CFLAGS"
$1="-msse3"