[MPlayer-dev-eng] icc benchmark

Michael Niedermayer michaelni at gmx.at
Tue Jun 12 13:25:38 CEST 2007


Hi

On Tue, Jun 12, 2007 at 03:56:53AM -0700, Trent Piepho wrote:
> On Tue, 12 Jun 2007, Uoti Urpala wrote:
> >
> > > Except for namespace polution: Is there another disadvantage with global
> > > variables?
> 
> When building ELF shared libraries, non-static global variables require an
> extra indirection to access (unless their visibility is changed from the
> default).  They also make the dynamic symbol table larger and so slow down
> dynamic linking.

you compile mplayer as shared lib?
furthermore the access over MANGLE() will not generate
an extra indirection and the variables we speak about are only accessed over
that otherwise they wouldnt need attribute used


> 
> There are also optimizations that gcc can do to static globals that it can't
> do it non-static globals.

gcc limitation, but the non static global case was specifically for icc which
i suspect does not have such limitations


> 
> > That's a very big "except". Another reason to move from MANGLE to asm
> > arguments is that almost all current uses of MANGLE are in fact unsafe.
> > Each asm block must either read and write only the arguments given OR
> > have "memory" in the globber list. Most of the asm blocks that currently
> 
> Even having "memory" in the clobber list isn't enough.  For example:
> 
> int x;
> main() {
> 	int y;
> 	x = 1;
> 	// asm("mov x, %0" : "=r"(y)); 			// version A
> 	// asm("mov x, %0" : "=r"(y) : : "memory");	// version B
> 	// asm("mov %1, %0" : "=r"(y) : "m"(x));	// version C
> 	x = 2;
> 	printf("%d\n", y);
> }
> 
> The asm statement is supposed to move the global "x" to the local y, and x is
> supposed to be 1 when this happens.  This code should print 1, but what does
> it do?
> Version A, prints 2
> Version B, prints 0
> Version C, prints 1

its asm volatile not asm your code is buggy and it is clearly documented that
non volatile asm can be moved around

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I have never wished to cater to the crowd; for what I know they do not
approve, and what they approve I do not know. -- Epicurus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20070612/7d241f40/attachment.pgp>


More information about the MPlayer-dev-eng mailing list