Any chance of 128-bit alignment of static arrays?

Dan murpsoft at hotmail.com
Mon Oct 29 18:27:50 PDT 2007


Walter Bright Wrote:

> Don Clugston wrote:
> > When using SSE/SSE2, it's necessary to have arrays aligned to 128-bit 
> > (16 byte) boundaries. For DMD Windows, this is satisfied for arrays 
> > allocated on the heap, but not for arrays on the stack, nor for static 
> > arrays.
> > 
> > There's no workaround that I know of; for example, you cannot put the 
> > array in a struct and specify an alignment, because the struct itself 
> > will only be aligned to a 8 byte boundary.
> > 
> > I recognize that there are major difficulties in aligning arrays on the 
> > stack, but could we get 16 byte -aligned double and float static arrays 
> > and array literals? Or is this an OPTLINK limitation?
> 
> It's not an optlink problem. Let me look into it.

Heh, actually Walter, I've been studying alot on osdev.org, and I've completely given up with D because it only allows me to program for an obsolete platform.

I really do like the notation, but it's the final code that counts, and only YASM assembler is letting me do what I need to.

If I may be so brash; D needs ucent, 16-byte alignment, XMM8-15, R*X 64-bit GPR's, the amd64 instruction set, version(Windows64), version(linux64), and version(DInline_Asm*) with that featureset.

If ucent is done properly, I understand it'll take alot of work.  You'd want to bind it to the XMM registers and they use completely different instructions than ulong's and uints.

Anyways, I'll talk to you guys later.



More information about the Digitalmars-d mailing list