Blame SOURCES/gcc7-pr84524.patch

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