mirror of
https://github.com/reactos/reactos.git
synced 2024-09-22 18:45:51 +00:00
c424146e2c
svn path=/branches/cmake-bringup/; revision=48236
41 lines
975 B
ArmAsm
41 lines
975 B
ArmAsm
/*
|
|
* COPYRIGHT: See COPYING in the top level directory
|
|
* PROJECT: ReactOS system libraries
|
|
* PURPOSE: Implementation of tan
|
|
* FILE: lib/sdk/crt/math/amd64/ceilf.S
|
|
* PROGRAMMER: Timo Kreuzer (timo.kreuzer@reactos.org)
|
|
*/
|
|
|
|
/* INCLUDES ******************************************************************/
|
|
|
|
#include <reactos/asm.h>
|
|
#include <ndk/amd64/asm.h>
|
|
|
|
/* FUNCTIONS ****************************************************************/
|
|
|
|
.code64
|
|
|
|
PUBLIC ceilf
|
|
ceilf:
|
|
/* Put parameter on the stack */
|
|
movss [rsp - 0x10], xmm0
|
|
fld dword ptr [rsp]
|
|
|
|
/* Change fpu control word to round up */
|
|
fstcw [rsp - 0x10]
|
|
mov eax, [rsp - 0x10]
|
|
or eax, 0x00800
|
|
and eax, 0x0fbff
|
|
mov [rsp - 0x08], eax
|
|
fldcw [rsp - 0x08]
|
|
|
|
/* Round to integer */
|
|
frndint
|
|
|
|
/* Restore fpu control word */
|
|
fldcw [rsp - 0x10]
|
|
|
|
fstp dword ptr [rsp - 0x10]
|
|
movss xmm0, [rsp - 0x10]
|
|
ret
|