public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r11-6664] i386: Fix the pmovzx SSE4.1 define_insn_and_split patterns [PR98670]
@ 2021-01-14 11:56 Jakub Jelinek
  0 siblings, 0 replies; only message in thread
From: Jakub Jelinek @ 2021-01-14 11:56 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:0efdc7b31c2aeb3b0414a838e90014172b87302f

commit r11-6664-g0efdc7b31c2aeb3b0414a838e90014172b87302f
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Thu Jan 14 12:55:19 2021 +0100

    i386: Fix the pmovzx SSE4.1 define_insn_and_split patterns [PR98670]
    
    I've made two mistakes in the *sse4_1_zero_extend* define_insn_and_split
    patterns.  One is that when it uses vector_operand, it should use Bm rather
    than m constraint, and the other one is that because it is a post-reload
    splitter it needs isa attribute to select which alternatives are valid for
    which ISAs.  Sorry for messing this up.
    
    2021-01-14  Jakub Jelinek  <jakub@redhat.com>
    
            PR target/98670
            * config/i386/sse.md (*sse4_1_zero_extendv8qiv8hi2_3,
            *sse4_1_zero_extendv4hiv4si2_3, *sse4_1_zero_extendv2siv2di2_3):
            Use Bm instead of m for non-avx.  Add isa attribute.
    
            * gcc.target/i386/pr98670.c: New test.

Diff:
---
 gcc/config/i386/sse.md                  | 15 +++++++++------
 gcc/testsuite/gcc.target/i386/pr98670.c | 16 ++++++++++++++++
 2 files changed, 25 insertions(+), 6 deletions(-)

diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md
index 7f03fc491c3..42d4c447182 100644
--- a/gcc/config/i386/sse.md
+++ b/gcc/config/i386/sse.md
@@ -17721,7 +17721,7 @@
   [(set (match_operand:V16QI 0 "register_operand" "=Yr,*x,v")
 	(vec_select:V16QI
 	  (vec_concat:V32QI
-	    (match_operand:V16QI 1 "vector_operand" "Yrm,*xm,vm")
+	    (match_operand:V16QI 1 "vector_operand" "YrBm,*xBm,vm")
 	    (match_operand:V16QI 2 "const0_operand" "C,C,C"))
 	  (match_parallel 3 "pmovzx_parallel"
 	    [(match_operand 4 "const_int_operand" "n,n,n")])))]
@@ -17745,7 +17745,8 @@
       emit_insn (gen_rtx_SET (operands[0], operands[1]));
       DONE;
     }
-})
+}
+  [(set_attr "isa" "noavx,noavx,avx")])
 
 (define_expand "<insn>v8qiv8hi2"
   [(set (match_operand:V8HI 0 "register_operand")
@@ -18031,7 +18032,7 @@
   [(set (match_operand:V8HI 0 "register_operand" "=Yr,*x,v")
 	(vec_select:V8HI
 	  (vec_concat:V16HI
-	    (match_operand:V8HI 1 "vector_operand" "Yrm,*xm,vm")
+	    (match_operand:V8HI 1 "vector_operand" "YrBm,*xBm,vm")
 	    (match_operand:V8HI 2 "const0_operand" "C,C,C"))
 	  (match_parallel 3 "pmovzx_parallel"
 	    [(match_operand 4 "const_int_operand" "n,n,n")])))]
@@ -18053,7 +18054,8 @@
       emit_insn (gen_rtx_SET (operands[0], operands[1]));
       DONE;
     }
-})
+}
+  [(set_attr "isa" "noavx,noavx,avx")])
 
 (define_insn "avx512f_<code>v8qiv8di2<mask_name>"
   [(set (match_operand:V8DI 0 "register_operand" "=v")
@@ -18447,7 +18449,7 @@
   [(set (match_operand:V4SI 0 "register_operand" "=Yr,*x,v")
 	(vec_select:V4SI
 	  (vec_concat:V8SI
-	    (match_operand:V4SI 1 "vector_operand" "Yrm,*xm,vm")
+	    (match_operand:V4SI 1 "vector_operand" "YrBm,*xBm,vm")
 	    (match_operand:V4SI 2 "const0_operand" "C,C,C"))
 	  (match_parallel 3 "pmovzx_parallel"
 	    [(match_operand 4 "const_int_operand" "n,n,n")])))]
@@ -18467,7 +18469,8 @@
       emit_insn (gen_rtx_SET (operands[0], operands[1]));
       DONE;
     }
-})
+}
+  [(set_attr "isa" "noavx,noavx,avx")])
 
 (define_expand "<insn>v2siv2di2"
   [(set (match_operand:V2DI 0 "register_operand")
diff --git a/gcc/testsuite/gcc.target/i386/pr98670.c b/gcc/testsuite/gcc.target/i386/pr98670.c
new file mode 100644
index 00000000000..34a0095cceb
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr98670.c
@@ -0,0 +1,16 @@
+/* PR target/98670 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -msse4.1" } */
+
+#include <x86intrin.h>
+
+void foo (__m128i);
+int a[6];
+
+void
+bar (void)
+{
+  __m128i d = *(__m128i *) (a + 2);
+  __m128i e = _mm_unpacklo_epi16 (d, (__m128i) {});
+  foo (e);
+}


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-01-14 11:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-14 11:56 [gcc r11-6664] i386: Fix the pmovzx SSE4.1 define_insn_and_split patterns [PR98670] Jakub Jelinek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).