lex.c (search_line_sse42): Use __builtin_ia32_loaddqu and __builtin_ia32_pcmpestri128...
authorUros Bizjak <ubizjak@gmail.com>
Tue, 19 Jun 2012 16:28:50 +0000 (18:28 +0200)
committerUros Bizjak <uros@gcc.gnu.org>
Tue, 19 Jun 2012 16:28:50 +0000 (18:28 +0200)
* lex.c (search_line_sse42): Use __builtin_ia32_loaddqu and
__builtin_ia32_pcmpestri128 instead of asm.

From-SVN: r188782

libcpp/ChangeLog
libcpp/lex.c

index fb4bac63f7bfb6b9fc83c9acf605381ff0c58458..312fd8d97b827ef4cfe2c48ae6d7685de88723e6 100644 (file)
@@ -1,3 +1,8 @@
+2011-06-19  Uros Bizjak  <ubizjak@gmail.com>
+
+       * lex.c (search_line_sse42): Use __builtin_ia32_loaddqu and
+       __builtin_ia32_pcmpestri128 instead of asm.
+
 2012-06-04  Dimitrios Apostolou <jimis@gmx.net>
 
        * line-map.c (linemap_enter_macro): Don't zero max_column_hint in
index 98ee4e92da393d7c88c24e871e6a2d93f7711c48..ab904db58bedb3c53815203573f32509ec33987a 100644 (file)
@@ -427,6 +427,8 @@ search_line_sse42 (const uchar *s, const uchar *end)
   /* Check for unaligned input.  */
   if (si & 15)
     {
+      v16qi sv;
+
       if (__builtin_expect (end - s < 16, 0)
          && __builtin_expect ((si & 0xfff) > 0xff0, 0))
        {
@@ -439,8 +441,9 @@ search_line_sse42 (const uchar *s, const uchar *end)
 
       /* ??? The builtin doesn't understand that the PCMPESTRI read from
         memory need not be aligned.  */
-      __asm ("%vpcmpestri $0, (%1), %2"
-            : "=c"(index) : "r"(s), "x"(search), "a"(4), "d"(16));
+      sv = __builtin_ia32_loaddqu ((const char *) s);
+      index = __builtin_ia32_pcmpestri128 (search, 4, sv, 16, 0);
+
       if (__builtin_expect (index < 16, 0))
        goto found;