[MPlayer-dev-eng] Via C3 FPU performance optimalisation

Joey Parrish joey at nicewarrior.org
Wed Aug 25 19:50:31 CEST 2004


On Wed, Aug 25, 2004 at 07:28:27PM +0200, iSteve wrote:
> Greetings,
> I'm generally clueless person, as it comes to coding, and especially 
> low-level stuff, but I've found out this FPU performance boost trick for 
> Via C3 processors, and as as far as I know, video playback depends on 
> fpu a lot, so it might be nice to use this in mplayer optimalisations, 
> as C3 processors are used in hometheater PCs a lot.
> 
> http://www.vanshardware.com/articles/2004/03/040331_C3Fpu/040331_C3Fpu.htm

Someone should write a patch.  I don't get it.
Quoting from the page:
> All Borland compilers automatically create binaries that unmask several
> floating point exceptions upon program initialization.  Delphi 7 unmasks
> FPU invalid operations, divide by zero, and overflow conditions.  The
> specific Delphi 7 FPU initialization assembly routine is:
> 
>     fninit
>     wait
>     fldcw word ptr [Default8087CW]
>     ret
> 
> The first command initializes the floating point unit to a known
> condition that masks all exceptions, but the third line loads a
> predefined 16-bit variable into the FPU's control register which then
> unmasks the exceptions listed above.  The value of Default8087CW is set
> to $1372 in Delphi 7 whereas the default state of the floating point
> control register after initialization is $037F.
> 
> The VIA C3 line of CPUs all currently feature scalar pipelines that were
> designed for IEEE standards and suffer performance penalties when any
> FPU exceptions are unmasked.  Fortunately, it is very easy and usually
> safe to mask all FPU exceptions.  In fact, it is often more problematic
> to leave FPU exceptions unmasked especially when interfacing with DLLs
> built under different compilers.  For instance, FPU exceptions must be
> masked when creating an OpenGL program or the program could crash when
> returning from an OpenGL routine.

I don't have any idea what to do with that.

--Joey

-- 
"Of the seven dwarves, the only one who shaved was Dopey.
That should tell us something about the wisdom of shaving."




More information about the MPlayer-dev-eng mailing list