Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Community > MacNN Lounge > AltiVec enhanced Flash

AltiVec enhanced Flash
Thread Tools
Clinically Insane
Join Date: Dec 1999
Status: Offline
Reply With Quote
Apr 5, 2005, 07:01 PM
 
OK, so "vector" and "vector" are two different things when comparing SIMD and what Flash does.

However, this nifty article posted on MacNN has (at least, what I've grasped from it) a relatively easy to understand explanation of AltiVec.

What caught my eye was this:

The 32-bit values can be integer or floating point, and all integer values can be signed or unsigned... Furthermore, AltiVec supports an additional type, called pixel, that holds eight 16-bit pixel values. Past this, there's a fairly large number of instructions that perform various operations: loading registers from memory, performing arithmetic on them (in various types), and writing them back.
So why can't Flash be AltiVec enhanced?
     
Clinically Insane
Join Date: Nov 1999
Status: Offline
Reply With Quote
Apr 5, 2005, 07:36 PM
 
Keep in mind that Flash isn't bitmap-based; it only has a concept of pixels when actually drawing everything that it has calculated onto the screen. That aspect of graphics has been well-known and well-optimized for many years now, and AltiVec's pixel type can't do much to make it any faster. The performance bottlenecks come before this step. Where AltiVec's pixel type comes in handy is performing operations on bitmapped images before drawing them onscreen, which is the kind of thing that CoreImage (which makes heavy use of AltiVec) does.

What does this mean for Flash? Recall that for vector units to be able to do anything, they have to be able to perform the same operation on lots of data (Same Instruction, Multiple Data: this is why some people call AltiVec a SIMD (pronounced "Sim-Dee") unit). Once again, this works well for things like filtering bitmaps and compressing or decompressing video, but most Flash animations have all sorts of things doing different things at once. Although specific Flash animations might be done in such a way as to take advantage of AltiVec, there's no way to tell when one of those is about to be played.

If it's any consolation, Flash doesn't have anything in the way of MMX/SSE/3DNow optimization on the PC side of things either. These units all work in very similar ways to AltiVec, which makes them just as unsuitable for Flash.
You are in Soviet Russia. It is dark. Grue is likely to be eaten by YOU!
     
Clinically Insane
Join Date: Dec 1999
Status: Offline
Reply With Quote
Apr 5, 2005, 07:56 PM
 
What about Core Image?
     
Clinically Insane
Join Date: Nov 1999
Status: Offline
Reply With Quote
Apr 5, 2005, 08:34 PM
 
Originally posted by olePigeon:
What about Core Image?
CoreImage works mainly on bitmapped images, so it should be able to use AltiVec quite impressively.
You are in Soviet Russia. It is dark. Grue is likely to be eaten by YOU!
     
Addicted to MacNN
Join Date: Feb 2001
Location: zurich, switzerland
Status: Offline
Reply With Quote
Apr 6, 2005, 08:39 AM
 
Originally posted by olePigeon:
OK, so "vector" and "vector" are two different things when comparing SIMD and what Flash does.

However, this nifty article posted on MacNN has (at least, what I've grasped from it) a relatively easy to understand explanation of AltiVec.

What caught my eye was this:



So why can't Flash be AltiVec enhanced?
Vector graphics programming involves a lot of simultaneous floating point calculation AFAIKs, and, I suppose that Pentiums are in some way better at this than PPC. I'm not sure, though. Perhaps, when one looks at the Flash programme itself and sees the crappy, slow interface on OSX versus the snappy fast one on Windows, then it's probably Macromedia's fault for trying to port their proprierty interface GUI to OSX instead of using Apple's HIG.
weird wabbit
     
Addicted to MacNN
Join Date: Dec 1999
Location: Tampa, Florida
Status: Offline
Reply With Quote
Apr 6, 2005, 10:41 AM
 
Vectors in Altivec are strings of floating point numbers.
Vectors in Flash are pairs of numbers.
Altivec could indeed accelerate Flash, but the reasoning is that Macromedia simply doesn't want to do it. It would take more engineering than we (Mac users) are worth.
     
Clinically Insane
Join Date: Nov 1999
Status: Offline
Reply With Quote
Apr 6, 2005, 11:27 AM
 
Originally posted by The Godfather:
Vectors in Altivec are strings of floating point numbers.
Vectors in Flash are pairs of numbers.
You're still not understanding the difference between a graphics vector and a storage vector. What Flash calls a "vector" is not what AltiVec calls a "vector". They are entirely different things.

All that AltiVec does, essentially, is set up a fast way of performing single operations on many chunks of data at once. The instructions themselves do not run any faster; what AltiVec does is to eliminate the overhead of setting up and cleaning up after those operations after every iteration.

Now, it is theoretically possible -though extremely unlikely- that Flash's vectors are stored as a pair of numbers in a format which AltiVec could use. However, with only two numbers, the overhead of sending the vector to AltiVec could very well overshadow the performance benefit of SIMD calculation. This is definitely the case for a single number, which is why AltiVec is only part of the processor rather than the entire thing itself. It may also be the case for two numbers; I'm not sure. Even if there isn't an actual decrease, the overhead saved from the second operation is not enough to be much if any of a benefit.

Flash doesn't take advantage of the various x86 vector units either, and this is why: there's no benefit to it. Flash would not get appreciably faster by using these units, and it may even get slower. Vector units just plain aren't the right tool for this job.
You are in Soviet Russia. It is dark. Grue is likely to be eaten by YOU!
     
Addicted to MacNN
Join Date: Feb 2001
Location: zurich, switzerland
Status: Offline
Reply With Quote
Apr 6, 2005, 11:32 AM
 
Originally posted by The Godfather:
Vectors in Altivec are strings of floating point numbers.
Vectors in Flash are pairs of numbers.
Altivec could indeed accelerate Flash, but the reasoning is that Macromedia simply doesn't want to do it. It would take more engineering than we (Mac users) are worth.
Yeah, that one got me as well. The vector registers in Altivec would be ideal for vector graphics (since transforms etc involve a lot of FP math), but probably, Flash doesn't use since it would break a lot of the so called portability. Macromedia still has the braindead dream that Flash will eventually win over the whole web, including the booming market for mobile devices, where a lot of the new devices include a flash player, but don't have any SIMD enhancements.

That said, they must be optimising for SSE on x86, and they really could do the same on Altivec.
weird wabbit
     
Professional Poster
Join Date: Mar 2002
Location: Smallish town in Ohio
Status: Offline
Reply With Quote
Apr 6, 2005, 12:07 PM
 
I don't understand why Apple doesn't recognize the huge problem from Flash being 3x slower on the Mac than the PC? Why doesn't Apple offer Macromedia to optimize it themselves from the sourcecode?
     
Professional Poster
Join Date: Oct 2000
Location: France
Status: Offline
Reply With Quote
Apr 6, 2005, 12:40 PM
 
I think this thread comes down to the old classic:

"why does Flash suck so hard on OSX?"

And I'll wager the answer is nothing to do with AltiVec.
     
Addicted to MacNN
Join Date: Oct 2002
Location: Boston, MA
Status: Offline
Reply With Quote
Apr 6, 2005, 12:57 PM
 
I'm disappointed not seeing an enhanced flash.

"Never give in, never give in, never, never, never, never - in nothing, great or small, large or petty - never give in except to convictions of honor and good sense." Winston Churchill
     
Addicted to MacNN
Join Date: Aug 2004
Location: FFM
Status: Offline
Reply With Quote
Apr 6, 2005, 01:18 PM
 
Originally posted by olePigeon:
So why can't Flash be AltiVec enhanced?
How do you know it isn't?
     
Mac Elite
Join Date: Oct 2000
Status: Offline
Reply With Quote
Apr 6, 2005, 01:21 PM
 
     
Clinically Insane
Join Date: Nov 1999
Status: Offline
Reply With Quote
Apr 6, 2005, 01:57 PM
 
Originally posted by theolein:
Yeah, that one got me as well. The vector registers in Altivec would be ideal for vector graphics (since transforms etc involve a lot of FP math)...
No. Floating-point math by itself is dealt with by the floating-point unit, not the vector unit. PowerPC machines have been relatively weak in floating-point operations ever since the G3, when Motorola decided to neglect performance in this area to focus instead on integer and cache operations. The overall result was a lot faster, when measured across all areas, but even the 604 chip from the previous generation could smoke a G3 of equal clockrate in floating-point performance.

Also, most vector transforms have to perform different operations on the X- and Y-coordinates (and any other applicable coordinates) of the item being transformed: MIMD, not SIMD. A simple example has to do with converting polar vectors (magnitude and angle, sometimes called r and theta) to Cartesian ones (X and Y): one coordinate needs a cosine operation while the other needs a sine operation. Vector units cannot do this; it's not what they're designed for.

You might ask, "What Flash animations have to convert polar coordinates to Cartesian ones?" The answer: almost all of them, particularly real-time games. Nanaca Crash, in fact, does quite a lot of it. This particular operation is a simple example, but it is an extremely common one. I chose it to show just how fundamentally different Flash is from just about anything that AltiVec does.
That said, they must be optimising for SSE on x86, and they really could do the same on Altivec.
They are not optimizing for SSE on x86. They can't optimize for SSE, in fact; it has the same issues that AltiVec does. Vector units are not magical go-faster instruction sets: they work in a specific way, and it happens that Flash does not.

Why is Flash faster on the PC? A lot of it does have to do with optimization, but frankly Flash does touch on some of the POWER architecture's major weak points.
You are in Soviet Russia. It is dark. Grue is likely to be eaten by YOU!
     
Clinically Insane
Join Date: Nov 1999
Status: Offline
Reply With Quote
Apr 6, 2005, 02:09 PM
 
Originally posted by Synotic:
nextgen flash player demo in tokyo.
Impressive indeed. I like the Homestar Runner reference.

It should be noted that optimizing for a specific processor is not the only way to make a program faster. In fact, it's only the last-resort method, because you don't often get a lot of bang for the proverbial buck. If you can improve the algorithms used by the program, you'll often get a much bigger boost, and you'll get it without hurting portability. This is most likely where the performance boost from the demonstration is coming from.
You are in Soviet Russia. It is dark. Grue is likely to be eaten by YOU!
     
Addicted to MacNN
Join Date: Dec 1999
Location: Tampa, Florida
Status: Offline
Reply With Quote
Apr 6, 2005, 02:13 PM
 
Originally posted by Synotic:
nextgen flash player demo in tokyo.
GlobFX had the first hardware accelerated Flash player.
     
Addicted to MacNN
Join Date: Dec 1999
Location: Tampa, Florida
Status: Offline
Reply With Quote
Apr 6, 2005, 06:06 PM
 
Originally posted by Millennium:
Impressive indeed. I like the Homestar Runner reference.
It wasn't a reference. It was a full in-your-face homage.
     
Clinically Insane
Join Date: Dec 1999
Status: Offline
Reply With Quote
Apr 6, 2005, 06:58 PM
 
I can't watch WMVs at work. Apparently it's now Snappy™, but I'm assuming on Windows? The Mac version (if there is one) will probably still suck ass. 125fps calendar will probably be like the original 15fps.
     
Addicted to MacNN
Join Date: Feb 2001
Location: zurich, switzerland
Status: Offline
Reply With Quote
Apr 6, 2005, 07:24 PM
 
The demos were run on a Mac with OSX.
weird wabbit
     
   
Thread Tools
Forum Links
Forum 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 On
Top
Privacy Policy
All times are GMT -5. The time now is 03:14 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2