This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Update on SVE/sizeless types for C and C++


Jim Wilson <jimw@sifive.com> writes:
> On Tue, Nov 12, 2019 at 2:12 PM Richard Sandiford
> <richard.sandiford@arm.com> wrote:
>> Are both RVV intrinsic proposals like SVE in that all sizeless types
>> can be/are built into the compiler?  If so, do you think the target hook
>> added in:
>>     https://gcc.gnu.org/ml/gcc-patches/2019-11/msg00942.html
>> would be enough for RVV too?  Or do the RVV proposals require support
>> for user-defined sizeless types?
>
> We only have built-in types.  I think we have 54 of them, 32 integer,
> 12 float, and 10 mask.  I hadn't thought about user-defined sizeless
> types, and hope that I don't have to support that.

Yeah, not supporting them definitely simplifies things.

>> If the hook is enough, I guess there are three ways we can go:
>> (1) Add hooks for both targets, with similar functionality.  This means
>>     a certain amount of cut-&-paste but also allows for more specific
>>     error messages.
>
> I think this would be OK.  I took a quick look at your patch.  I'm a
> little surprised that you can't support alignof on a vector type, I
> would think that depends on the base type for the vector, but maybe
> this is a difference between SVE and RVV, or maybe I just haven't
> gotten far enough to find the problem yet.  Otherwise it looks like
> this would also work for the RVV support.

OK, great.  I'll post the corresponding C++ patch in time for
end of stage 1.

The justification for forbidding alignof is perhaps weaker than
the rest.  The ABI alignment is 2 bytes for SVE predicates and 16 bytes
for SVE vectors, so it would certainly be possible for alignof to say that.
But alignof belongs to the same category of layout queries as sizeof
and (for aggregates) offsetof.  So it seemed more consistent to forbid
alignof too, especially if we do ever support user-defined sizeless
aggregates in future.

We could always relax this later if there turns out to be a specific
benefit.  The worry is that moving the other way would be harder.

Thanks,
Richard


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]