diff options
Diffstat (limited to 'newlib/libm/machine/spu/headers/acos.h')
-rw-r--r-- | newlib/libm/machine/spu/headers/acos.h | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/newlib/libm/machine/spu/headers/acos.h b/newlib/libm/machine/spu/headers/acos.h index a647ef2d5..feec8c329 100644 --- a/newlib/libm/machine/spu/headers/acos.h +++ b/newlib/libm/machine/spu/headers/acos.h @@ -1,6 +1,18 @@ #include "headers/acosd2.h" +#include "headers/dom_chkd_negone_one.h" static __inline double _acos(double x) { - return spu_extract(_acosd2(spu_promote(x, 0)), 0); + double res; + vector double vx; + + vx = spu_splats(x); + res = spu_extract(_acosd2(vx), 0); +#ifndef _IEEE_LIBM + /* + * Domain error if not in the interval [-1, +1] + */ + dom_chkd_negone_one(vx); +#endif + return res; } |