This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: PPC64 libmvec implementation of sincos
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: GT <tnggil at protonmail dot com>
- Cc: Jakub Jelinek <jakub at redhat dot com>, "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>, Szabolcs Nagy <Szabolcs dot Nagy at arm dot com>, nd <nd at arm dot com>, Bill Schmidt <wschmidt at linux dot ibm dot com>
- Date: Mon, 9 Dec 2019 09:39:56 +0100
- Subject: Re: PPC64 libmvec implementation of sincos
- References: <GcaLIHZaxSm2PVhunNuxEwEJB-BC3PeXIBlmYb6eMw54vZQ_KF6uBjlTgWmWtPNIMMeXu7UyYg797u1vV1_GS2Qv3ThxrUeORQD0wcddwwo=@protonmail.com> <JvY5F5_4p--Fe-1i2REKyVzeb3ullNSJAxBxyiOfT9lxi7r7ho7fgNf4CNQOiBgrmQP5eHUFiHUjRiZScuMRh-myO4lb_EcXkh81WxJwgdk=@protonmail.com> <CAFiYyc0Fgf+MxZT=aCeAdHthyS3dAze=NNTJ7y+=FvS0RgoyDQ@mail.gmail.com> <JJk2TKaV0tVHVY2AyyGtw7X5lNw90vm80Fhu9YcgQh5QOWlrcyL8bzgSYETL8G9stKmaOX5lYmSAaX6hs9xLnI8iuCTRD0xio9vVxhtApYs=@protonmail.com> <CAFiYyc3FO6jgarVbNn4=kckgw7UYHUaHYxiCv4ZJTMRPuy1dMw@mail.gmail.com> <20191206111540.GC10088@tucnak> <CAFiYyc2WJrh2BW5891XhjxM0SsJkxbSOoOh58AeTBmz+Bed9Tw@mail.gmail.com> <hd-6QLiJS0PVrxLBOkT_w0FiGyHomRJkmlR_hRrIGCHZJXhITGVMZ6fzbOFOOoqt6fZ3E1m5tDhtzwDfbeeusk1IdGwsONZFF2nIA4WvxMw=@protonmail.com> <CCED278B-4638-4238-A798-9FD4C98EF2BE@gmail.com> <lyW7bEDQcGe8hV1r_r-252urMynbbu4bJHT-mEJOb4rljDo4-H-BpPiZcKO3EVm2p2EkkvF0Xl_CLCFRael9C5TiBdoNLJ4TCEXbNTPe8iU=@protonmail.com>
On Sun, Dec 8, 2019 at 10:40 PM GT <tnggil@protonmail.com> wrote:
>
> ‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
> On Friday, December 6, 2019 12:43 PM, Richard Biener richard.guenther@gmail.com wrote:
>
> ...
> ...
>
> > > Are we certain the change we want is to support _Complex double so that
> > > cexpi is auto-vectorized?
> > > Looking at the resulting executable of the code with sincos in the
> > > loop, the only function called
> > > is sincos. Not builtin_cexpi or any variant of cexpi. File
> > > gcc/builtins.c expands calls to builtin_cexpi
> > > to sincos! What is gained by the compiler going through the
> > > transformations sincos -> builtin_cexpi ->
> > > sincos?
> >
> > Yes, we want to support vectorizing cexpi because that is what the compiler will lower sincos to. The sincos API is painful to deal with due to the data dependences it introduces. Now, the vectorizer can of course emit calls to a vectorized sincos it just needs to be able to deal with cexpi input IL.
> >
> > Richard.
>
> I'm modifying the code trying to get complex double accepted as a valid type by the vectorizer.
> This is the first time I'm dealing with GCC source so I ask for some patience.
>
> Function mode_for_vector in gcc/stor-layout.c requires a new else-if for complex double. I cannot
> seem to find a header file where MIN_MODE_VECTOR_FLOAT and similar macros are defined. I expect
> a new MIN_MODE_COMPLEX_VECTOR_FLOAT to be defined in the same file as the existing similar macros.
> How do I go about making this change?
You don't want to do it this way but map _Complex double to a vector
of 2 * n doubles instead.
Look into get_related_vectype_for_scalar_type where it alreday has
code to "change" the
scalar type into something that fits what we allow for vectors.
Richard.
> Thanks.
> Bert.