public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH, i386, PR68627] Prohibit AVX-512VL broadcasts generation on KNL.
@ 2015-12-04  9:00 Kirill Yukhin
  2015-12-08  8:47 ` Andreas Schwab
  0 siblings, 1 reply; 5+ messages in thread
From: Kirill Yukhin @ 2015-12-04  9:00 UTC (permalink / raw)
  To: GCC Patches; +Cc: Uros Bizjak

Hello,
Patch in the bottom fixes spec2k6/437.leslie3d illigal insn generation.
The problem is that for AVX-512F broacasts are allowed to 512b registers only.
[x|y]mm variants are AVX-512VL.

Bootstrapped and regtested.

I'll commit it into GCC main trunk on Monday if no objections.

gcc/
	PR target/68627
	* config/i386/sse.md: Make 'v' alternative work on 'avx512f' ISA only.
	Force destination to 512 bits register.

gcc/testsuite/
	PR target/68627
	* gfortran.dg/pr68627.f: New test.

--
Thanks, K

commit ff93d08d61d58c28707b224f5b84ab30628b34a3
Author: Kirill Yukhin <kirill.yukhin@intel.com>
Date:   Tue Dec 1 10:28:17 2015 +0300

    AVX-512. Make broadcast from SSE reg AVX-512 only. Force to zmm.

diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md
index e7b517a..0286e6b 100644
--- a/gcc/config/i386/sse.md
+++ b/gcc/config/i386/sse.md
@@ -17377,20 +17377,21 @@
    (set_attr "mode" "<sseinsnmode>")])
 
 (define_insn "vec_dup<mode>"
-  [(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:<ssescalarmode> 1 "nonimmediate_operand" "m,m,v,?x")))]
+	  (match_operand:<ssescalarmode> 1 "nonimmediate_operand" "m,m,x,v,?x")))]
   "TARGET_AVX"
   "@
    v<sseintprefix>broadcast<bcstscalarsuff>\t{%1, %0|%0, %1}
    vbroadcast<ssescalarmodesuffix>\t{%1, %0|%0, %1}
    v<sseintprefix>broadcast<bcstscalarsuff>\t{%x1, %0|%0, %x1}
+   v<sseintprefix>broadcast<bcstscalarsuff>\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" "<sseinsnmode>,V8SF,<sseinsnmode>,V8SF")])
+   (set_attr "isa" "avx2,noavx2,avx2,avx512f,noavx2")
+   (set_attr "mode" "<sseinsnmode>,V8SF,<sseinsnmode>,<sseinsnmode>,V8SF")])
 
 (define_split
   [(set (match_operand:AVX2_VEC_DUP_MODE 0 "register_operand")
diff --git a/gcc/testsuite/gfortran.dg/pr68627.f b/gcc/testsuite/gfortran.dg/pr68627.f
new file mode 100755
index 0000000..32ff4a7
--- /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\]+" } }

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH, i386, PR68627] Prohibit AVX-512VL broadcasts generation on KNL.
  2015-12-04  9:00 [PATCH, i386, PR68627] Prohibit AVX-512VL broadcasts generation on KNL Kirill Yukhin
@ 2015-12-08  8:47 ` Andreas Schwab
  2015-12-08 10:41   ` Kirill Yukhin
  0 siblings, 1 reply; 5+ messages in thread
From: Andreas Schwab @ 2015-12-08  8:47 UTC (permalink / raw)
  To: Kirill Yukhin; +Cc: GCC Patches, Uros Bizjak

FAIL: gfortran.dg/pr68627.f   -O  (test for excess errors)
Excess errors:
gfortran: error: unrecognized command line option '-mavx512f'

Andreas.

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH, i386, PR68627] Prohibit AVX-512VL broadcasts generation on KNL.
  2015-12-08  8:47 ` Andreas Schwab
@ 2015-12-08 10:41   ` Kirill Yukhin
  2015-12-08 12:01     ` Uros Bizjak
  0 siblings, 1 reply; 5+ messages in thread
From: Kirill Yukhin @ 2015-12-08 10:41 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: GCC Patches, Uros Bizjak

Hello,
On 08 Dec 09:47, Andreas Schwab wrote:
> FAIL: gfortran.dg/pr68627.f   -O  (test for excess errors)
> Excess errors:
> gfortran: error: unrecognized command line option '-mavx512f'
Thanks for pointing.

I've checked in this as obvious:

gcc/testsuite:
	* gfortran.dg/pr68627.f: Limit target x86.

diff --git a/gcc/testsuite/gfortran.dg/pr68627.f b/gcc/testsuite/gfortran.dg/pr68627.f
index 32ff4a7..54575d7 100644
--- a/gcc/testsuite/gfortran.dg/pr68627.f
+++ b/gcc/testsuite/gfortran.dg/pr68627.f
@@ -1,4 +1,4 @@
-! { dg-do compile { target lp64 } }
+! { dg-do compile { target { { i?86-*-* x86_64-*-* } && 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" }
 
--
Thanks, K
> 
> Andreas.
> 
> -- 
> Andreas Schwab, SUSE Labs, schwab@suse.de
> GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
> "And now for something completely different."

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH, i386, PR68627] Prohibit AVX-512VL broadcasts generation on KNL.
  2015-12-08 10:41   ` Kirill Yukhin
@ 2015-12-08 12:01     ` Uros Bizjak
  2015-12-08 13:55       ` Kirill Yukhin
  0 siblings, 1 reply; 5+ messages in thread
From: Uros Bizjak @ 2015-12-08 12:01 UTC (permalink / raw)
  To: Kirill Yukhin; +Cc: Andreas Schwab, GCC Patches

On Tue, Dec 8, 2015 at 11:40 AM, Kirill Yukhin <kirill.yukhin@gmail.com> wrote:
> Hello,
> On 08 Dec 09:47, Andreas Schwab wrote:
>> FAIL: gfortran.dg/pr68627.f   -O  (test for excess errors)
>> Excess errors:
>> gfortran: error: unrecognized command line option '-mavx512f'
> Thanks for pointing.
>
> I've checked in this as obvious:
>
> gcc/testsuite:
>         * gfortran.dg/pr68627.f: Limit target x86.
>
> diff --git a/gcc/testsuite/gfortran.dg/pr68627.f b/gcc/testsuite/gfortran.dg/pr68627.f
> index 32ff4a7..54575d7 100644
> --- a/gcc/testsuite/gfortran.dg/pr68627.f
> +++ b/gcc/testsuite/gfortran.dg/pr68627.f
> @@ -1,4 +1,4 @@
> -! { dg-do compile { target lp64 } }
> +! { dg-do compile { target { { i?86-*-* x86_64-*-* } && lp64 } } }

Actually, you need { ! { ia32 } } here, since lp64 filters out x32 in
addition to ia32. Please note that since x32 is x86_64 target, it
implies 16 xmm registers.

Uros.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH, i386, PR68627] Prohibit AVX-512VL broadcasts generation on KNL.
  2015-12-08 12:01     ` Uros Bizjak
@ 2015-12-08 13:55       ` Kirill Yukhin
  0 siblings, 0 replies; 5+ messages in thread
From: Kirill Yukhin @ 2015-12-08 13:55 UTC (permalink / raw)
  To: Uros Bizjak; +Cc: Andreas Schwab, GCC Patches

On 08 Dec 13:01, Uros Bizjak wrote:
> On Tue, Dec 8, 2015 at 11:40 AM, Kirill Yukhin <kirill.yukhin@gmail.com> wrote:
> > Hello,
> > On 08 Dec 09:47, Andreas Schwab wrote:
> >> FAIL: gfortran.dg/pr68627.f   -O  (test for excess errors)
> >> Excess errors:
> >> gfortran: error: unrecognized command line option '-mavx512f'
> > Thanks for pointing.
> >
> > I've checked in this as obvious:
> >
> > gcc/testsuite:
> >         * gfortran.dg/pr68627.f: Limit target x86.
> >
> > diff --git a/gcc/testsuite/gfortran.dg/pr68627.f b/gcc/testsuite/gfortran.dg/pr68627.f
> > index 32ff4a7..54575d7 100644
> > --- a/gcc/testsuite/gfortran.dg/pr68627.f
> > +++ b/gcc/testsuite/gfortran.dg/pr68627.f
> > @@ -1,4 +1,4 @@
> > -! { dg-do compile { target lp64 } }
> > +! { dg-do compile { target { { i?86-*-* x86_64-*-* } && lp64 } } }
> 
> Actually, you need { ! { ia32 } } here, since lp64 filters out x32 in
> addition to ia32. Please note that since x32 is x86_64 target, it
> implies 16 xmm registers.
Thanks Uroš, fixed in main trunk.
> 
> Uros.

--
Thanks, K

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-12-08 13:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-04  9:00 [PATCH, i386, PR68627] Prohibit AVX-512VL broadcasts generation on KNL Kirill Yukhin
2015-12-08  8:47 ` Andreas Schwab
2015-12-08 10:41   ` Kirill Yukhin
2015-12-08 12:01     ` Uros Bizjak
2015-12-08 13:55       ` Kirill Yukhin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).