s_floorf.S 726 B

123456789101112131415161718192021222324252627282930313233343536
  1. /*
  2. * Written by J.T. Conklin <[email protected]>.
  3. * Public domain.
  4. */
  5. #include <i387/bsd_asm.h>
  6. //__FBSDID("$FreeBSD: src/lib/msun/i387/s_floorf.S,v 1.4 2011/01/07 16:13:12 kib Exp $");
  7. /* RCSID("$NetBSD: s_floorf.S,v 1.3 1995/05/09 00:04:32 jtc Exp $") */
  8. ENTRY(floorf)
  9. pushl %ebp
  10. movl %esp,%ebp
  11. subl $8,%esp
  12. fstcw -4(%ebp) /* store fpu control word */
  13. movw -4(%ebp),%dx
  14. orw $0x0400,%dx /* round towards -oo */
  15. andw $0xf7ff,%dx
  16. movw %dx,-8(%ebp)
  17. fldcw -8(%ebp) /* load modfied control word */
  18. flds 8(%ebp); /* round */
  19. frndint
  20. fldcw -4(%ebp) /* restore original control word */
  21. leave
  22. ret
  23. END(floorf)
  24. /* Enable stack protection */
  25. #if defined(__ELF__)
  26. .section .note.GNU-stack,"",%progbits
  27. #endif