SIMD support...

Manu turkeyman at gmail.com
Thu Jan 5 18:25:22 PST 2012


On 6 January 2012 04:16, Walter Bright <newshound2 at digitalmars.com> wrote:

> On 1/5/2012 5:42 PM, Manu wrote:
>
>> -- Alignment --
>>
>> This type needs to be 16byte aligned. Unaligned loads/stores are very
>> expensive,
>> and also tend to produce extremely costly LHS hazards on most
>> architectures when
>> accessing vectors in arrays. If they are not aligned, they are useless...
>> honestly.
>>
>> ** Does this cause problems with class allocation? Are/can classes be
>> allocated
>> to an alignment as inherited from an aligned member? ... If not, this
>> might be
>> the bulk of the work.
>>
>
> The only real issue with alignment is getting the stack aligned to 16
> bytes. This is already true of 64 bit code gen, and 32 bit code gen for OS
> X.
>

It's important for all implementations of simd units, x32, x64, and others.
As said, if aligning the x32 stack is too much trouble, I suggest silently
passing by const ref on x86.

Are you talking about for parameter passing, or for local variable
assignment on the stack?
For parameter passing, I understand the x32 problems with aligning the
arguments (I think it's possible to work around though), but there should
be no problem with aligning the stack for allocating local variables.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20120106/afe5c0a9/attachment-0001.html>


More information about the Digitalmars-d mailing list