]> git.ipfire.org Git - thirdparty/glibc.git/blob - sysdeps/libm-i387/s_ceill.S
fd7bd387529852d3205fc69909469b5409f7883c
[thirdparty/glibc.git] / sysdeps / libm-i387 / s_ceill.S
1 /*
2 * Written by J.T. Conklin <jtc@netbsd.org>.
3 * Changes for long double by Ulrich Drepper <drepper@cygnus.com>
4 * Public domain.
5 */
6
7 #include <machine/asm.h>
8
9 RCSID("$NetBSD: $")
10
11 ENTRY(__ceill)
12 pushl %ebp
13 movl %esp,%ebp
14 subl $8,%esp
15
16 fstcw -4(%ebp) /* store fpu control word */
17 movw -4(%ebp),%dx
18 orw $0x0800,%dx /* round towards +oo */
19 andw $0xfbff,%dx
20 movw %dx,-8(%ebp)
21 fldcw -8(%ebp) /* load modfied control word */
22
23 fldt 8(%ebp); /* round */
24 frndint
25
26 fldcw -4(%ebp) /* restore original control word */
27
28 leave
29 ret
30 weak_alias (__ceill, ceill)