mirror of
https://github.com/reactos/reactos.git
synced 2024-09-22 18:45:51 +00:00
a3623f23de
- Make all x86assembly ML compatible - Remove memcpy, it was duplicated from memmove, copy the label instead - Guard some code against compilation on msvc, as these functions are intrinsics on MSVC and cannot be implemented - Fix some x64 assembly (don't modify stack below rsp) svn path=/branches/cmake-bringup/; revision=49421
46 lines
970 B
ArmAsm
46 lines
970 B
ArmAsm
/*
|
|
* COPYRIGHT: See COPYING in the top level directory
|
|
* PROJECT: ReactOS system libraries
|
|
* PURPOSE: Implementation of tan
|
|
* FILE: lib/sdk/crt/math/amd64/floorf.S
|
|
* PROGRAMMER: Timo Kreuzer (timo.kreuzer@reactos.org)
|
|
*/
|
|
|
|
/* INCLUDES ******************************************************************/
|
|
|
|
#include <reactos/asm.h>
|
|
#include <ndk/amd64/asm.h>
|
|
|
|
/* FUNCTIONS ****************************************************************/
|
|
|
|
.code64
|
|
|
|
PUBLIC floorf
|
|
floorf:
|
|
sub rsp, 16
|
|
|
|
/* Put parameter on the stack */
|
|
movss [rsp], xmm0
|
|
fld dword ptr [rsp]
|
|
|
|
/* Change fpu control word to round down */
|
|
fstcw [rsp]
|
|
mov eax, [rsp]
|
|
or eax, 0x00400
|
|
and eax, 0x0f7ff
|
|
mov [rsp + 8], eax
|
|
fldcw [rsp + 8]
|
|
|
|
/* Round to integer */
|
|
frndint
|
|
|
|
/* Restore fpu control word */
|
|
fldcw [rsp]
|
|
|
|
fstp dword ptr [rsp]
|
|
movss xmm0, [rsp]
|
|
add rsp, 16
|
|
ret
|
|
|
|
END
|