_aligned_malloc

Discussion in 'CellPerformance@B3D' started by c94wjpn, Nov 12, 2007.

  1. c94wjpn

    Newcomer

    Joined:
    Nov 7, 2007
    Messages:
    8
    Likes Received:
    0
    I notice that in other intrinsic worlds, there is an _aligned_malloc which returns a memory block on a specified alignment boundary. I can't seem to find one in Sony's documentation. Is there one and what is it called?
     
  2. c94wjpn

    Newcomer

    Joined:
    Nov 7, 2007
    Messages:
    8
    Likes Received:
    0
    the usual function is memalign from the standard lib (you'll find it in malloc.h).
    The man page says that it's obsolete, but I guess you just have to ignore that.

    You definitely need to have a function like memalign if you're working in the intrinsics
    world(s). I guess Sony haven't provided one because memalign is ok.

    I found this on page 2 of Sony's docs:
    "Dereferencing the vector pointer p implies a 128-bit vector load from or store to the address obtained by masking
    the 4 least significant bits of p. When a vector is misaligned, the 4 least significant bits of its address are nonzero.
    Although vectors are 16-byte aligned (see section “1.6. Alignment”), "


    which does say that vectors need to be 16-byte aligned. Read Sony's documentation.
     
  3. c94wjpn

    Newcomer

    Joined:
    Nov 7, 2007
    Messages:
    8
    Likes Received:
    0
    thank you for that brilliant reply. You are a genius. No, actually you are a professional.
    Well done and thank you. You set an example that everyone should follow.
     
  4. Simon F

    Simon F Tea maker
    Moderator Veteran

    Joined:
    Feb 8, 2002
    Messages:
    4,560
    Likes Received:
    157
    Location:
    In the Island of Sodor, where the steam trains lie
    :?:
     
  5. Panajev2001a

    Veteran

    Joined:
    Mar 31, 2002
    Messages:
    3,187
    Likes Received:
    8
    http://www.ibm.com/developerworks/blogs/page/powerarchitecture?tag=forums

    That is a good reference: a collection of posts in the CELL BE dev forums.

    If you are doing SPU side work, using the provided (CELL SDK) malloc_align is preferred:

     

Share This Page

  • About Us

    Beyond3D has been around for over a decade and prides itself on being the best place on the web for in-depth, technically-driven discussion and analysis of 3D graphics hardware. If you love pixels and transistors, you've come to the right place!

    Beyond3D is proudly published by GPU Tools Ltd.
Loading...