Message ID | 20150826133745.GA17104@gmail.com |
---|---|

State | Dropped |

Headers |

## Commit Message

## Comments

diff --git a/sysdeps/i386/fpu/w_exp10f.c b/sysdeps/i386/fpu/w_exp10f.c new file mode 100644 index 0000000..bee27b0 --- /dev/null +++ b/sysdeps/i386/fpu/w_exp10f.c @@ -0,0 +1,41 @@ +/* Copyright (C) 2015 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + + +/* + * wrapper exp10f(x) + */ + +#include <math.h> +#include <math_private.h> + +float +__exp10f (float x) +{ + float z = __ieee754_exp10f (x); + int32_t iz; + GET_FLOAT_WORD (iz, z); + if (__builtin_expect (!isfinite (z) || (iz & 0x7fffffff) == 0, 0) + && isfinite (x) && _LIB_VERSION != _IEEE_) + /* exp10f overflow (146) if x > 0, underflow (147) if x < 0. */ + return __kernel_standard_f (x, x, 146 + !!signbit (x)); + + return z; +} +weak_alias (__exp10f, exp10f) +strong_alias (__exp10f, __pow10f) +weak_alias (__pow10f, pow10f) diff --git a/sysdeps/i386/fpu/w_exp2f.c b/sysdeps/i386/fpu/w_exp2f.c new file mode 100644 index 0000000..bf86212 --- /dev/null +++ b/sysdeps/i386/fpu/w_exp2f.c @@ -0,0 +1,38 @@ +/* Copyright (C) 2015 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +/* + * wrapper exp2f(x) + */ + +#include <math.h> +#include <math_private.h> + +float +__exp2f (float x) +{ + float z = __ieee754_exp2f (x); + int32_t iz; + GET_FLOAT_WORD (iz, z); + if (__builtin_expect (!isfinite (z) || (iz & 0x7fffffff) == 0, 0) + && isfinite (x) && _LIB_VERSION != _IEEE_) + /* exp2 overflow: 144, exp2 underflow: 145 */ + return __kernel_standard_f (x, x, 144 + !!signbit (x)); + + return z; +} +weak_alias (__exp2f, exp2f) diff --git a/sysdeps/i386/fpu/w_expf.c b/sysdeps/i386/fpu/w_expf.c new file mode 100644 index 0000000..5eb7f56 --- /dev/null +++ b/sysdeps/i386/fpu/w_expf.c @@ -0,0 +1,37 @@ +/* Copyright (C) 2015 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#include <math.h> +#include <math_private.h> + +/* wrapper expf */ +float +__expf (float x) +{ + float z = __ieee754_expf (x); + int32_t iz; + + GET_FLOAT_WORD (iz, z); + + if (__builtin_expect (!isfinite (z) || (iz & 0x7fffffff) == 0, 0) + && isfinite (x) && _LIB_VERSION != _IEEE_) + return __kernel_standard_f (x, x, 106 + !!signbit (x)); + + return z; +} +hidden_def (__expf) +weak_alias (__expf, expf)