2010-07-21 16:03:44 +00:00
|
|
|
/**
|
|
|
|
* This file has no copyright assigned and is placed in the Public Domain.
|
|
|
|
* This file is part of the w64 mingw-runtime package.
|
|
|
|
* No warranty is given; refer to the file DISCLAIMER.PD within this package.
|
|
|
|
*/
|
|
|
|
|
2010-11-02 00:06:33 +00:00
|
|
|
#include <reactos/asm.h>
|
2010-07-21 16:03:44 +00:00
|
|
|
|
2010-11-02 00:06:33 +00:00
|
|
|
.code
|
|
|
|
.align 4
|
|
|
|
|
|
|
|
PUBLIC _ceilf
|
|
|
|
_ceilf:
|
2010-07-21 16:03:44 +00:00
|
|
|
|
2010-11-02 00:06:33 +00:00
|
|
|
fld dword ptr [esp + 4]
|
|
|
|
sub esp, 8
|
|
|
|
|
|
|
|
fstcw [esp + 4] /* store fpu control word */
|
2010-07-21 16:03:44 +00:00
|
|
|
|
|
|
|
/* We use here %edx although only the low 1 bits are defined.
|
|
|
|
But none of the operations should care and they are faster
|
|
|
|
than the 16 bit operations. */
|
2010-11-02 00:06:33 +00:00
|
|
|
mov edx, [esp + 4]
|
|
|
|
or edx, HEX(0800) /* round towards +oo */
|
|
|
|
and edx, HEX(fbff)
|
|
|
|
mov [esp], edx
|
|
|
|
fldcw [esp] /* load modified control word */
|
2010-07-21 16:03:44 +00:00
|
|
|
|
|
|
|
frndint /* round */
|
|
|
|
|
2010-11-02 00:06:33 +00:00
|
|
|
fldcw [esp + 4] /* restore original control word */
|
2010-07-21 16:03:44 +00:00
|
|
|
|
2010-11-02 00:06:33 +00:00
|
|
|
add esp, 8
|
2010-07-21 16:03:44 +00:00
|
|
|
ret
|
2010-11-02 00:06:33 +00:00
|
|
|
|
|
|
|
END
|