summaryrefslogtreecommitdiff
path: root/sysdeps/m68k/fpu/bits
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/m68k/fpu/bits')
-rw-r--r--sysdeps/m68k/fpu/bits/mathdef.h6
-rw-r--r--sysdeps/m68k/fpu/bits/mathinline.h23
2 files changed, 14 insertions, 15 deletions
diff --git a/sysdeps/m68k/fpu/bits/mathdef.h b/sysdeps/m68k/fpu/bits/mathdef.h
index 4d07176405..4eaa58a3a9 100644
--- a/sysdeps/m68k/fpu/bits/mathdef.h
+++ b/sysdeps/m68k/fpu/bits/mathdef.h
@@ -17,7 +17,7 @@
Boston, MA 02111-1307, USA. */
#ifndef _MATH_H
-#error "Never use <bits/mathdef.h> directly; include <math.h> instead"
+# error "Never use <bits/mathdef.h> directly; include <math.h> instead"
#endif
@@ -34,3 +34,7 @@ typedef long double double_t; /* `double' expressions are evaluated as
/* Define `INFINITY' as value of type `float_t'. */
#define INFINITY HUGE_VALL
+
+/* The values returned by `ilogb' for 0 and NaN respectively. */
+#define FP_ILOGB0 0
+#define FP_ILOGBNAN 0x7fffffff
diff --git a/sysdeps/m68k/fpu/bits/mathinline.h b/sysdeps/m68k/fpu/bits/mathinline.h
index bdeaa9efb0..8899b752ff 100644
--- a/sysdeps/m68k/fpu/bits/mathinline.h
+++ b/sysdeps/m68k/fpu/bits/mathinline.h
@@ -138,14 +138,6 @@ __m81_defun (float_type, __CONCAT(__ieee754_fmod,s), \
float_type __result; \
__asm("fmod%.x %1, %0" : "=f" (__result) : "f" (__y), "0" (__x)); \
return __result; \
-} \
- \
-__m81_defun (float_type, __CONCAT(__ieee754_scalb,s), \
- (float_type __x, float_type __n)) \
-{ \
- float_type __result; \
- __asm ("fscale%.x %1, %0" : "=f" (__result) : "f" (__n), "0" (__x)); \
- return __result; \
}
__internal_inline_functions (double,)
@@ -268,13 +260,16 @@ __m81_defun (int, __CONCAT(__signbit,s), (float_type __value)) \
__m81_defun (int, __CONCAT(__ilogb,s), (float_type __x)) \
{ \
float_type __result; \
- if (__x == 0.0) \
- return 0x80000001; \
+ if (__m81_u(__CONCAT(__isnan,s)) (__x)) \
+ /* The stupid standard requires us to return a specific value where \
+ it would depend on the bitpattern of the NaN. */ \
+ return 0x7fffffff; \
__asm("fgetexp%.x %1, %0" : "=f" (__result) : "f" (__x)); \
return (int) __result; \
} \
\
-__m81_defun (float_type, __CONCAT(__scalbn,s), (float_type __x, int __n)) \
+__m81_defun (float_type, __CONCAT(__scalbn,s), \
+ (float_type __x, long int __n)) \
{ \
float_type __result; \
__asm ("fscale%.l %1, %0" : "=f" (__result) : "dmi" (__n), "0" (__x)); \
@@ -340,7 +335,7 @@ __inline_forward_c(double,ceil, (double __x), (__x))
#ifdef __USE_MISC
__inline_forward_c(int,isinf, (double __value), (__value))
__inline_forward_c(int,finite, (double __value), (__value))
-__inline_forward_c(double,scalbn, (double __x, int __n), (__x, __n))
+__inline_forward_c(double,scalbn, (double __x, long int __n), (__x, __n))
#endif
#if defined __USE_MISC || defined __USE_XOPEN
#ifndef __USE_ISOC9X /* Conflict with macro of same name. */
@@ -365,7 +360,7 @@ __inline_forward_c(float,ceilf, (float __x), (__x))
#ifdef __USE_MISC
__inline_forward_c(int,isinff, (float __value), (__value))
__inline_forward_c(int,finitef, (float __value), (__value))
-__inline_forward_c(float,scalbnf, (float __x, int __n), (__x, __n))
+__inline_forward_c(float,scalbnf, (float __x, long int __n), (__x, __n))
__inline_forward_c(int,isnanf, (float __value), (__value))
__inline_forward_c(int,ilogbf, (float __value), (__value))
#endif
@@ -384,7 +379,7 @@ __inline_forward_c(long double,ceill, (long double __x), (__x))
#ifdef __USE_MISC
__inline_forward_c(int,isinfl, (long double __value), (__value))
__inline_forward_c(int,finitel, (long double __value), (__value))
-__inline_forward_c(long double,scalbnl, (long double __x, int __n),
+__inline_forward_c(long double,scalbnl, (long double __x, long int __n),
(__x, __n))
__inline_forward_c(int,isnanl, (long double __value), (__value))
__inline_forward_c(int,ilogbl, (long double __value), (__value))