On Sun, Dec 8, 2019 at 10:40 PM GT <tng...@protonmail.com> wrote: > > ‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐ > On Friday, December 6, 2019 12:43 PM, Richard Biener > richard.guent...@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.