New Altivec-optimized valarray implementation

Discussion in 'C++' started by Glen Low, Jun 25, 2003.

  1. Glen Low

    Glen Low Guest

    I have written a new implemention of the std::valarray library that is
    optimized to use Altivec (Apple's "Velocity Engine", part of the
    PowerPC G4's in most Macintoshes and the announced IBM PPC 970). The
    implementation is mostly standard conforming and is complete.

    As soon as I get my shingle up on the web (1 or 2 day's time), I'll
    post the library and its accompanying docs, which I call "MacSTL".
    Would like comments, tests, discussions of it...

    Preliminary benchmarks on my Power Mac G4 make it 550% faster on
    inlined arithmetic, 1360% faster on inlined transcendentals and 290%
    faster on summation than the gcc 3.1 std::valarray. Even the
    non-Altivec-optimized inline arithmetic is 50% faster than gcc, due to
    ruthless elimination of extrenous loads and stores by using STL-style
    algorithms.

    I sense that std::valarray is somewhat of a dead horse out there, but
    I believe I can show there's still some life left in that concept. As
    for Altivec, it's still up and coming!

    P.S. The library also has several STL-influenced concepts for the Mac
    (or BSD/PowerPC): std::vectors with Mach copy-on-write semantics,
    clean COM wrappers using just std containers, zlib wrapped in std
    iostreams...
    Glen Low, Jun 25, 2003
    #1
    1. Advertising

  2. Glen Low

    Ron Natalie Guest

    "Chandra Shekhar Kumar" <> wrote in message news:...
    > i think this is the wrong news-group for yr msg...plzz post it at
    > comp.std.c++
    >

    Please don't.
    Ron Natalie, Jun 25, 2003
    #2
    1. Advertising

  3. Glen Low wrote:

    > I have written a new implementation of the std::valarray library
    > that is optimized to use AltiVec (Apple's "Velocity Engine",


    AltiVec(tm) is Motorola's trademark
    for the first PowerPC SIMD extension.

    http://www.simdtech.org/altivec

    > part of the PowerPC G4's in most Macintoshes
    > and the announced IBM PPC 970).
    > The implementation is mostly standard conforming and is complete.


    > As soon as I get my shingle up on the web (1 or 2 day's time),
    > I'll post the library and its accompanying docs,
    > which I call "MacSTL".
    > Would like comments, tests, discussions of it...


    > Preliminary benchmarks on my Power Mac G4 make it 550% faster
    > on inlined arithmetic, 1360% faster on inlined transcendentals
    > and 290% faster on summation than the gcc 3.1 std::valarray.
    > Even the non-Altivec-optimized inline arithmetic
    > is 50% faster than gcc, due to ruthless elimination
    > of extraneous loads and stores by using STL-style algorithms.
    >
    > I sense that std::valarray is somewhat of a dead horse out there but
    > I believe I can show there's still some life left in that concept.
    > As for Altivec, it's still up and coming!
    >
    > P.S. The library also has several STL-influenced concepts for the Mac
    > (or BSD/PowerPC): std::vectors with Mach copy-on-write semantics,
    > clean COM wrappers using just std containers, zlib wrapped in std
    > iostreams...


    You might want to post this to the Object Oriented Numerics mailing list

    http://www.oonumerics.org/mailman/listinfo.cgi/oon-list/

    I believe that Kent Budge still subscribes to this list
    and he may appreciate vindication.

    You might also visit the
    High Performance Embedded Computing Software Initiative (HPEC-SI)

    http://www.hpec-si.org/

    They are working on a C++ binding for
    the Vector Signal Image Processing Library (VSIPL)

    http://www.vsipl.org/

    There are several implementations of the VSIPL now
    for AltiVec on the PowerPC and you really should be
    benchmarking your implementation of std::valarray against them.

    Also, do you plan an implementation for The Power Mac G5

    http://www.apple.com/powermac/
    E. Robert Tisdale, Jun 26, 2003
    #3
  4. Glen Low

    Glen Low Guest

    > You might want to post this to the Object Oriented Numerics mailing list
    >
    > http://www.oonumerics.org/mailman/listinfo.cgi/oon-list/
    >
    > I believe that Kent Budge still subscribes to this list
    > and he may appreciate vindication.


    I will do that once I get back to my own Mac. Yes, I have seen Kent's
    rationale at the site and I'll be linking to it from my own website,
    once it's up.

    > There are several implementations of the VSIPL now
    > for AltiVec on the PowerPC and you really should be
    > benchmarking your implementation of std::valarray against them.


    I was hoping for a wider audience and thus targetted std::valarray.

    > Also, do you plan an implementation for The Power Mac G5
    >
    > http://www.apple.com/powermac/


    Definitely! I tried to get out my library before the WWDC
    announcement, in the hopes that the rumors were true and get some
    additional publicity. Alas several sleepless nights and time off my
    day job and I only finished it on Monday or so, sans docs which I'm
    working on now.

    I've taken a look at the developer.apple.com site new G5 docs and it
    looks good for what I am doing, especially since Altivec code is
    bandwidth sensitive. For example aligning loops for maximal
    performance would dovetail nicely with my inline implementation. I'll
    have to download the gcc 3.3 compiler that they've provided and see
    how it goes.

    Cheers,
    Glen
    Glen Low, Jun 26, 2003
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Marc Schellens

    Re: valarray resize

    Marc Schellens, Jul 29, 2003, in forum: C++
    Replies:
    5
    Views:
    1,275
    Marc Schellens
    Jul 30, 2003
  2. =?ISO-8859-1?Q?Christian_Brechb=FChler?=

    Enhancing valarray with "normal" arithmetic operators

    =?ISO-8859-1?Q?Christian_Brechb=FChler?=, Sep 12, 2003, in forum: C++
    Replies:
    6
    Views:
    946
    =?ISO-8859-1?Q?Christian_Brechb=FChler?=
    Sep 14, 2003
  3. Jim West

    const and valarray reference

    Jim West, Oct 23, 2003, in forum: C++
    Replies:
    4
    Views:
    1,126
    Victor Bazarov
    Oct 24, 2003
  4. Jim West
    Replies:
    2
    Views:
    489
    Jim West
    Dec 23, 2003
  5. Python and AltiVec

    , Dec 23, 2006, in forum: Python
    Replies:
    0
    Views:
    264
Loading...

Share This Page