From: Branimir Maksimovic on
On Sun, 7 Mar 2010 16:00:31 CST
Jens Schmidt <Jens.Schmidt-HH(a)gmx.de> wrote:

> Nick Hounsome wrote:
>
> > On 6 Mar, 13:57, Jens Schmidt <Jens.Schmidt...(a)gmx.de> wrote:
> >> Or the language implementer decides the feature to be so rare and
> >> obscure that neither compiler nor library will use it. Here the
> >> alignment problem is left as an exercise to the user.
> >
> > Arrays are rare???????
>
> Not arrays as such, but arrays that are intended to be processed with
> SSE2. Especially if the compiler doesn't generate SSE2 instructions.

Well, if on 64 bit x86-64 abi it has to, at least for passing floats ,
, doubles and _m64 to functions.
Only certain SSE instructions require 16 byte alignment
eg:
SSE:
"
"movaps" and "movups" transfer a double quad word operand containing
packed single precision values from source operand to destination
operand. At least one of the operands have to be a SSE register, the
second one can be also a SSE register or 128-bit memory location.
Memory operands for "movaps" instruction must be aligned on boundary of
16 bytes, operands for "movups" instruction don't have to be aligned.

movups xmm0,[ebx] ; move unaligned double quad word
"
SSE2:
"
"movdqa" and "movdqu" transfer a double quad word operand containing packed
integers from source operand to destination operand. At least one of the
operands have to be a SSE register, the second one can be also a SSE register
or 128-bit memory location. Memory operands for "movdqa" instruction must be
aligned on boundary of 16 bytes, operands for "movdqu" instruction don't have
to be aligned.
"

Greets

--
http://maxa.homedns.org/

Sometimes online sometimes not


[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]