This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] lrint/lrintf oddity


Erik de Castro Lopo wrote:

> Err, what??????????????
> 
> On Linux, the lrintf() function is an inline function that reduces to
> a single asm instruction.

Linux uses glibc, Cygwin uses newlib.  They're not the same thing. 
Glibc is highly optimized and tweaked, newlib is designed as a small and
portable libc for embedded systems.  It does not have inline versions of
these functions.

> I'm using lrintf() to convert huge arrays of floats to ints. I'd like
> that to be reasonably quick :-). Any chance of replacing all that code
> you've got with a single inline asm instruction like Linux has?

<http://cygwin.com/acronyms/#PTC>.  The newlib mailing list is right
over there -->

Be aware that newlib supports a wide variety of platforms, some with no
FPU, so you can't just go yanking stuff out.

If you don't care about portability you could probably #define the
inline asm versions of the functions.

Brian

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]