From 09d4cbcde094daa49bd7df8dcf22aa051c18a6ba Mon Sep 17 00:00:00 2001 From: Kirill Yukhin Date: Mon, 7 Dec 2015 11:12:41 +0000 Subject: [PATCH] re PR target/68627 ([i386, AVX-512] Illegal insn generated while compiling spec2k6/437.leslie3d for KNL) PR target/68627 gcc/ * config/i386/sse.md: Make 'v' alternative work on 'avx512f' ISA only. Force destination to 512 bits register. gcc/testsuite/ * gfortran.dg/pr68627.f: New test. From-SVN: r231361 --- gcc/ChangeLog | 6 ++++++ gcc/config/i386/sse.md | 9 +++++---- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gfortran.dg/pr68627.f | 18 ++++++++++++++++++ 4 files changed, 34 insertions(+), 4 deletions(-) create mode 100644 gcc/testsuite/gfortran.dg/pr68627.f diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 2c7c82356e2..4d38d48f571 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2015-12-07 Kirill Yukhin + + PR target/68627 + * config/i386/sse.md: Make 'v' alternative work on 'avx512f' ISA only. + Force destination to 512 bits register. + 2015-12-07 Kirill Yukhin PR target/68633 diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md index beddf400460..eb49c419b9e 100644 --- a/gcc/config/i386/sse.md +++ b/gcc/config/i386/sse.md @@ -17385,20 +17385,21 @@ (set_attr "mode" "")]) (define_insn "vec_dup" - [(set (match_operand:AVX_VEC_DUP_MODE 0 "register_operand" "=x,x,v,x") + [(set (match_operand:AVX_VEC_DUP_MODE 0 "register_operand" "=x,x,x,v,x") (vec_duplicate:AVX_VEC_DUP_MODE - (match_operand: 1 "nonimmediate_operand" "m,m,v,?x")))] + (match_operand: 1 "nonimmediate_operand" "m,m,x,v,?x")))] "TARGET_AVX" "@ vbroadcast\t{%1, %0|%0, %1} vbroadcast\t{%1, %0|%0, %1} vbroadcast\t{%x1, %0|%0, %x1} + vbroadcast\t{%x1, %g0|%g0, %x1} #" [(set_attr "type" "ssemov") (set_attr "prefix_extra" "1") (set_attr "prefix" "maybe_evex") - (set_attr "isa" "avx2,noavx2,avx2,noavx2") - (set_attr "mode" ",V8SF,,V8SF")]) + (set_attr "isa" "avx2,noavx2,avx2,avx512f,noavx2") + (set_attr "mode" ",V8SF,,,V8SF")]) (define_split [(set (match_operand:AVX2_VEC_DUP_MODE 0 "register_operand") diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 583baa92741..188ed2b44fb 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2015-12-07 Kirill Yukhin + + PR target/68627 + * gfortran.dg/pr68627.f: New test. + 2015-12-07 Kirill Yukhin PR target/68633 diff --git a/gcc/testsuite/gfortran.dg/pr68627.f b/gcc/testsuite/gfortran.dg/pr68627.f new file mode 100644 index 00000000000..32ff4a79e79 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/pr68627.f @@ -0,0 +1,18 @@ +! { dg-do compile { target lp64 } } + +! { dg-options "-Ofast -mavx512f -ffixed-xmm1 -ffixed-xmm2 -ffixed-xmm3 -ffixed-xmm4 -ffixed-xmm5 -ffixed-xmm6 -ffixed-xmm7 -ffixed-xmm8 -ffixed-xmm9 -ffixed-xmm10 -ffixed-xmm11 -ffixed-xmm12 -ffixed-xmm13 -ffixed-xmm14 -ffixed-xmm15" } + + IMPLICIT REAL*8(A-H,O-Z) + ALLOCATABLE DD1(:), DD2(:), WY(:,:) + ALLOCATE( DD1(MAX), DD2(MAX), WY(MAX,MAX)) + DO J = J1,J2 + DO I = I1, I2 + DD1(I) = D1 * (WY(I-2,J) - WY(I+2,J) + + > (WY(I+1,J) - WY(I-1,J))) + END DO + DO I = I1, INT(D2 * D3(I)) + END DO + END DO + END + +! { dg-final { scan-assembler-not "vbroadcastsd\[ \\t\]+%xmm\[0-9\]+, %ymm\[0-9\]+" } } -- 2.30.2