From: Jakub Jelinek Date: Fri, 4 Mar 2016 14:59:23 +0000 (+0100) Subject: re PR target/70059 (Invalid codegen on AVX-512 when using _mm512_inserti64x4(x, y... X-Git-Tag: releases/gcc-4.9.4~289 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=436d5d8d085e234fbaaa4eac538c1322eee63a0b;p=thirdparty%2Fgcc.git re PR target/70059 (Invalid codegen on AVX-512 when using _mm512_inserti64x4(x, y, 0)) PR target/70059 * config/i386/sse.md (vec_set_lo_, _vinsert_mask): Formatting fixes. (vec_set_hi_): Likewise. Swap VEC_CONCAT operands. * gcc.target/i386/avx512f-pr70059.c: New test. From-SVN: r233970 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5b8275475006..481046b8180f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2016-03-04 Jakub Jelinek + + PR target/70059 + * config/i386/sse.md (vec_set_lo_, + _vinsert_mask): Formatting + fixes. + (vec_set_hi_): Likewise. Swap VEC_CONCAT operands. + 2016-03-01 Eric Botcazou PR rtl-optimization/70007 diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md index d665accebc0d..e1c3442a5332 100644 --- a/gcc/config/i386/sse.md +++ b/gcc/config/i386/sse.md @@ -9725,13 +9725,13 @@ { int mask = INTVAL (operands[3]); if (mask == 0) - emit_insn (gen_vec_set_lo__mask - (operands[0], operands[1], operands[2], - operands[4], operands[5])); + emit_insn (gen_vec_set_lo__mask (operands[0], operands[1], + operands[2], operands[4], + operands[5])); else - emit_insn (gen_vec_set_hi__mask - (operands[0], operands[1], operands[2], - operands[4], operands[5])); + emit_insn (gen_vec_set_hi__mask (operands[0], operands[1], + operands[2], operands[4], + operands[5])); DONE; }) @@ -9742,7 +9742,7 @@ (vec_select: (match_operand:V8FI 1 "register_operand" "v") (parallel [(const_int 4) (const_int 5) - (const_int 6) (const_int 7)]))))] + (const_int 6) (const_int 7)]))))] "TARGET_AVX512F" "vinsert64x4\t{$0x0, %2, %1, %0|%0, %1, %2, $0x0}" [(set_attr "type" "sselog") @@ -9753,11 +9753,11 @@ (define_insn "vec_set_hi_" [(set (match_operand:V8FI 0 "register_operand" "=v") (vec_concat:V8FI - (match_operand: 2 "nonimmediate_operand" "vm") (vec_select: (match_operand:V8FI 1 "register_operand" "v") (parallel [(const_int 0) (const_int 1) - (const_int 2) (const_int 3)]))))] + (const_int 2) (const_int 3)])) + (match_operand: 2 "nonimmediate_operand" "vm")))] "TARGET_AVX512F" "vinsert64x4\t{$0x1, %2, %1, %0|%0, %1, %2, $0x1}" [(set_attr "type" "sselog") diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index d61a7e6e9222..979e790a36d8 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2016-03-04 Jakub Jelinek + + PR target/70059 + * gcc.target/i386/avx512f-pr70059.c: New test. + 2016-03-03 Rainer Orth * lib/gcc-gdb-test.exp (gdb-test): Make log message match command. diff --git a/gcc/testsuite/gcc.target/i386/avx512f-pr70059.c b/gcc/testsuite/gcc.target/i386/avx512f-pr70059.c new file mode 100644 index 000000000000..95c8915a93bd --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx512f-pr70059.c @@ -0,0 +1,33 @@ +/* PR target/70059 */ +/* { dg-do run } */ +/* { dg-require-effective-target avx512f } */ +/* { dg-options "-O2 -mavx512f" } */ + +#include "avx512f-check.h" + +__attribute__((noinline, noclone)) __m512i +foo (__m256i a, __m256i b) +{ + __m512i r = _mm512_undefined_si512 (); + r = _mm512_inserti64x4 (r, a, 0); + r = _mm512_inserti64x4 (r, b, 1); + return r; +} + +static void +avx512f_test (void) +{ + union256i_q a, b; + union512i_q r; + long long r_ref[8]; + int i; + for (i = 0; i < 4; i++) + { + a.a[i] = 0x0101010101010101ULL * i; + b.a[i] = 0x1010101010101010ULL * i; + r_ref[i] = a.a[i]; + r_ref[i + 4] = b.a[i]; + } + r.x = foo (a.x, b.x); + check_union512i_q (r, r_ref); +}