Blame SOURCES/gcc7-pr84524.patch

fa2d27
2018-02-23  Jakub Jelinek  <jakub@redhat.com>
fa2d27
fa2d27
	PR target/84524
fa2d27
	* config/i386/sse.md (*<mode>3): Replace <mask_prefix3> with
fa2d27
	orig,vex.
fa2d27
	(*<plusminus_insn><mode>3): Likewise.  Remove <mask_operand3> uses.
fa2d27
fa2d27
	* gcc.c-torture/execute/pr84524.c: New test.
fa2d27
	* gcc.target/i386/avx512bw-pr84524.c: New test.
fa2d27
fa2d27
--- gcc/config/i386/sse.md.jj	2018-02-13 09:31:24.769607162 +0100
fa2d27
+++ gcc/config/i386/sse.md	2018-02-23 11:51:00.271477979 +0100
fa2d27
@@ -9938,11 +9938,11 @@ (define_insn "*<plusminus_insn><mode>3"
fa2d27
    && ix86_binary_operator_ok (, <MODE>mode, operands)"
fa2d27
   "@
fa2d27
    p<plusminus_mnemonic><ssemodesuffix>\t{%2, %0|%0, %2}
fa2d27
-   vp<plusminus_mnemonic><ssemodesuffix>\t{%2, %1, %0<mask_operand3>|%0<mask_operand3>, %1, %2}"
fa2d27
+   vp<plusminus_mnemonic><ssemodesuffix>\t{%2, %1, %0|%0, %1, %2}"
fa2d27
   [(set_attr "isa" "noavx,avx")
fa2d27
    (set_attr "type" "sseiadd")
fa2d27
    (set_attr "prefix_data16" "1,*")
fa2d27
-   (set_attr "prefix" "<mask_prefix3>")
fa2d27
+   (set_attr "prefix" "orig,vex")
fa2d27
    (set_attr "mode" "<sseinsnmode>")])
fa2d27
 
fa2d27
 (define_insn "*<plusminus_insn><mode>3_mask"
fa2d27
@@ -11822,7 +11822,7 @@ (define_insn "*<mode>3"
fa2d27
 	    (eq_attr "mode" "TI"))
fa2d27
        (const_string "1")
fa2d27
        (const_string "*")))
fa2d27
-   (set_attr "prefix" "<mask_prefix3>")
fa2d27
+   (set_attr "prefix" "orig,vex")
fa2d27
    (set (attr "mode")
fa2d27
 	(cond [(and (match_test "<MODE_SIZE> == 16")
fa2d27
 		    (match_test "TARGET_SSE_PACKED_SINGLE_INSN_OPTIMAL"))
fa2d27
--- gcc/testsuite/gcc.c-torture/execute/pr84524.c.jj	2018-02-23 11:54:51.913492631 +0100
fa2d27
+++ gcc/testsuite/gcc.c-torture/execute/pr84524.c	2018-02-23 11:59:55.467511836 +0100
fa2d27
@@ -0,0 +1,41 @@
fa2d27
+/* PR target/84524 */
fa2d27
+
fa2d27
+__attribute__((noipa)) void
fa2d27
+foo (unsigned short *x)
fa2d27
+{
fa2d27
+  unsigned short i, v;
fa2d27
+  unsigned char j;
fa2d27
+  for (i = 0; i < 256; i++)
fa2d27
+    {
fa2d27
+      v = i << 8;
fa2d27
+      for (j = 0; j < 8; j++)
fa2d27
+	if (v & 0x8000)
fa2d27
+	  v = (v << 1) ^ 0x1021;
fa2d27
+	else
fa2d27
+	  v = v << 1;
fa2d27
+      x[i] = v;
fa2d27
+    }
fa2d27
+}
fa2d27
+
fa2d27
+int
fa2d27
+main ()
fa2d27
+{
fa2d27
+  unsigned short a[256];
fa2d27
+
fa2d27
+  foo (a);
fa2d27
+  for (int i = 0; i < 256; i++)
fa2d27
+    {
fa2d27
+      unsigned short v = i << 8;
fa2d27
+      for (int j = 0; j < 8; j++)
fa2d27
+	{
fa2d27
+	  asm volatile ("" : "+r" (v));
fa2d27
+	  if (v & 0x8000)
fa2d27
+	    v = (v << 1) ^ 0x1021;
fa2d27
+	  else
fa2d27
+	    v = v << 1;
fa2d27
+	}
fa2d27
+      if (a[i] != v)
fa2d27
+	__builtin_abort ();
fa2d27
+    }
fa2d27
+  return 0;
fa2d27
+}
fa2d27
--- gcc/testsuite/gcc.target/i386/avx512bw-pr84524.c.jj	2018-02-23 11:58:16.919505601 +0100
fa2d27
+++ gcc/testsuite/gcc.target/i386/avx512bw-pr84524.c	2018-02-23 11:58:57.377508169 +0100
fa2d27
@@ -0,0 +1,14 @@
fa2d27
+/* PR target/84524 */
fa2d27
+/* { dg-do run { target avx512bw } } */
fa2d27
+/* { dg-options "-O3 -mavx512bw" } */
fa2d27
+
fa2d27
+#include "avx512bw-check.h"
fa2d27
+
fa2d27
+#define main() do_main()
fa2d27
+#include "../../gcc.c-torture/execute/pr84524.c"
fa2d27
+
fa2d27
+static void
fa2d27
+avx512bw_test (void)
fa2d27
+{
fa2d27
+  do_main ();
fa2d27
+}