]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR bootstrap/45376 (no such instruction: `pcmpestri $0,(%rdi),%xmm0')
authorRichard Henderson <rth@redhat.com>
Tue, 24 Aug 2010 21:08:05 +0000 (14:08 -0700)
committerRichard Henderson <rth@gcc.gnu.org>
Tue, 24 Aug 2010 21:08:05 +0000 (14:08 -0700)
        PR bootstrap/45376
        * configure.ac (HAVE_SSE4): New check.
        * configure, config.in: Rebuild.
        * lex.c (search_line_sse42): Omit if !HAVE_SSE4.

From-SVN: r163528

libcpp/ChangeLog
libcpp/config.in
libcpp/configure
libcpp/configure.ac
libcpp/lex.c

index b2237e6d48f4cd13553407d6092f94766e6cc719..95918e2f52b67e74e103221898f41139d9da2dc9 100644 (file)
@@ -1,3 +1,10 @@
+2010-08-24  Richard Henderson  <rth@redhat.com>
+
+       PR bootstrap/45376
+       * configure.ac (HAVE_SSE4): New check.
+       * configure, config.in: Rebuild.
+       * lex.c (search_line_sse42): Omit if !HAVE_SSE4.
+
 2010-08-24  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
 
        * lex.c [__sun__ && __svr4__]: Disable init_vectorized_lexer
index 95606c18abf352994b103ca01062b8d4c2a97221..29d4501821a9e66b9cfa6eabee99d2e5fd2247c9 100644 (file)
 /* Define to 1 if you have the `putc_unlocked' function. */
 #undef HAVE_PUTC_UNLOCKED
 
+/* Define to 1 if you can assemble SSE4 insns. */
+#undef HAVE_SSE4
+
 /* Define to 1 if you have the <stddef.h> header file. */
 #undef HAVE_STDDEF_H
 
index a2ce1c3a70a15787b437d3f055d484ef2723bd5a..012ee41c819a2009998cf7dc3ae3a62cba419d9b 100755 (executable)
@@ -7209,6 +7209,27 @@ cat >>confdefs.h <<_ACEOF
 _ACEOF
 
 
+case $target in
+  i?86-* | x86_64-*)
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+asm ("pcmpestri %0, %%xmm0, %%xmm1" : : "i"(0))
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+
+$as_echo "#define HAVE_SSE4 1" >>confdefs.h
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+esac
+
 # Output.
 
 ac_config_headers="$ac_config_headers config.h:config.in"
index 1250f495a9d2ed1ea780a38767040cdb27e27b07..8082117f2d63f5024a629a069e4d969f667d5ef8 100644 (file)
@@ -184,6 +184,13 @@ AC_DEFINE_UNQUOTED(HOST_WIDE_INT, $host_wide_int,
 [Define to the widest efficient host integer type at least
    as wide as the target's size_t type.])
 
+case $target in
+  i?86-* | x86_64-*)
+    AC_TRY_COMPILE([], [asm ("pcmpestri %0, %%xmm0, %%xmm1" : : "i"(0))],
+      [AC_DEFINE([HAVE_SSE4], [1],
+                [Define to 1 if you can assemble SSE4 insns.])])
+esac
+
 # Output.
 
 AC_CONFIG_HEADERS(config.h:config.in, [echo timestamp > stamp-h1])
index a94e57282d8f2f2cd2afd08be49fd25018053ef5..2e962a70bb90d8bef7dd47f419ae8e202f3ec063 100644 (file)
@@ -410,6 +410,7 @@ search_line_sse2 (const uchar *s, const uchar *end ATTRIBUTE_UNUSED)
   return (const uchar *)p + found;
 }
 
+#ifdef HAVE_SSE4
 /* A version of the fast scanner using SSE 4.2 vectorized string insns.  */
 
 static const uchar *
@@ -464,6 +465,11 @@ search_line_sse42 (const uchar *s, const uchar *end)
   return s + index;
 }
 
+#else
+/* Work around out-dated assemblers without sse4 support.  */
+#define search_line_sse42 search_line_sse2
+#endif
+
 /* Check the CPU capabilities.  */
 
 #include "../gcc/config/i386/cpuid.h"