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: Sat, 27 Oct 2007 10:10:41 +0000 (UTC)
Lines: 55
Message-ID:  <loom.20071027T095345-83@post.gmane.org>
References:  <fd68u2$geo$1@sea.gmane.org> <46F6C151.3070301@computer.org>
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,

Tim Prince <tprince <at> computer.org> writes:
> 
> Diego Biurrun wrote:
> > Hi!
> > 
> > I have noticed that Cygwin does not implement llrint.  However, llrint
> > is part of C99 and not having it available makes some applications (for
> > example MPlayer and FFmpeg) fail to compile.
> > 
> > Are there any plans to implement llrint (in the near future)?
> > 
> 
> Perhaps if you would submit a patch to newlib, something may happen.
> It's not difficult to back-port stand-alone from recent gcc if you don't
> want to wait for cygwin to include a gcc upgrade, about which there have
> been plenty of threads here.  You could include it in a <mathinline.h>
> of your choice.
> http://gcc.gnu.org/ml/gcc-patches/2005-03/msg01970.html
> http://gcc.gnu.org/ml/gcc-patches/2005-03/msg01973.html
> shows that it has been available for 2.5 years. 

I downloaded the gcc-3.4.4 Cygwin source package, and I found that (apparently)
gcc 3.4.4 already had llrint built-in:

$ fgrep -ri llrint gcc-3.4.4 
gcc-3.4.4/gcc/builtins.c:      CASE_MATHFN (BUILT_IN_LLRINT)
gcc-3.4.4/gcc/builtins.def:DEF_C99_BUILTIN        (BUILT_IN_LLRINT, "llrint",
BT_FN_LONGLONG_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)

[more lines matched]

Then I tried to compile a test:
$ cat llrint_test.c 
#include <math.h>
int main(int argc, char **argv)
{
  long long ll;

  ll = __builtin_llrint(2.34);
}

But the compilation failed:
$ gcc llrint_test.c 
/cygdrive/c/DOCUME~1/Inma/LOCALS~1/Temp/ccyDtvBd.o:llrint_test.c:(.text+0x34):
undefined reference to `_llrint'
collect2: ld returned 1 exit status

Are built-ins disabled in gcc-3.4.4 for Cygwin?
Could that be fixed by adding/removing flags to the configure line used
to build gcc 3.4.4 in Cygwin?

Thanks in advance for your answers,
Victor Paesa


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

