delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2007/10/29/09:15:34

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
To: cygwin AT cygwin DOT com
From: Victor Paesa <wzrlpy AT arsystel DOT 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 AT sea DOT gmane DOT org> <46F6C151 DOT 3070301 AT computer DOT org> <loom DOT 20071029T111515-144 AT post DOT gmane DOT org> <4725D1BA DOT C2D2ED8A AT dessent DOT net> <033e01c81a2a$30ae3150$2e08a8c0 AT CAM DOT ARTIMI DOT COM> <4725D805 DOT 2C412C94 AT dessent DOT net>
Mime-Version: 1.0
User-Agent: Loom/3.14 (http://gmane.org/)
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT 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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019