s_ceilf.S (448B)
1 /* 2 * Written by J.T. Conklin <jtc@netbsd.org>. 3 * Public domain. 4 */ 5 6 #include <asm.h> 7 8 ENTRY(ceilf) 9 pushl %ebp 10 movl %esp,%ebp 11 subl $8,%esp 12 13 fstcw -12(%ebp) /* store fpu control word */ 14 movw -12(%ebp),%dx 15 orw $0x0800,%dx /* round towards +oo */ 16 andw $0xfbff,%dx 17 movw %dx,-16(%ebp) 18 fldcw -16(%ebp) /* load modfied control word */ 19 20 flds 8(%ebp); /* round */ 21 frndint 22 23 fldcw -12(%ebp) /* restore original control word */ 24 25 leave 26 ret