Hi,
I'm currently working on a project which uses altivec (as inline
assembly) to perform 3d affine transformations, and some other 3d vector
functions.
I have a problem in that altivec requires all inputs to be 16 byte
aligned, so I am placing my vectors in a structure like this:
struct vector {
float x,y,z,w;
}__attribute__((aligned(16)));
This seems to work for global variables, but when allocated on the
stack, my structures end up mis-aligned (on to 8-byte boundaries) which
totally screws up the results of the altivec computation.
Is this a compiler problem, or can't the compiler be expected to
guarantee alignments that large?
This is a problem with the malloc implementation.