s_ceil.S 568 B

12345678910111213141516171819202122232425262728293031323334
  1. /*
  2. * Written by:
  3. * J.T. Conklin ([email protected])
  4. * Public domain.
  5. */
  6. #include <i387/bsd_asm.h>
  7. ENTRY(ceil)
  8. pushl %ebp
  9. movl %esp,%ebp
  10. subl $8,%esp
  11. fstcw -4(%ebp) /* store fpu control word */
  12. movw -4(%ebp),%dx
  13. orw $0x0800,%dx /* round towards +oo */
  14. andw $0xfbff,%dx
  15. movw %dx,-8(%ebp)
  16. fldcw -8(%ebp) /* load modfied control word */
  17. fldl 8(%ebp); /* round */
  18. frndint
  19. fldcw -4(%ebp) /* restore original control word */
  20. leave
  21. ret
  22. END(ceil)
  23. /* Enable stack protection */
  24. #if defined(__ELF__)
  25. .section .note.GNU-stack,"",%progbits
  26. #endif