This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Enable GCC support for AVX512_VP2INTERSECT.
- From: Hongtao Liu <crazylht at gmail dot com>
- To: Uros Bizjak <ubizjak at gmail dot com>
- Cc: Rainer Orth <ro at cebitec dot uni-bielefeld dot de>, Martin Liška <mliska at suse dot cz>, "H.J. Lu" <hjl dot tools at gmail dot com>, Jeff Law <law at redhat dot com>, Jakub Jelinek <jakub at redhat dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>, "Zhang, Annita" <annita dot zhang at intel dot com>, "Xiao, Wei3" <wei3 dot xiao at intel dot com>, Lili Cui <lili dot cui at intel dot com>
- Date: Wed, 7 Aug 2019 11:18:20 +0800
- Subject: Re: [PATCH] Enable GCC support for AVX512_VP2INTERSECT.
- References: <CAMZc-by58aYYN1eEwb2ug=raF=A4TFEJCxJPiy7RW4+CZ3L4Ug@mail.gmail.com> <CAFULd4aWX_QYdDHgRT+XYepGaaK5oSjk8zb3tfPAr3M8qripfQ@mail.gmail.com> <CAMZc-bztro64DT2XVJNE8R_BeNvZ66My-EVFctc_1033=Uw5oA@mail.gmail.com> <CAFULd4a09UC1AqseAJ6y_13+ZvOwt=U7=UNQC2t_TUiJk-vKAQ@mail.gmail.com> <CAMZc-by85=D9UvNPRpK9Lyvj0U7Dckb=+0mJo3j-CCmSnkWATA@mail.gmail.com> <CAMe9rOoka3Dw5eYMmd+b2g9WbrQ3=S_C8Zwbj9SYv7uUMUWNRw@mail.gmail.com> <CAMZc-byj6DkFm=Xx3r0X-+7xoQeF4g5j9Qy16MMVAgPvUqQSKg@mail.gmail.com> <CAFULd4bAz-DMWNoo8PDDRmCPRyNY+Sf9vTKVqOYYjBj3=+9sGg@mail.gmail.com> <CAMZc-bzgQ=w_0h8T5rAA=xGK_tggqGSkrZKxTSLfD-=9iXrCWw@mail.gmail.com> <CAFULd4Y3AqCp4ZxXnR2JimyE780Y7px55kQvqN5zZuE4fAizJw@mail.gmail.com> <CAMZc-byBmCFQKsYmSH-3naaNgB2H=D=5Q7vMq1p5bxZck-1K1Q@mail.gmail.com> <CAFULd4be6TUhh2+haMqYv=E2pzex=FJ=NrHvUDHKAo6Ke+oJOA@mail.gmail.com> <CAMZc-bzJZ0rpt3sJMytU4ZsMoKpexcCimHxTXvMDCuQxuZheWg@mail.gmail.com> <87e3b62f-d99b-196d-389f-354fecc7ad6b@suse.cz> <yddr27gps9w.fsf@CeBiTec.Uni-Bielefeld.DE> <CAMZc-bzkK38TZ_7D=i6MNVErrYM78MtSUOrL48E3jvMTWqB2uQ@mail.gmail.com> <ydd8stnpfqq.fsf@CeBiTec.Uni-Bielefeld.DE> <CAMZc-byr4sejza-C7YvJREkH_VZvz8=5jFOSJ41Ovdhikpdz7Q@mail.gmail.com> <ydd4l4bpdvc.fsf@CeBiTec.Uni-Bielefeld.DE> <CAMZc-bwJDYfYvQeQz+Ry2upXhXTAw-jVu3M8ZT-K-aT4BXpvPw@mail.gmail.com> <yddblx2h7d3.fsf@CeBiTec.Uni-Bielefeld.DE> <CAFULd4ZkfuHnNrZrA-8eXT=xKAj61br9PU18Wz7Jh6uV90jaSw@mail.gmail.com>
On Tue, Aug 6, 2019 at 11:02 PM Uros Bizjak <ubizjak@gmail.com> wrote:
>
> On Tue, Aug 6, 2019 at 1:16 PM Rainer Orth <ro@cebitec.uni-bielefeld.de> wrote:
> >
> > Hi Hongtao,
> >
> > > On Thu, Jun 27, 2019 at 5:38 PM Rainer Orth <ro@cebitec.uni-bielefeld.de> wrote:
> > >>
> > >> Hi Hongtao,
> > >>
> > >> > On Thu, Jun 27, 2019 at 5:02 PM Rainer Orth
> > >> > <ro@cebitec.uni-bielefeld.de> wrote:
> > >> >>
> > >> >> Hi Hongtao,
> > >> >>
> > >> >> >> as usual, the new effective-target keyword needs documenting in
> > >> >> >> sourcebuild.texi.
> > >> >> > Like this?
> > >> >>
> > >> >> a couple of nits: first of all, your mailer seems to replace tabs by a
> > >> >> single space. Please fix this or attach the patch instead.
> > >> >>
> > >> >> > Index: ChangeLog
> > >> >> > ===================================================================
> > >> >> > --- ChangeLog (revision 272668)
> > >> >> > +++ ChangeLog (working copy)
> > >> >> > @@ -1,3 +1,8 @@
> > >> >> > +2019-06-27 Hongtao Liu <hongtao.liu@intel.com>
> > >> >> > +
> > >> >> > + * doc/sourcebuild.texi: Document new effective target keyword
> > >> >> > + avx512vp2intersect.
> > >> >>
> > >> >> Please include the sections you're modifying, something like
> > >> >>
> > >> >> * doc/sourcebuild.texi (Effective-Target Keywords, Other
> > >> >> hardware attributes): Document avx512vp2intersect.
> > >> >>
> > >> >> And please don't include the ChangeLog in the patch, but include it in
> > >> >> the mail proper: it won't apply due to date and context changes anyway.
> > >> >> Best review https://gcc.gnu.org/contribute.html where this is documented
> > >> >> besides other points of patch submission.
> > >> >>
> > >> >> Besides, it's most likely useful to also review the GNU Coding
> > >> >> Standards, too, not only for ChangeLog formatting.
> > >> >>
> > >> >> > Index: testsuite/ChangeLog
> > >> >> > ===================================================================
> > >> >> > --- testsuite/ChangeLog (revision 272668)
> > >> >> > +++ testsuite/ChangeLog (working copy)
> > >> >> > @@ -1,3 +1,11 @@
> > >> >> > +2019-06-27 Hongtao Liu <hongtao.liu@intel.com>
> > >> >> > +
> > >> >> > + * lib/target-supports.exp: Add
> > >> >> > + check_effective_target_avx512vp2intersect.
> > >> >>
> > >> >> Use
> > >> >>
> > >> >> * lib/target-supports.exp
> > >> >> (check_effective_target_avx512vp2intersect): New proc.
> > >> >>
> > >> >> > + * gcc.target/i386/avx512vp2intersect-2intersect-1b.c: Add
> > >> >> > + dg-require-effective-target avx512vp2intersect.
> > >> >>
> > >> >> Better:
> > >> >>
> > >> >> * gcc.target/i386/avx512vp2intersect-2intersect-1b.c: Require
> > >> >> avx512vp2intersect.
> > >> >>
> > >> >> but that's a matter of preference.
> > >> >>
> > >> >> > Index: testsuite/gcc.target/i386/avx512vp2intersect-2intersect-1b.c
> > >> >> > ===================================================================
> > >> >> > --- testsuite/gcc.target/i386/avx512vp2intersect-2intersect-1b.c
> > >> >> > (revision 272668)
> > >> >> > +++ testsuite/gcc.target/i386/avx512vp2intersect-2intersect-1b.c
> > >> >> > (working copy)
> > >> >> > @@ -1,5 +1,6 @@
> > >> >> > /* { dg-do run } */
> > >> >> > /* { dg-options "-O2 -mavx512vp2intersect" } */
> > >> >> > +/* { dg-require-effective-target "avx512vp2intersect" } */
> > >> >>
> > >> >> No need to quote avx512vp2intersect here and in the next test.
> > >> >>
> > >> >> Ok with those nits fixed.
> > >> >>
> > >> > Yes, thanks a lot.
> > >> >> Thanks.
> > >> >> Rainer
> > >> >>
> > >> >> --
> > >> >> -----------------------------------------------------------------------------
> > >> >> Rainer Orth, Center for Biotechnology, Bielefeld University
> > >> >
> > >> > Ok for trunk?
> > >>
> > >> ENOPATCH
> > > Sorry, Here is the patch.
> > >>
> > >> --
> > >> -----------------------------------------------------------------------------
> > >> Rainer Orth, Center for Biotechnology, Bielefeld University
> > >
> > >
> > > Changelog
> > >
> > > gcc/
> > > +2019-06-27 Hongtao Liu <hongtao.liu@intel.com>
> > > +
> > > + * doc/sourcebuild.texi (Effective-Target Keywords, Other
> > > + hardware attributes): Document avx512vp2intersect.
> > > +
> > >
> > > gcc/testsuite/
> > > +2019-06-27 Hongtao Liu <hongtao.liu@intel.com>
> > > +
> > > + * lib/target-supports.exp
> > > + (check_effective_target_avx512vp2intersect): New proc.
> > > + * gcc.target/i386/avx512vp2intersect-2intersect-1b.c: Add
> > > + dg-require-effective-target avx512vp2intersect.
> > > + * gcc.target/i386/avx512vp2intersect-2intersectvl-1b.c: Ditto.
> > > +
> >
> > unfortunately, the testcases are still not right. While with gas 2.32
> > they now come up as UNSUPPORTED, I've now tried a mainline bootstrap on
> > i386-pc-solaris2.11 with gas from binutils master. Doing so, I get
> >
> > +FAIL: gcc.target/i386/avx512vp2intersect-2intersect-1b.c execution test
> > +FAIL: gcc.target/i386/avx512vp2intersect-2intersectvl-1b.c execution test
> >
> > for both 32 and 64-bit, and there are similar results on
> > gcc-testresults for x86_64-pc-linux-gnu.
> >
> > Running one of the testcases under gdb shows
> >
> > Thread 2 received signal SIGILL, Illegal instruction.
> > [Switching to Thread 1 (LWP 1)]
> > 0x08050d89 in do_test ()
> > 1: x/i $pc
> > => 0x8050d89 <do_test+25>: (bad)
> >
> > or with objdump 2.32:
> >
> > 8050d89: 62 f2 ff 48 68 (bad)
> >
> > Using objdump from binutils master shows
> >
> > 8050d89: 62 f2 ff 48 68 05 80 vp2intersectq 0x8050a80,%zmm0,%k0
> >
> > Currently, the testcases only check for AVX512F (which the machine in
> > question supports: Xeon Gold 6132), while they need to check for
> > AVX512VP2INTERSECT to avoid this.
> >
> > The following patch does this; tested on i386-pc-solaris2.11 with gas
> > 2.32.51 both 32 and 64-bit where the tests PASS.
> >
> > Ok for mainline?
>
> OK.
>
> Thanks,
> Uros.
>
> >
> > Rainer
> >
> > --
> > -----------------------------------------------------------------------------
> > Rainer Orth, Center for Biotechnology, Bielefeld University
> >
> >
> > 2019-08-06 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
> >
> > * gcc.target/i386/avx512vp2intersect-2intersect-1b.c (AVX512F):
> > Remove.
> > (AVX512VP2INTERSECT): Define.
> > * gcc.target/i386/avx512vp2intersect-2intersectvl-1b.c (AVX512F):
> > Remove.
> > (AVX512VP2INTERSECT): Define.
> >
Sorry for mistake and thanks.
--
BR,
Hongtao