xref: /reactos/sdk/lib/crt/math/i386/ceilf.S (revision 40462c92)
1/**
2 * This file has no copyright assigned and is placed in the Public Domain.
3 * This file is part of the w64 mingw-runtime package.
4 * No warranty is given; refer to the file DISCLAIMER.PD within this package.
5 */
6
7#include <asm.inc>
8
9.code
10.align 4
11
12PUBLIC _ceilf
13_ceilf:
14
15	fld dword ptr [esp + 4]
16	sub esp, 8
17
18	fstcw [esp + 4]			/* store fpu control word */
19
20	/* We use here %edx although only the low 1 bits are defined.
21	   But none of the operations should care and they are faster
22	   than the 16 bit operations.  */
23	mov edx, [esp + 4]
24	or edx,  HEX(0800)		/* round towards +oo */
25	and edx, HEX(fbff)
26	mov [esp], edx
27	fldcw [esp]			/* load modified control word */
28
29	frndint				/* round */
30
31	fldcw [esp + 4]			/* restore original control word */
32
33	add esp, 8
34	ret
35
36END
37