s_floorl.S 667 B

12345678910111213141516171819202122232425262728293031323334
  1. /*
  2. * Based on code 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_floorl.S,v 1.3 2011/01/07 16:13:12 kib Exp $")
  7. ENTRY(floorl)
  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 $0x0400,%dx /* round towards -oo */
  14. andw $0xf7ff,%dx
  15. movw %dx,-8(%ebp)
  16. fldcw -8(%ebp) /* load modfied control word */
  17. fldt 8(%ebp) /* round */
  18. frndint
  19. fldcw -4(%ebp) /* restore original control word */
  20. leave
  21. ret
  22. END(floorl)
  23. /* Enable stack protection */
  24. #if defined(__ELF__)
  25. .section .note.GNU-stack,"",%progbits
  26. #endif