aboutsummaryrefslogtreecommitdiff
path: root/lib/muldc3.c
diff options
context:
space:
mode:
authorEd Schouten <ed@FreeBSD.org>2011-12-31 14:55:23 +0000
committerEd Schouten <ed@FreeBSD.org>2011-12-31 14:55:23 +0000
commit219fb0488994a289f1087f7b3da18789e068da12 (patch)
treed59ced7e19afaab87432b7610faefff3080e8d2a /lib/muldc3.c
parentb0a04aaa595ba76468e521f12727a872d144d6d0 (diff)
downloadsrc-219fb0488994a289f1087f7b3da18789e068da12.tar.gz
src-219fb0488994a289f1087f7b3da18789e068da12.zip
Import compiler-rt r147390.vendor/compiler-rt/compiler-rt-r147390
Notes
Notes: svn path=/vendor/compiler-rt/dist/; revision=229109 svn path=/vendor/compiler-rt/compiler-rt-r147390/; revision=229110; tag=vendor/compiler-rt/compiler-rt-r147390
Diffstat (limited to 'lib/muldc3.c')
-rw-r--r--lib/muldc3.c57
1 files changed, 28 insertions, 29 deletions
diff --git a/lib/muldc3.c b/lib/muldc3.c
index 9f9bd2aaa2bb..5f4a6d16ebf0 100644
--- a/lib/muldc3.c
+++ b/lib/muldc3.c
@@ -13,8 +13,7 @@
*/
#include "int_lib.h"
-#include <math.h>
-#include <complex.h>
+#include "int_math.h"
/* Returns: the product of a + ib and c + id */
@@ -28,46 +27,46 @@ __muldc3(double __a, double __b, double __c, double __d)
double _Complex z;
__real__ z = __ac - __bd;
__imag__ z = __ad + __bc;
- if (isnan(__real__ z) && isnan(__imag__ z))
+ if (crt_isnan(__real__ z) && crt_isnan(__imag__ z))
{
int __recalc = 0;
- if (isinf(__a) || isinf(__b))
+ if (crt_isinf(__a) || crt_isinf(__b))
{
- __a = copysign(isinf(__a) ? 1 : 0, __a);
- __b = copysign(isinf(__b) ? 1 : 0, __b);
- if (isnan(__c))
- __c = copysign(0, __c);
- if (isnan(__d))
- __d = copysign(0, __d);
+ __a = crt_copysign(crt_isinf(__a) ? 1 : 0, __a);
+ __b = crt_copysign(crt_isinf(__b) ? 1 : 0, __b);
+ if (crt_isnan(__c))
+ __c = crt_copysign(0, __c);
+ if (crt_isnan(__d))
+ __d = crt_copysign(0, __d);
__recalc = 1;
}
- if (isinf(__c) || isinf(__d))
+ if (crt_isinf(__c) || crt_isinf(__d))
{
- __c = copysign(isinf(__c) ? 1 : 0, __c);
- __d = copysign(isinf(__d) ? 1 : 0, __d);
- if (isnan(__a))
- __a = copysign(0, __a);
- if (isnan(__b))
- __b = copysign(0, __b);
+ __c = crt_copysign(crt_isinf(__c) ? 1 : 0, __c);
+ __d = crt_copysign(crt_isinf(__d) ? 1 : 0, __d);
+ if (crt_isnan(__a))
+ __a = crt_copysign(0, __a);
+ if (crt_isnan(__b))
+ __b = crt_copysign(0, __b);
__recalc = 1;
}
- if (!__recalc && (isinf(__ac) || isinf(__bd) ||
- isinf(__ad) || isinf(__bc)))
+ if (!__recalc && (crt_isinf(__ac) || crt_isinf(__bd) ||
+ crt_isinf(__ad) || crt_isinf(__bc)))
{
- if (isnan(__a))
- __a = copysign(0, __a);
- if (isnan(__b))
- __b = copysign(0, __b);
- if (isnan(__c))
- __c = copysign(0, __c);
- if (isnan(__d))
- __d = copysign(0, __d);
+ if (crt_isnan(__a))
+ __a = crt_copysign(0, __a);
+ if (crt_isnan(__b))
+ __b = crt_copysign(0, __b);
+ if (crt_isnan(__c))
+ __c = crt_copysign(0, __c);
+ if (crt_isnan(__d))
+ __d = crt_copysign(0, __d);
__recalc = 1;
}
if (__recalc)
{
- __real__ z = INFINITY * (__a * __c - __b * __d);
- __imag__ z = INFINITY * (__a * __d + __b * __c);
+ __real__ z = CRT_INFINITY * (__a * __c - __b * __d);
+ __imag__ z = CRT_INFINITY * (__a * __d + __b * __c);
}
}
return z;