Update copyright dates with scripts/update-copyrights.
[glibc.git] / sysdeps / i386 / fpu / s_ceilf.S
blob4fe703b17942ef90c5b33e981a4dd94c0a84e578
1 /*
2  * Written by J.T. Conklin <jtc@netbsd.org>.
3  * Public domain.
4  */
6 #include <machine/asm.h>
8 RCSID("$NetBSD: s_ceilf.S,v 1.3 1995/05/08 23:52:44 jtc Exp $")
10 ENTRY(__ceilf)
11         flds    4(%esp)
12         subl    $8,%esp
13         cfi_adjust_cfa_offset (8)
15         fstcw   4(%esp)                 /* store fpu control word */
17         /* We use here %edx although only the low 1 bits are defined.
18            But none of the operations should care and they are faster
19            than the 16 bit operations.  */
20         movl    $0x0800,%edx            /* round towards +oo */
21         orl     4(%esp),%edx
22         andl    $0xfbff,%edx
23         movl    %edx,(%esp)
24         fldcw   (%esp)                  /* load modified control word */
26         frndint                         /* round */
28         fldcw   4(%esp)                 /* restore original control word */
30         addl    $8,%esp
31         cfi_adjust_cfa_offset (-8)
32         ret
33 END (__ceilf)
34 weak_alias (__ceilf, ceilf)