[Ffmpeg-devel] No llrint() in Cygwin

Michael Niedermayer michaelni
Tue Sep 26 15:53:40 CEST 2006


Hi

On Tue, Sep 26, 2006 at 03:39:35PM +0200, V?ctor Paesa wrote:
> Hi,
> 
> 
> > Vi?ctor Paesa said:
> >> Hi,
> >>>
> >>> SVN r6290 brought llrint(), but that function is not defined in Cygwin
> >>> (because it uses newlib for math.h).
> >>>
> >>> I found this LGPL code that defines llrint() as inline for x86:
> >>>
> >>> http://sourceware.org/ml/cygwin/2002-12/msg01146/mathinline.h
> >>>
> >>> Would it be acceptable to copy that llrint() implementation
> >>> into libavcodec/i386/mathops.h ?
> >>>
> >>
> >> Maybe this patch will ignite some comments:
> >>
> >> ===================================================================
> >> --- ffmpeg/libavcodec/i386/mathops.h    (revision 6329)
> >> +++ ffmpeg/libavcodec/i386/mathops.h    (working copy)
> >> @@ -37,3 +37,16 @@
> >>       asm ("imull %2\n\t" : "=A"(rt) : "a" (ra), "g" (rb));\
> >>       rt; })
> >>
> >> +#ifndef llrint
> >> +#define __llrint_code \
> >> +    long long int __llrintres;\
> >> +    __asm__ \
> >> +    ("fistpll %0" \
> >> +    : "=m" (__llrintres) : "t" (__x) : "st"); \
> >> +    return __llrintres
> >> +
> >> +__inline long long int llrint (double __x)
> >> +{
> >> +    __llrint_code;
> >> +}
> >> +#endif
> >
> > Identifiers starting with __ are reserved for the system.
> 
> OK
> 
> > What's the purpose of the macro?
> 
> In the original code it had a meaning, the macro was
> reused by llrint(), llrintf(), llrintl().
> Since I'm not familiar at all with inline assembler
> I tried to minimize changes.
> 
> What about this new version:

rejected, i will not accept a llrint() function implementation in libav*
unless its really needed (which isnt the case)

fix the code which uses llrint()

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

In the past you could go to a library and read, borrow or copy any book
Today you'd get arrested for mere telling someone where the library is




More information about the ffmpeg-devel mailing list