home *** CD-ROM | disk | FTP | other *** search
/ Il CD di internet / CD.iso / SOURCE / D / LIBC / LIBC-4.6 / LIBC-4 / libc-linux / sysdeps / linux / i386 / math / tanhl.S < prev    next >
Encoding:
Text File  |  1994-10-10  |  1.3 KB  |  85 lines

  1. /* Copyright (C) 1993  Hongjiu Lu
  2. This file is part of the Linux C Library.
  3.  
  4. The Linux C Library is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU Library General Public License as
  6. published by the Free Software Foundation; either version 2 of the
  7. License, or (at your option) any later version.
  8.  
  9. The Linux C Library is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  12. Library General Public License for more details. */
  13.  
  14.     .file    "tanhl.S"
  15.  
  16. #ifdef __ELF__
  17. #define _tanhl    tanhl
  18. #endif
  19.  
  20.     .text
  21.     .globl    _tanhl
  22. #ifdef __i486__
  23.     .align    4,0x90
  24. #else
  25.     .align    2,0x90
  26. #endif
  27.  
  28. _tanhl:
  29.     pushl    %ebp
  30.     movl    %esp,%ebp
  31.     subl    $8,%esp
  32.     fldt    8(%ebp)
  33.     ftst
  34.     fstsw    %ax
  35.     sahf
  36.     jna    L3
  37.     fchs
  38.     xorl    %eax,%eax
  39.     incl    %eax
  40.     jmp    L1
  41.  
  42. L3:
  43.     xorl    %eax,%eax
  44.  
  45. L1:
  46.     fld    %st(0)
  47.     faddp    %st,%st(1)
  48.     fldl2e
  49.     fmulp    %st,%st(1)
  50.     fst    %st(1)
  51.     fstcw    -4(%ebp)
  52.     fstcw    -8(%ebp)
  53.     fwait
  54.     andw    $0xf3ff,-4(%ebp)
  55.     fldcw    -4(%ebp)
  56.     frndint
  57.     fldcw    -8(%ebp)
  58.     fst    %st(2)
  59.     fsubrp    %st,%st(1)
  60.     f2xm1
  61.     fld1
  62.     faddp    %st,%st(1)
  63.     fscale
  64.     fst    %st(1)
  65.  
  66.     fld1
  67.     faddp    %st,%st(1)
  68.     fxch    %st(1)
  69.     fld1
  70.     fsubrp    %st,%st(1)
  71.     fdivp    %st,%st(1)
  72.  
  73.     testl    %eax,%eax
  74.     jna    L2
  75.     fchs
  76.  
  77. L2:
  78.     movl    %ebp,%esp
  79.     popl    %ebp
  80.     ret
  81.  
  82. #ifdef __ELF__
  83.     .type tanhl,@function
  84. #endif
  85.