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.  
  6.         .file   "ceilf.S"
  7.         .text
  8.         .align 4
  9. .globl _ceilf
  10.         .def    _ceilf; .scl    2;      .type   32;     .endef
  11. _ceilf:
  12.         flds    4(%esp)
  13.         subl    $8,%esp
  14.  
  15.         fstcw   4(%esp)                 /* store fpu control word */
  16.  
  17.         /* We use here %edx although only the low 1 bits are defined.
  18.            But none of the operations should care and they are faster
  19.            than the 16 bit operations.  */
  20.         movl    $0x0800,%edx            /* round towards +oo */
  21.         orl     4(%esp),%edx
  22.         andl    $0xfbff,%edx
  23.         movl    %edx,(%esp)
  24.         fldcw   (%esp)                  /* load modified control word */
  25.  
  26.         frndint                         /* round */
  27.  
  28.         fldcw   4(%esp)                 /* restore original control word */
  29.  
  30.         addl    $8,%esp
  31.         ret
  32.