This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: autovectorization and aligned access
- From: Tim Prince <tprince at myrealbox dot com>
- To: ranjith kumar <ranjit_kumar_b4u at yahoo dot co dot uk>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Wed, 27 Jun 2007 11:19:45 -0700
- Subject: Re: autovectorization and aligned access
- References: <20346.4340.qm@web27401.mail.ukl.yahoo.com>
- Reply-to: tprince at computer dot org
ranjith kumar wrote:
Hi,
Can anyone explain why gcc wont do
autovectorization if the program contains un aligned
acceses?
There are instructions to acceses unaligned acceses.
Instead of exploiting them why gcc produces scalar code??
Vectorization is unlikely to be efficient, unless the loop can be
adjusted so that all stores are aligned. Unaligned loads generally
aren't as efficient as scalar loads, so you will see scalar loads even
in vectorized code. Future CPUs are advertised as having more efficient
support for un-aligned data, but gcc is rightly based on current
production models.