xref: /freebsd/lib/msun/i387/s_ceilf.S (revision 5ca8e32633c4ffbbcd6762e5888b6a4ba0708c6c)
1/*
2 * Written by J.T. Conklin <jtc@netbsd.org>.
3 * Public domain.
4 */
5
6#include <machine/asm.h>
7/* RCSID("$NetBSD: s_ceilf.S,v 1.3 1995/05/08 23:52:44 jtc Exp $") */
8
9ENTRY(ceilf)
10	pushl	%ebp
11	movl	%esp,%ebp
12	subl	$8,%esp
13
14	fstcw	-4(%ebp)		/* store fpu control word */
15	movw	-4(%ebp),%dx
16	orw	$0x0800,%dx		/* round towards +oo */
17	andw	$0xfbff,%dx
18	movw	%dx,-8(%ebp)
19	fldcw	-8(%ebp)		/* load modified control word */
20
21	flds	8(%ebp);		/* round */
22	frndint
23
24	fldcw	-4(%ebp)		/* restore original control word */
25
26	leave
27	ret
28END(ceilf)
29
30	.section .note.GNU-stack,"",%progbits
31