From: Ulrich Drepper Date: Wed, 2 Apr 1997 14:44:20 +0000 (+0000) Subject: Rewritten. X-Git-Tag: glibc-2.16-ports-merge^2~3650 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=344114d0495cefb492ac8d327b23d2d76e538603;p=platform%2Fupstream%2Fglibc.git Rewritten. --- diff --git a/sysdeps/m68k/fpu/s_modf.c b/sysdeps/m68k/fpu/s_modf.c index 6428afc..ad0334f 100644 --- a/sysdeps/m68k/fpu/s_modf.c +++ b/sysdeps/m68k/fpu/s_modf.c @@ -19,22 +19,35 @@ #define __LIBC_M81_MATH_INLINES #include -#ifndef FUNC -#define FUNC modf +#ifndef SUFF +#define SUFF #endif #ifndef float_type #define float_type double #endif -#define __CONCATX(a,b) __CONCAT(a,b) +#define CONCATX(a,b) __CONCAT(a,b) +#define s(name) CONCATX(name,SUFF) +#define m81(func) __m81_u(s(func)) float_type -__CONCATX(__,FUNC) (x, iptr) - float_type x; - float_type *iptr; +s(__modf) (float_type x, float_type *iptr) { - return __m81_u(__CONCATX(__,FUNC))(x, iptr); + float_type x_int, result; + __asm ("fintrz%.x %1, %0" : "=f" (x_int) : "f" (x)); + *iptr = x_int; + if (m81(__isinf) (x)) + { + result = 0; + if (x < 0) + result = -result; + } + else if (x == 0) + result = x; + else + result = x - x_int; + return result; } #define weak_aliasx(a,b) weak_alias(a,b) -weak_aliasx(__CONCATX(__,FUNC), FUNC) +weak_aliasx(s(__modf), s(modf))