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: "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: Wed, 27 Nov 2019 09:19:11 +0100
- Subject: Re: PPC64 libmvec implementation of sincos
- References: <GcaLIHZaxSm2PVhunNuxEwEJB-BC3PeXIBlmYb6eMw54vZQ_KF6uBjlTgWmWtPNIMMeXu7UyYg797u1vV1_GS2Qv3ThxrUeORQD0wcddwwo=@protonmail.com> <0728c06a-d506-e8e8-c4a5-9187a7047f5f@arm.com> <3F536966-92DE-49A3-A432-5646981EE26F@gmail.com> <H7bxRYXZvjXK7ldtctmFF0Yn_APn9JL2aROfOmb6AcDY7FH-hpD6sOakmUfQL0tWzJyUJYlQSZye9d8EVhhibTexqPkDugYdWuvimHAnEbg=@protonmail.com>
On Mon, Nov 25, 2019 at 5:53 PM GT <tnggil@protonmail.com> wrote:
>
> > >
> > > i wonder if gcc can auto-vectorize scalar sincos
> > > calls, the vectorizer seems to want the calls to
> > > have no side-effect, but attribute pure or const
> > > is not appropriate for sincos (which has no return
> > > value but takes writable pointer args)
> >
> > We have __builtin_cexpi for that but not sure if any of the mechanisms can provide a mapping to a vectorized variant.
> >
>
> 1. Using flags -fopt-info-all and -fopt-info-internals, the failure to vectorize sincos
> is reported as "unsupported data-type: complex double". The default GCC behavior is to
> replace sincos calls with calls to __builtin_cexpi.
>
> 2. Using flags -fno-builtin-sincos and -fno-builtin-cexpi, the failure to vectorize
> sincos is different. In this case, the failure to vectorize is due to "number of iterations
> could not be computed". No calls to __builtin_cexpi; sincos calls retained.
>
> Questions:
> 1. Should we aim to provide a vectorized version of __builtin_cexpi? If so, it would have
> to be a PPC64-only vector __builtin-cexpi, right?
>
> 2. Or should we require that vectorized sincos be available only when -fno-builtin-sincos flag
> is used in compilation?
>
> I don't think we need to fix both types of vectorization failures in order to obtain sincos
> vectorization.
I think we should have a vectorized cexpi since that's having a sane
ABI. The complex
return type of cexpi makes it a little awkward for the vectorizer but
handling this should
be manageable. It's a bit difficult to expose complex types to the
vectorizer since
most cases are lowered early.
Richard.
> Thanks.
> Bert.