delorie.com/archives/browse.cgi | search |
X-Authentication-Warning: | delorie.com: mail set sender to djgpp-workers-bounces using -f |
From: | <ams AT ludd DOT luth DOT se> |
Message-Id: | <200311161926.hAGJQrWq025150@speedy.ludd.luth.se> |
Subject: | Re: djgpp: djgpp/include/math.h |
In-Reply-To: | <200311161044.hAGAibhE004530@delorie.com> "from cvs-ams@delorie.com |
at Nov 16, 2003 05:44:37 am" | |
To: | DJGPP-WORKERS <djgpp-workers AT delorie DOT com> |
Date: | Sun, 16 Nov 2003 20:26:53 +0100 (CET) |
X-Mailer: | ELM [version 2.4ME+ PL78 (25)] |
MIME-Version: | 1.0 |
X-MailScanner: | Found to be clean |
Reply-To: | djgpp-workers AT delorie DOT com |
Errors-To: | nobody AT delorie DOT com |
X-Mailing-List: | djgpp-workers AT delorie DOT com |
X-Unsubscribes-To: | listserv AT delorie DOT com |
According to cvs-ams AT delorie DOT com: > Update by cvs id: ams > Update of /cvs/djgpp/djgpp/include > > Modified Files: > math.h > Log Message: > Changed FP_ values and isfinite() macro for better optimisation. > > > =================================================================== > RCS file: /cvs/djgpp/djgpp/include/math.h,v > retrieving revision 1.11 > retrieving revision 1.12 > diff -p -2 -r1.11 -r1.12 > *** djgpp/include/math.h 30 Oct 2003 20:48:43 -0000 1.11 > --- djgpp/include/math.h 16 Nov 2003 10:44:35 -0000 1.12 ... > *** 112,121 **** > __fpclassifyld(x)) > > ! #define isfinite(x) (fpclassify(x)==FP_NORMAL || \ > ! fpclassify(x)==FP_SUBNORMAL || \ > ! fpclassify(x)==FP_ZERO) > ! #define isinf(x) (fpclassify(x)==FP_INFINITE) > ! #define isnan(x) (fpclassify(x)==FP_NAN) > ! #define isnormal(x) (fpclassify(x)==FP_NORMAL) > > int __fpclassifyf(float) __attribute__((const)); > --- 112,119 ---- > __fpclassifyld(x)) > > ! #define isfinite(x) ((fpclassify(x) & (FP_NORMAL|FP_SUBNORMAL|FP_ZERO)) != 0) > ! #define isinf(x) (fpclassify(x)==FP_INFINITE) > ! #define isnan(x) (fpclassify(x)==FP_NAN) > ! #define isnormal(x) (fpclassify(x)==FP_NORMAL) Ehum... Late, but perhaps I should change the other is*() to the format "fpclassify(x) & FP_<something>) != 0" too? 1. Consistent. 2. Might help gcc optimise if the coder does "if( isinf(x) || isnan(x) ) ..." (I haven't done any tests and I don't plan to.) Right, MartinS
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |