[MPlayer-dev-eng] icc benchmark

Uoti Urpala uoti.urpala at pp1.inet.fi
Mon Jun 11 21:40:41 CEST 2007


On Mon, 2007-06-11 at 09:20 +0000, Carl Eugen Hoyos wrote:
> Uoti Urpala <uoti.urpala <at> pp1.inet.fi> writes:
> > On Mon, 2007-06-11 at 00:15 +0200, Carl Eugen Hoyos wrote:
> > > I will try to produce a patch, it would include something like the
> > > following, would that be acceptable?
> > 
> > > -# define attribute_used __attribute__((used))
> > > +# define attribute_used __attribute__((used)) static
> > 
> > This doesn't seem to make much sense alone; do you mean to use this
> > combined with removing the "static" from all the variables?
> 
> yes.
> 
> > I don't like
> > the effects this idea has either for gcc (having the name
> > "attribute_used" unintuitively imply "static")
> 
> What about attribute_used_static?

Somewhat ugly, and completely wrong for icc (as the whole point of that
hack is to make it NOT static under icc...).

> > or for icc (making all the variables global).
> 
> I'd be more than happy to hear of a simpler alternative.

I think the only non-hacky/ugly way that would also be "guaranteed" to
work (as long as the compilers actually work...) would be to use asm
constraints. I don't know if there's still compiler brokenness which
would prevent this from working with icc 10.0; at least some tests I
made seemed to indicate it working correctly.

Attached is an example change for liba52/imdct.c (chosen just because it
was the last file among initial icc error messages). The READ_ARRAY
macro would obviously be defined in a header instead of per file. This
version seems to work right with both gcc and icc.

I think this method of accessing arrays would also be the right one to
use in other code independently of variable elimination issues. It tells
the compiler which area of memory the asm actually accesses so the
compiler knows dependencies correctly; not so much an issue with const
arrays but could matter for non-const ones.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fix_asm_array_access.diff
Type: text/x-patch
Size: 8492 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20070611/7b7fe5b7/attachment.bin>


More information about the MPlayer-dev-eng mailing list