On 12/15/2010 12:18 AM, Miles Bader wrote:
Tim Prince<n8tm@xxxxxxx> writes:
You would require _attribute__(aligned) and similar gcc extensions to
inform the compiler about alignments so as to enable more use of aligned
instructions. Without those, it's not practical to auto-vectorize short
loops, except by explicit low-level coding (e.g. sse intrinsics). In
any case, a loop of trip 9 might not be efficiently vectorizable.
The problem I had when I played with this sort of thing before, was not
gcc, but libc, which doesn't align general allocations enough for SSE
(and I gather the libc devs have no intention of adding such a feature),
so one needs to jump through a lot of hoops to make sure heap-allocated
stuff is aligned properly. It seemed like a big pain ...
I heard there was an effort to streamline this for 32-bit OS. At this
late date, one would think people who cared would already be using
x86-64, where the ABI requires 16-byte aligned allocation. The upcoming
question is how to deal with the increasing need for higher alignments.
--
Tim Prince