‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Monday, December 9, 2019 3:39 AM, Richard Biener [email protected]
wrote:
> > 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.
>
Function get_related_vectype_for_scalar_type doesn't exist. There is one named
get_vectype_for_scalar_type, which in turn calls
get_vectype_for_scalar_type_and_size. In that
last function I already have 2 changes to prevent NULL_TREE being returned for
_Complex double.
1. In the first if statement of the function, added new condition
!is_complex_float_mode (...),
with arguments identical to those of the existing !is_int_mode and
!is_float_mode conditions.
2. In the 2nd if statement, the else-if has a new condition
!COMPLEX_FLOAT_TYPE_P (scalar_type)
After those changes, NULL_TREE is returned by a clause of the if statement
whose first condition
is if (known_eq (size, 0U)). The 2nd part of the else-if returns true for
!mode_for_vector (...).
Unless the correct path should involve a call similar to
build_nonstandard_integer_type in the
2nd if statement, I still end up requiring the change to mode_for_vector as
in my last post.
Bert.