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