* device/lib/asinf.c (asinf),
* device/lib/atanf.c (atanf),
* device/lib/ceilf.c (ceilf),
* device/lib/cosf.c (cosf),
* device/lib/coshf.c (coshf),
* device/lib/cotf.c (cotf),
* device/lib/fabsf.c (fabsf),
* device/lib/floorf.c (floorf),
* device/lib/log10f.c (log10f),
* device/lib/logf.c (logf),
* device/lib/sinf.c (sinf),
* device/lib/sinhf.c (sinhf),
* device/lib/sqrtf.c (sqrtf),
* device/lib/tanf.c (tanf),
* device/lib/tanhf.c (tanhf),
* device/include/math.h: defined _FLOAT_FUNC_REENTRANT macro and
replaced all instances of "reentrant" in the library functions
defined in math.h with this macro.
* support/regression/tests/float_trans.c: reenabled test for hc08
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@3465
4a8a32a2-be11-0410-ad9d-
d568d2c75423
+2004-08-30 Erik Petrich <epetrich AT ivorytower.norman.ok.us>
+
+ * device/lib/acosf.c (acosf),
+ * device/lib/asinf.c (asinf),
+ * device/lib/atanf.c (atanf),
+ * device/lib/ceilf.c (ceilf),
+ * device/lib/cosf.c (cosf),
+ * device/lib/coshf.c (coshf),
+ * device/lib/cotf.c (cotf),
+ * device/lib/fabsf.c (fabsf),
+ * device/lib/floorf.c (floorf),
+ * device/lib/log10f.c (log10f),
+ * device/lib/logf.c (logf),
+ * device/lib/sinf.c (sinf),
+ * device/lib/sinhf.c (sinhf),
+ * device/lib/sqrtf.c (sqrtf),
+ * device/lib/tanf.c (tanf),
+ * device/lib/tanhf.c (tanhf),
+ * device/include/math.h: defined _FLOAT_FUNC_REENTRANT macro and
+ replaced all instances of "reentrant" in the library functions
+ defined in math.h with this macro.
+ * support/regression/tests/float_trans.c: reenabled test for hc08
+
2004-08-30 Bernhard Held <bernhard AT bernhardheld.de>
* device/lib/pic16/Makefile.common.in: added MODELFLAGS again, it was
long l;
};
+/* Functions on the z80 & gbz80 are always reentrant and so the "reentrant" */
+/* keyword is not defined. */
+#if defined(SDCC_z80) || defined(SDCC_gbz80)
+#define _FLOAT_FUNC_REENTRANT
+#else
+#define _FLOAT_FUNC_REENTRANT reentrant
+#endif
+
/**********************************************
* Prototypes for float ANSI C math functions *
**********************************************/
/* Trigonometric functions */
-float sinf(const float x);
-float cosf(const float x);
-float tanf(const float x);
-float cotf(const float x);
-float asinf(const float x);
-float acosf(const float x);
-float atanf(const float x);
+float sinf(const float x) _FLOAT_FUNC_REENTRANT;
+float cosf(const float x) _FLOAT_FUNC_REENTRANT;
+float tanf(const float x) _FLOAT_FUNC_REENTRANT;
+float cotf(const float x) _FLOAT_FUNC_REENTRANT;
+float asinf(const float x) _FLOAT_FUNC_REENTRANT;
+float acosf(const float x) _FLOAT_FUNC_REENTRANT;
+float atanf(const float x) _FLOAT_FUNC_REENTRANT;
float atan2f(const float x, const float y);
/* Hyperbolic functions */
-float sinhf(const float x);
-float coshf(const float x);
-float tanhf(const float x);
+float sinhf(const float x) _FLOAT_FUNC_REENTRANT;
+float coshf(const float x) _FLOAT_FUNC_REENTRANT;
+float tanhf(const float x) _FLOAT_FUNC_REENTRANT;
/* Exponential, logarithmic and power functions */
float expf(const float x);
-float logf(const float x);
-float log10f(const float x);
+float logf(const float x) _FLOAT_FUNC_REENTRANT;
+float log10f(const float x) _FLOAT_FUNC_REENTRANT;
float powf(const float x, const float y);
-float sqrtf(const float a);
+float sqrtf(const float a) _FLOAT_FUNC_REENTRANT;
/* Nearest integer, absolute value, and remainder functions */
-float fabsf(const float x);
+float fabsf(const float x) _FLOAT_FUNC_REENTRANT;
float frexpf(const float x, int *pw2);
float ldexpf(const float x, const int pw2);
-float ceilf(float x);
-float floorf(float x);
+float ceilf(float x) _FLOAT_FUNC_REENTRANT;
+float floorf(float x) _FLOAT_FUNC_REENTRANT;
float modff(float x, float * y);
#endif /* _INC_MATH */
float asincosf(const float x, const int isacos);
-float acosf(const float x) reentrant
+float acosf(const float x) _FLOAT_FUNC_REENTRANT
{
if(x== 1.0) return 0.0;
else if(x==-1.0) return PI;
float asincosf(const float x, const int isacos);
-float asinf(const float x) reentrant
+float asinf(const float x) _FLOAT_FUNC_REENTRANT
{
if(x== 1.0) return HALF_PI;
else if(x==-1.0) return -HALF_PI;
#define myconst const
#endif
-float atanf(const float x) reentrant
+float atanf(const float x) _FLOAT_FUNC_REENTRANT
{
float f, r, g;
int n=0;
#include <math.h>
-float ceilf(float x) reentrant
+float ceilf(float x) _FLOAT_FUNC_REENTRANT
{
long r;
r=x;
float sincosf(const float x, const int iscos);
-float cosf(const float x) reentrant
+float cosf(const float x) _FLOAT_FUNC_REENTRANT
{
if (x==0.0) return 1.0;
return sincosf(x, 1);
float sincoshf(const float x, const int iscosh);
-float coshf(const float x) reentrant
+float coshf(const float x) _FLOAT_FUNC_REENTRANT
{
return sincoshf(x, 1);
}
float tancotf(const float x, const int iscot);
-float cotf(const float x) reentrant
+float cotf(const float x) _FLOAT_FUNC_REENTRANT
{
float y;
#include <math.h>
#include <errno.h>
-float fabsf(const float x) reentrant
+float fabsf(const float x) _FLOAT_FUNC_REENTRANT
{
union float_long fl;
#include <math.h>
-float floorf (float x) reentrant
+float floorf (float x) _FLOAT_FUNC_REENTRANT
{
long r;
r=x;
#include <math.h>
#include <errno.h>
-float log10f(const float x) reentrant
+float log10f(const float x) _FLOAT_FUNC_REENTRANT
{
return logf(x)*0.4342944819;
}
#define C1 0.693359375 /*355.0/512.0*/
#define C2 -2.121944400546905827679E-4
-float logf(const float x) reentrant
+float logf(const float x) _FLOAT_FUNC_REENTRANT
{
#if defined(SDCC_mcs51) && defined(SDCC_MODEL_SMALL) \
&& !defined(SDCC_NOOVERLAY)
float sincosf(const float x, const int iscos);
-float sinf(const float x) reentrant
+float sinf(const float x) _FLOAT_FUNC_REENTRANT
{
if (x==0.0) return 0.0;
return sincosf(x, 0);
float sincoshf(const float x, const int iscosh);
-float sinhf(const float x) reentrant
+float sinhf(const float x) _FLOAT_FUNC_REENTRANT
{
return sincoshf(x, 0);
}
#include <math.h>
#include <errno.h>
-float sqrtf(const float x) reentrant
+float sqrtf(const float x) _FLOAT_FUNC_REENTRANT
{
float f, y;
int n;
float tancotf(const float x, const int iscot);
-float tanf(const float x) reentrant
+float tanf(const float x) _FLOAT_FUNC_REENTRANT
{
return tancotf(x, 0);
}
#define P(g) ((P1*g+P0)*g)
#define Q(g) (Q1*g+Q0)
-float tanhf(const float x) reentrant
+float tanhf(const float x) _FLOAT_FUNC_REENTRANT
{
float f, g, r;
void
testTrans(void)
{
-#if !defined(SDCC_z80) && !defined(SDCC_hc08) && !PORT_HOST
+#if !defined(SDCC_z80) && !PORT_HOST
# ifdef SQRTF
ASSERT(fabsf (sqrtf (5.0) - 2.23606801) < 0.00001);
# endif