Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Blame | Last modification | View Log | Download | RSS feed

  1. /*
  2.  * Written by J.T. Conklin <jtc@netbsd.org>.
  3.  * Public domain.
  4.  *
  5.  * Changes for long double by Ulrich Drepper <drepper@cygnus.com>
  6.  *
  7.  * Removed header file dependency for use in libmingwex.a by
  8.  *   Danny Smith <dannysmith@users.sourceforge.net>
  9.  */
  10.         .file   "floorf.S"
  11.         .text
  12.         .align 4
  13. .globl _floorf
  14.         .def    _floorf;        .scl    2;      .type   32;     .endef
  15. _floorf:
  16.         flds    4(%esp)
  17.         subl    $8,%esp
  18.  
  19.         fstcw   4(%esp)                 /* store fpu control word */
  20.  
  21.         /* We use here %edx although only the low 1 bits are defined.
  22.            But none of the operations should care and they are faster
  23.            than the 16 bit operations.  */
  24.         movl    $0x400,%edx             /* round towards -oo */
  25.         orl     4(%esp),%edx
  26.         andl    $0xf7ff,%edx
  27.         movl    %edx,(%esp)
  28.         fldcw   (%esp)                  /* load modified control word */
  29.  
  30.         frndint                         /* round */
  31.  
  32.         fldcw   4(%esp)                 /* restore original control word */
  33.  
  34.         addl    $8,%esp
  35.         ret
  36.