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 / tanh.S < prev    next >
Encoding:
Text File  |  1994-09-21  |  1.5 KB  |  109 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    "tanh.S"
  15.  
  16. #ifdef __ELF__
  17. #define _tanh    tanh
  18. #endif
  19.  
  20.     .text
  21.     .globl    _tanh
  22. #ifdef __i486__
  23.     .align    4,0x90
  24. #else
  25.     .align    2,0x90
  26. #endif
  27.  
  28. _tanh:
  29.     pushl    %ebp
  30.     movl    %esp,%ebp
  31.     subl    $8,%esp
  32.     fldl    8(%ebp)
  33.     ftst
  34.     fstsw    %ax
  35.     sahf
  36. #ifdef __ELF__
  37.     jna    .L3
  38. #else
  39.     jna    L3
  40. #endif
  41.     fchs
  42.     xorl    %eax,%eax
  43.     incl    %eax
  44. #ifdef __ELF__
  45.     jmp    .L1
  46. #else
  47.     jmp    L1
  48. #endif
  49.  
  50. #ifdef __ELF__
  51. .L3:
  52. #else
  53. L3:
  54. #endif
  55.     xorl    %eax,%eax
  56.  
  57. #ifdef __ELF__
  58. .L1:
  59. #else
  60. L1:
  61. #endif
  62.     fld    %st(0)
  63.     faddp    %st,%st(1)
  64.     fldl2e
  65.     fmulp    %st,%st(1)
  66.     fst    %st(1)
  67.     fstcw    -4(%ebp)
  68.     fstcw    -8(%ebp)
  69.     fwait
  70.     andw    $0xf3ff,-4(%ebp)
  71.     fldcw    -4(%ebp)
  72.     frndint
  73.     fldcw    -8(%ebp)
  74.     fst    %st(2)
  75.     fsubrp    %st,%st(1)
  76.     f2xm1
  77.     fld1
  78.     faddp    %st,%st(1)
  79.     fscale
  80.     fst    %st(1)
  81.  
  82.     fld1
  83.     faddp    %st,%st(1)
  84.     fxch    %st(1)
  85.     fld1
  86.     fsubrp    %st,%st(1)
  87.     fdivp    %st,%st(1)
  88.  
  89.     testl    %eax,%eax
  90. #ifdef __ELF__
  91.     jna    .L2
  92. #else
  93.     jna    L2
  94. #endif
  95.     fchs
  96.  
  97. #ifdef __ELF__
  98. .L2:
  99. #else
  100. L2:
  101. #endif
  102.     movl    %ebp,%esp
  103.     popl    %ebp
  104.     ret
  105.  
  106. #ifdef __ELF__
  107. .type tanh,@function
  108. #endif
  109.