Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Wed, 27 Feb 2019 11:42:25 -0500
From: Rich Felker <>
Subject: Re: FE Exception triggered by comparison

On Wed, Feb 27, 2019 at 07:32:01PM +0300, Alexander Monakov wrote:
> On Thu, 28 Feb 2019, Damian McGuckin wrote:
> > > Hm, no, for x86 with GCC you should not see that: the compiler knows how to
> > > expand isnan efficiently.  Are you perhaps on OS X and the 'gcc' command
> > > actually invokes Clang/LLVM?
> > 
> > No.
> > 
> > > If not, can you show output of 'gcc -v', command-line flags you used, and
> > > the assembly you're seeing?
> > 
> > 	gcc -O3 -S -msse4.2 -mfma mynan.c
> Ah, in this case you're falling victim of a problem in your Glibc version:
> while GCC is sufficiently new to know how to expand isnan efficiently,
> Glibc math.h defines isnan as a macro that redirects to __isnan that GCC
> does not recognize. Newer Glibc versions use __builtin_isnan where suitable,
> which leads to optimal assembly.
> (musl does not use this builtin, expanding the macro to a bit test instead)

Are there reasons we should perhaps use the __builtin versions of
these when __GNUC__ indicates they're available? I like our bit test
versions we have now, and I think they're sufficiently efficient, but
I'm open to changes if there's a good reason.


Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.