www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 10826] New: Should the D GC allocate double4[] aligned to 32 bytes?

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10826

           Summary: Should the D GC allocate double4[] aligned to 32
                    bytes?
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: druntime
        AssignedTo: nobody puremagic.com
        ReportedBy: bearophile_hugs eml.cc



Currently the D GC allocates arrays aligned to 16 bytes fit to be used in XMM
registers:

auto a1 = new double2[128];


But I think the D GC should also return this a2 aligned to 32 bytes, as needed
for efficiency for code that uses YMM registers, that are 256 bits long:

auto a2 = new double4[64];


Eventually the D GC should return this a3 aligned to 64 bytes for efficiency of
code that uses ZMM registers (Intel Xeon Phi), that are 512 bits long:

auto a3 = new double8[32];

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Aug 15 2013
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10826


Manu <turkeyman gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |turkeyman gmail.com



Yes, double4 should intrinsically be align(32), just like float4/double2 is
intrinsically align(16). Likewise, align(64) for ZMM regs.

The GC should respect the explicit alignment of any type. If it doesn't, then
that is another bug.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Aug 15 2013
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10826




For clarity, as a simple compiler rule, all __vector() types should be
intrinsically aligned to their .sizeof.
This is correct on all architectures I know of.
There is the occasional architecture that might not mind a smaller alignment,
but I think it's still valuable to enforce the alignment on those (rare)
platforms for portability (structure consistency across platforms), especially
since those platforms are often tested less thoroughly.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Aug 15 2013