This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
vector alignment question
- From: Steve Ellcey <sje at cup dot hp dot com>
- To: gcc at gcc dot gnu dot org
- Date: Wed, 8 Jun 2005 12:50:32 -0700 (PDT)
- Subject: vector alignment question
- Reply-to: sje at cup dot hp dot com
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?
I looked in stor-layout.c and found:
/* Always naturally align vectors. This prevents ABI changes
depending on whether or not native vector modes are supported. */
TYPE_ALIGN (type) = tree_low_cst (TYPE_SIZE (type), 0);
so it seems to be intentional, but it still seems odd to me, especially
for very large vectors.
Steve Ellcey
sje@cup.hp.com