1/* 2 * Written by: 3 * J.T. Conklin (jtc@netbsd.org) 4 * Public domain. 5 */ 6 7#include <i387/bsd_asm.h> 8//__FBSDID("$FreeBSD: src/lib/msun/i387/s_floor.S,v 1.10 2011/01/07 16:13:12 kib Exp $") 9 10ENTRY(floor) 11 pushl %ebp 12 movl %esp,%ebp 13 subl $8,%esp 14 15 fstcw -4(%ebp) /* store fpu control word */ 16 movw -4(%ebp),%dx 17 orw $0x0400,%dx /* round towards -oo */ 18 andw $0xf7ff,%dx 19 movw %dx,-8(%ebp) 20 fldcw -8(%ebp) /* load modfied control word */ 21 22 fldl 8(%ebp); /* round */ 23 frndint 24 25 fldcw -4(%ebp) /* restore original control word */ 26 27 leave 28 ret 29END(floor) 30 31 32/* Enable stack protection */ 33#if defined(__ELF__) 34.section .note.GNU-stack,"",%progbits 35#endif 36