Menu

altivec, and arrays

Greg Hazel
2005-03-31
2013-03-27
  • Greg Hazel

    Greg Hazel - 2005-03-31

    Hey, I've found this little project to be handy, and not bloated like the others.
    I have three requests though:

    1:

    it's safe to add:

    #ifdef __MSVC__X86__
       #include <simd_cp_x86.h>
    #endif

    2:

    I need a way to use simd_m128 types with arrays I know to be aligned properly. A popular thing for me to do is:

    __declspec(align(16)) float array[SIZE][SIZE];

    __m128* pSrc1 = (__m128*)array[i];
    pSrc1[j] = _mm_mul_ps(pSrc1[j],m_factor);

    for which I can't seem to use simd_m128, because of the casting.

    3:

    Also, Altivec support would be killer.

     
    • popper1

      popper1 - 2006-03-05

      if your interested in optimised AltiVec you might take a look here for several pointers from many altivec coders and hardware adept people (freescale etc) plus a free GlibC altivec hand optimised lib.

      there are many (and current 06)useful snippets of information/code and links to all that you might need/want in the /devs and /altivec sections/postings.

      "
      markos has made a freely usable library to take advantage of the Altivec unit
      http://www.ppczone.org/forums/viewtopic.php?t=387
      " First, a short info:
      libfreevec is a free (LGPL) library with hand-optimized replacement routines for GLIBC, such as memcpy(), strlen(), etc. These routines have been written specifically to take advantage of the AltiVec (a.k.a Velocity Engine or VMX), and will only work on processors that include this unit. This means they will not work on older processors, such as 603, 604, 750 (G3) or the POWER family of CPUs.

      Check the site for more information, and download the source (soon a Debian package will be available):

      http://freevec.org/

      Thanks to Genesi for sponsoring this effort and for creating the ODW, a great development platform!

      Regards

      Konstantinos Margaritis

      PS. For the impatient amongst you, make sure you set
      CFLAGS="-O3 -maltivec -funroll-loops -DHAVE_ALTIVEC_H"
      to compile for max performance."

      http://freevec.org/
      "Thanks to the support by Genesi and Freescale, I was given an Open Desktop Workstation for development purposes at the show and was highly motivated to do software development on this platform. Soon after the seminars ended, I started researching for source code on programming the AltiVec unit and its applications. To my surprise, I discovered that the G4 vector engine is basically unused by Linux itself which happens to be my platform of choice whereas it speeds up many system components in MacOS X."

      "did you know that you can do byte swapping with AltiVec 7 times faster than with scalar code? Or that it is possible to sort integers and floats 4 times faster with the help of AltiVec? Were you aware that it helps to do string searching faster? Memory hashing gets upto 7 times faster. The list could just go on and on... "

       

Log in to post a comment.