[FFmpeg-devel] [PATCH 2/5] libavutil: Optimize clipping routines for avr32

Michael Niedermayer michaelni
Wed Feb 18 15:53:35 CET 2009


On Wed, Feb 18, 2009 at 03:39:40PM +0100, Reimar D?ffinger wrote:
> On Wed, Feb 18, 2009 at 03:27:00PM +0100, Hans-Christian Egtvedt wrote:
> > +#if ARCH_AVR32
> > +#define av_clip(a, amin, amax)                               \
> > +    ({                                                       \
> > +        int __tmp__;                                         \
> > +        __asm__ ("min\t%0, %1, %2\n"                             \
> > +             "max\t%0, %0, %3\n"                             \
> > +             : "=&r"(__tmp__) : "r"(a), "r"(amax), "r"(amin) \
> > +	);                                                   \
> > +        __tmp__;                                             \
> > +    })
> > +#else
> 
> Please use a static inline function instead of such gcc-isms, if the
> compiler generates worse code for that the compiler should be fixed.

besides of course ideally the compiler should be fixed to detect
MIN/MAX and use the appropriate instructions, this likely has a bigger
gain than asm-izing av_clip()

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The worst form of inequality is to try to make unequal things equal.
-- Aristotle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090218/b4cd1bf8/attachment.pgp>



More information about the ffmpeg-devel mailing list