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 / fmod.S < prev    next >
Encoding:
Text File  |  1994-08-26  |  1.0 KB  |  60 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    "fmod.S"
  15.     .text
  16. #ifdef __ELF__
  17. #define _fmod fmod
  18. #endif
  19.  
  20.     .globl    _fmod
  21.  
  22. #ifdef __i486__
  23.     .align    4,0x90
  24. #else
  25.     .align    2,0x90
  26. #endif
  27. _fmod:
  28.     fldl    4(%esp)
  29.     ftst
  30.     fnstsw    %ax
  31.     sahf
  32.     jz    zero1
  33.     fldl    12(%esp)
  34.     ftst
  35.     fnstsw    %ax
  36.     sahf
  37.     jz    zero2
  38.     fxch    %st(1)
  39. loop:
  40.     fprem
  41.     fnstsw    %ax
  42.     sahf
  43.     jpe    loop
  44.     fstp    %st(1)
  45.     ret
  46.     
  47. #ifdef __i486__
  48.     .align    4,0x90
  49. #else
  50.     .align    2,0x90
  51. #endif
  52. zero2:
  53.     fstp    %st(0)
  54. zero1:
  55.     ret    
  56.  
  57. #ifdef __ELF__
  58. .type fmod,@function
  59. #endif
  60.