|
From: | Bruno Haible |
Subject: | Re: isnanl, printf, and non-IEEE values |
Date: | Mon, 18 Jun 2012 01:24 +0200 |
User-agent: | KMail/4.7.4 (Linux/3.1.10-1.9-desktop; KDE/4.7.4; x86_64; ; ) |
Rich Felker wrote: > > > So isnanl is expected to be slower in every program that's using it > > > for legitimate arithmetic purposes > > > > Yes. But it will not be slower by much. The CPUs have an instruction for > > 'fpclassify'; you just need to pass the right bitmask to that instruction. > > Are you sure that's faster than avoiding loading the value into the > fpu at all and doing integer arithmetic/bit tests? I have my doubts. Maybe integer arithmetic is faster than the 'fpclassify' instruction. Either way, an isnanl() implementation can be written that is not terribly expensive. Bruno
[Prev in Thread] | Current Thread | [Next in Thread] |