s_floor.S 654 B

1234567891011121314151617181920212223242526272829303132333435
  1. /*
  2. * Written by:
  3. * J.T. Conklin ([email protected])
  4. * Public domain.
  5. */
  6. #include <i387/bsd_asm.h>
  7. //__FBSDID("$FreeBSD: src/lib/msun/i387/s_floor.S,v 1.10 2011/01/07 16:13:12 kib Exp $")
  8. ENTRY(floor)
  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. fldl 8(%ebp); /* round */
  19. frndint
  20. fldcw -4(%ebp) /* restore original control word */
  21. leave
  22. ret
  23. END(floor)
  24. /* Enable stack protection */
  25. #if defined(__ELF__)
  26. .section .note.GNU-stack,"",%progbits
  27. #endif