re PR tree-optimization/91201 (SIMD not generated for horizontal sum of bytes in...
authorUros Bizjak <ubizjak@gmail.com>
Fri, 2 Aug 2019 15:46:02 +0000 (17:46 +0200)
committerUros Bizjak <uros@gcc.gnu.org>
Fri, 2 Aug 2019 15:46:02 +0000 (17:46 +0200)
PR target/91201
* config/i386/sse.md (*vec_extractv16qi_zext): New insn pattern.

testsuite/ChangeLog:

PR target/91201
* gcc.target/i386/sse4_1-pr91201.c: New test.

From-SVN: r274018

gcc/ChangeLog
gcc/config/i386/sse.md
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/sse4_1-pr91201.c [new file with mode: 0644]

index 6c1372efde19644a5edc934c1e1af6a8741da844..e63e09d258ee4f2e3fc2efec864f6bd641a6bde4 100644 (file)
@@ -1,3 +1,8 @@
+2019-08-02  Uroš Bizjak  <ubizjak@gmail.com>
+
+       PR target/91201
+       * config/i386/sse.md (*vec_extractv16qi_zext): New insn pattern.
+
 2019-08-02  Alexander Monakov  <amonakov@ispras.ru>
 
        * tree-ssa-loop-im.c (sort_bbs_in_loop_postorder_cmp): Simplify casts
index 56a89154e54e3a0643b73a1fb8789e08e504e839..3391724fd8d5350794b73f9577f8343b135891bb 100644 (file)
    (set_attr "prefix" "maybe_vex")
    (set_attr "mode" "TI")])
 
+(define_insn "*vec_extractv16qi_zext"
+  [(set (match_operand:HI 0 "register_operand" "=r,r")
+       (zero_extend:HI
+         (vec_select:QI
+           (match_operand:V16QI 1 "register_operand" "x,v")
+           (parallel
+             [(match_operand:SI 2 "const_0_to_15_operand")]))))]
+  "TARGET_SSE4_1"
+  "@
+   %vpextrb\t{%2, %1, %k0|%k0, %1, %2}
+   vpextrb\t{%2, %1, %k0|%k0, %1, %2}"
+  [(set_attr "isa" "*,avx512bw")
+   (set_attr "type" "sselog1")
+   (set_attr "prefix_data16" "1")
+   (set_attr "prefix_extra" "1")
+   (set_attr "length_immediate" "1")
+   (set_attr "prefix" "maybe_vex")
+   (set_attr "mode" "TI")])
+
 (define_insn "*vec_extract<mode>_mem"
   [(set (match_operand:<ssescalarmode> 0 "register_operand" "=r")
        (vec_select:<ssescalarmode>
index 00d664f961e39f309364d73b828e8223d6f60c74..45d941d7e6e54b940a06f378373bd7275dbe22d6 100644 (file)
@@ -1,3 +1,8 @@
+2019-08-02  Uroš Bizjak  <ubizjak@gmail.com>
+
+       PR target/91201
+       * gcc.target/i386/sse4_1-pr91201.c: New test.
+
 2019-08-02  Marek Polacek  <polacek@redhat.com>
 
        PR c++/91230 - wrong error with __PRETTY_FUNCTION__ and generic lambda.
diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-pr91201.c b/gcc/testsuite/gcc.target/i386/sse4_1-pr91201.c
new file mode 100644 (file)
index 0000000..095d18e
--- /dev/null
@@ -0,0 +1,12 @@
+/* PR tree-optimization/91201 */
+/* { dg-do compile } */
+/* { dg-options "-Os -msse4.1 -masm=att" } */
+/* { dg-final { scan-assembler-not "\tmovzb(w|l)" } } */
+
+typedef unsigned char V __attribute__((vector_size (16)));
+
+unsigned short
+foo (V x)
+{
+  return x[0];
+}