Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > New Altivec-optimized valarray implementation

Reply
Thread Tools

New Altivec-optimized valarray implementation

 
 
Glen Low
Guest
Posts: n/a
 
      06-25-2003
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...
 
Reply With Quote
 
 
 
 
Ron Natalie
Guest
Posts: n/a
 
      06-25-2003

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

Please don't.


 
Reply With Quote
 
 
 
 
E. Robert Tisdale
Guest
Posts: n/a
 
      06-26-2003
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/li....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/

 
Reply With Quote
 
Glen Low
Guest
Posts: n/a
 
      06-26-2003
> You might want to post this to the Object Oriented Numerics mailing list
>
> http://www.oonumerics.org/mailman/li....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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Why not use valarray<valarray<T> > ? Jim West C++ 2 12-23-2003 03:54 PM
valarray assignment question Prune Tracy C++ 0 11-15-2003 03:44 PM
const and valarray reference Jim West C++ 4 10-24-2003 08:30 PM
Enhancing valarray with "normal" arithmetic operators =?ISO-8859-1?Q?Christian_Brechb=FChler?= C++ 6 09-14-2003 06:39 PM
Re: valarray resize Marc Schellens C++ 5 07-30-2003 07:06 AM



Advertisments