This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Another libmvect question (vectorizing sincos calls)
On Wed, Mar 28, 2018 at 12:29 AM, Joseph Myers <joseph@codesourcery.com> wrote:
> On Tue, 27 Mar 2018, Steve Ellcey wrote:
>
>> Here is another libmvec question. While testing on x86 I could easily make
>> a loop with calls to sin, cos, log, exp, or pow and see them vectorized when
>> I compile with -Ofast. But if I try making a loop with sincos, it does not
>> get vectorized. Is that to be expected?
>
> The sincos libmvec functions have a rather peculiar ABI; see
> <https://sourceware.org/bugzilla/show_bug.cgi?id=20024>; that may not be
> well-suited to vectorization in most cases. So far new exports with a
> different vector ABI (and corresponding different header declarations)
> have not yet been added.
Note we "canonicalize" sincos calls to __builtin_cexpi () which has a nicer
interface. The vectorizer could handle vectorizing that by looking for
the sincos decl, see whether it is OMP simd annotated and then use
that during code-generation. It might need some more massaging after all
and there's a vectorizer bug for vectorizing sincos already.
Oh, and "CSEing" sin() + cos () to sincos happens before vectorization already.
Richard.
> --
> Joseph S. Myers
> joseph@codesourcery.com