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.