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: llrint implementation in Cygwin


Hi,

Brian Dessent writes:
> 
> Dave Korn wrote:
> 
> > I don't think it was being advocated in general, but I think it's reasonable
> > to assume that a pure const function like llrint isn't going to do anything
> > wacky.
> 
> Yes, I realize it was probably not a worry in this particular case, but
> I didn't want somebody stumbling on the archives at a later date and
> getting the bright idea that you could just go around extracting random
> objects from a MinGW library for use in a Cygwin link.

I completely agree, most of the time it is a very bad idea to mix MinGW objects
with Cygwin's ones, that is why I extracted the llrint.o instead of linking 
to libmingwex.a

And indeed llrint.o works only because it is self-contained.
I checked that at the code:

$ cat /usr/src/cygwin-1.5.24-2/winsup/mingw/mingwex/math/llrint.c
#include <math.h>

long long llrint (double x) 
{
  long long retval;
  __asm__ __volatile__                                                        \
    ("fistpll %0"  : "=m" (retval) : "t" (x) : "st");                          
      \
  return retval;
}

Regards,
Victor


--
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]