This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: RFC: C extension to support variable-length vector types
Torvald Riegel <triegel@redhat.com> writes:
> On Wed, 2017-08-02 at 14:09 +0100, Richard Sandiford wrote:
>> (1) Does the approach seem reasonable?
>>
>> (2) Would it be acceptable in principle to add this extension to the
>> GCC C frontend (only enabled where necessary)?
>>
>> (3) Should we submit this to the standards committee?
>
> I hadn't have time to look at the proposal in detail. I think it would
> be good to have the standards committees review this. I doubt you could
> find consensus in the C++ for type system changes unless you have a
> really good reason. Have you considered how you could use the ARM
> extensions from http://wg21.link/p0214r4 ?
Yeah, we've been following that proposal, but I don't think it helps
as-is with SVE. datapar<T> is "an array of target-specific size,
with elements of type T, ..." and for SVE the natural target-specific
size would be a runtime value. The core language would still need to
provide a way of creating that array.
Similarly to other vector architectures (including AdvSIMD), the SVE
intrinsics and their types are more geared towards people who want
to optimise specifically for SVE without having to resort to assembly.
That's an important use case for us, and I think there's always going to
be a need for it alongside generic SIMD and parallel-programming models
(which of course are a good thing to have too).
Being able to use SVE features from C is also important. Not all
projects are prepared to convert to C++.
Thanks,
Richard