delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/09/03/13:53:05

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
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
Message-ID: <4319E40B.F2219D3@dessent.net>
Date: Sat, 03 Sep 2005 10:57:31 -0700
From: Brian Dessent <brian AT dessent DOT net>
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: [patch] lrint/lrintf oddity
References: <20050903185145 DOT 5bb6c57e DOT cygwin-erikd AT mega-nerd DOT com> <4319C016 DOT 2958BC77 AT dessent DOT net> <20050904023143 DOT 48fed0c5 DOT cygwin-erikd AT mega-nerd DOT com>
X-IsSubscribed: yes
Reply-To: cygwin AT cygwin DOT com

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/

- Raw text -


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