X-Recipient: archive-cygwin@delorie.com
X-Spam-Check-By: sourceware.org
To: cygwin@cygwin.com
From: Victor Paesa <wzrlpy@arsystel.com>
Subject:  Re: llrint implementation in Cygwin
Date: Mon, 29 Oct 2007 14:14:37 +0000 (UTC)
Lines: 36
Message-ID:  <loom.20071029T140039-846@post.gmane.org>
References:  <fd68u2$geo$1@sea.gmane.org> <46F6C151.3070301@computer.org> <loom.20071029T111515-144@post.gmane.org> <4725D1BA.C2D2ED8A@dessent.net> <033e01c81a2a$30ae3150$2e08a8c0@CAM.ARTIMI.COM> <4725D805.2C412C94@dessent.net>
Mime-Version:  1.0
Content-Type:  text/plain; charset=us-ascii
Content-Transfer-Encoding:  7bit
User-Agent: Loom/3.14 (http://gmane.org/)
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

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/

