]> git.ipfire.org Git - thirdparty/glibc.git/blobdiff - sysdeps/i386/fpu/s_asinhf.S
Prefer https to http for gnu.org and fsf.org URLs
[thirdparty/glibc.git] / sysdeps / i386 / fpu / s_asinhf.S
index a6925c7b4c0d100b4c4e5f69d2399664a05ff45f..cd2359c22601b47eea0c784fb105e6705174ced1 100644 (file)
@@ -1,39 +1,35 @@
 /* ix87 specific implementation of arcsinh.
-   Copyright (C) 1996, 1997, 1999 Free Software Foundation, Inc.
+   Copyright (C) 1996-2019 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
 
    The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
-   published by the Free Software Foundation; either version 2 of the
-   License, or (at your option) any later version.
+   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
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
-   You should have received a copy of the GNU Library General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
 
 #include <machine/asm.h>
+#include <libm-alias-float.h>
 
-#ifdef __ELF__
        .section .rodata
-#else
-       .text
-#endif
 
        .align ALIGNARG(4)
-       ASM_TYPE_DIRECTIVE(huge,@object)
+       .type huge,@object
 huge:  .double 1e+36
        ASM_SIZE_DIRECTIVE(huge)
-       ASM_TYPE_DIRECTIVE(one,@object)
+       .type one,@object
 one:   .double 1.0
        ASM_SIZE_DIRECTIVE(one)
-       ASM_TYPE_DIRECTIVE(limit,@object)
+       .type limit,@object
 limit: .double 0.29
        ASM_SIZE_DIRECTIVE(limit)
 
@@ -62,9 +58,7 @@ ENTRY(__asinhf)
        fxch                            // |x| : log(2)
        ja      3f                      // |x| > 2^14
 #ifdef PIC
-       call    1f
-1:     popl    %edx
-       addl    $_GLOBAL_OFFSET_TABLE_+[.-1b], %edx
+       LOAD_PIC_REG (dx)
 #endif
        cmpl    $0x40000000, %eax
        ja      5f                      // |x| > 2
@@ -100,16 +94,23 @@ ENTRY(__asinhf)
        .align ALIGNARG(4)
 2:
 #ifdef PIC
-       call    1f
-1:     popl    %edx
-       addl    $_GLOBAL_OFFSET_TABLE_+[.-1b], %edx
+       LOAD_PIC_REG (dx)
 #endif
        jecxz   4f
        fchs                            // x
 4:     fld     %st                     // x : x
        faddl   MO(huge)                // huge+x : x
        fstp    %st(0)                  // x
-       ret
+       cmpl    $0x00800000, %eax
+       jae     8f
+       subl    $4, %esp
+       cfi_adjust_cfa_offset (4)
+       fld     %st(0)
+       fmul    %st(0)
+       fstps   (%esp)
+       addl    $4, %esp
+       cfi_adjust_cfa_offset (-4)
+8:     ret
 
        // |x| > 2^14 => y = sign(x) * (log(|x|) + log(2))
        .align ALIGNARG(4)
@@ -136,4 +137,4 @@ ENTRY(__asinhf)
        fchs
 4:     ret
 END(__asinhf)
-weak_alias (__asinhf, asinhf)
+libm_alias_float (__asinh, asinh)