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.  * Adapted for use as nearbyint 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.  
  11.         .file   "nearbyint.S"
  12.         .text
  13.         .align 4
  14. .globl _nearbyint
  15.         .def    _nearbyint;     .scl    2;      .type   32;     .endef
  16. _nearbyint:
  17.         fldl    4(%esp)
  18.         pushl   %eax
  19.         pushl   %ecx
  20.         fnstcw  (%esp)
  21.         movl    (%esp), %eax
  22.         orl     $0x20, %eax
  23.         movl    %eax, 4(%esp)
  24.         fldcw   4(%esp)
  25.         frndint
  26.         fclex
  27.         fldcw   (%esp)
  28.         popl    %ecx
  29.         popl    %eax
  30.         ret
  31.