This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: vector alignment question
- From: Steve Ellcey <sje at cup dot hp dot com>
- To: rth at redhat dot com
- Cc: gcc at gcc dot gnu dot org
- Date: Wed, 8 Jun 2005 15:22:34 -0700 (PDT)
- Subject: Re: vector alignment question
> On Wed, Jun 08, 2005 at 12:50:32PM -0700, Steve Ellcey wrote:
> > I noticed that vectors are always aligned based on their size, i.e. an
> > 8 byte vector has an aligment of 8 bytes, 16 byte vectors an alignment
> > of 16, a 256 byte vector an alignment of 256, etc.
> >
> > Is this really intended?
>
> Yes.
>
> > so it seems to be intentional, but it still seems odd to me, especially
> > for very large vectors.
>
> Hardware usually requires such alignment. Most folk don't use vectors
> larger than some bit of hardware supports. One wouldn't want the ABI
> to depend on whether that bit of hardware were actually present, IMO.
>
> r~
I guess that makes sense but I wonder if the default alignment should be
set to "MIN (size of vector, BIGGEST_ALIGNMENT)" instead so that we
don't default to an alignment larger than we know we can support. Or
perhaps there should be a way to override the default alignment for
vectors on systems that don't require natural alignment.
Steve Ellcey
sje@cup.hp.com