xref: /freebsd/lib/msun/i387/s_ceill.S (revision f126890ac5386406dadf7c4cfa9566cbb56537c5)
1/*
2 * Based on code written by J.T. Conklin <jtc@NetBSD.org>.
3 * Public domain.
4 */
5
6#include <machine/asm.h>
7ENTRY(ceill)
8	pushl	%ebp
9	movl	%esp,%ebp
10	subl	$8,%esp
11
12	fstcw	-4(%ebp)		/* store fpu control word */
13	movw	-4(%ebp),%dx
14	orw	$0x0800,%dx		/* round towards +oo */
15	andw	$0xfbff,%dx
16	movw	%dx,-8(%ebp)
17	fldcw	-8(%ebp)		/* load modified control word */
18
19	fldt	8(%ebp)			/* round */
20	frndint
21
22	fldcw	-4(%ebp)		/* restore original control word */
23
24	leave
25	ret
26END(ceill)
27
28	.section .note.GNU-stack,"",%progbits
29