diff options
Diffstat (limited to 'newlib/libm/machine/spu/headers/log2.h')
-rw-r--r-- | newlib/libm/machine/spu/headers/log2.h | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/newlib/libm/machine/spu/headers/log2.h b/newlib/libm/machine/spu/headers/log2.h index 50ab477c5..696bf9fae 100644 --- a/newlib/libm/machine/spu/headers/log2.h +++ b/newlib/libm/machine/spu/headers/log2.h @@ -1,6 +1,16 @@ #include "headers/log2d2.h" +#include "headers/dom_chkd_less_than.h" -static __inline double _log2(double vx) +static __inline double _log2(double x) { - return spu_extract(_log2d2(spu_promote(vx, 0)), 0); + double res; + vector double vx; + vector double vc = { 0.0, 0.0 }; + + vx = spu_promote(x, 0); + res = spu_extract(_log2d2(vx), 0); +#ifndef _IEEE_LIBM + dom_chkd_less_than(vx, vc); +#endif + return res; } |