mirror of
https://github.com/reactos/reactos.git
synced 2025-08-06 13:13:00 +00:00
[CRT]
- 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
This commit is contained in:
parent
0d7a1c46a0
commit
a3623f23de
49 changed files with 912 additions and 918 deletions
|
@ -17,24 +17,28 @@
|
|||
|
||||
PUBLIC ceilf
|
||||
ceilf:
|
||||
sub rsp, 16
|
||||
|
||||
/* Put parameter on the stack */
|
||||
movss [rsp - 0x10], xmm0
|
||||
fld dword ptr [rsp]
|
||||
movss [rsp], 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]
|
||||
fstcw [rsp + 8]
|
||||
mov eax, [rsp + 8]
|
||||
or eax, 0x00800
|
||||
and eax, 0x0fbff
|
||||
mov [rsp + 12], eax
|
||||
fldcw [rsp + 12]
|
||||
|
||||
/* Round to integer */
|
||||
frndint
|
||||
|
||||
/* Restore fpu control word */
|
||||
fldcw [rsp - 0x10]
|
||||
fldcw [rsp + 8]
|
||||
|
||||
fstp dword ptr [rsp - 0x10]
|
||||
movss xmm0, [rsp - 0x10]
|
||||
fstp dword ptr [rsp]
|
||||
movss xmm0, [rsp]
|
||||
|
||||
add rsp, 16
|
||||
ret
|
||||
|
|
|
@ -17,24 +17,29 @@
|
|||
|
||||
PUBLIC floorf
|
||||
floorf:
|
||||
sub rsp, 16
|
||||
|
||||
/* Put parameter on the stack */
|
||||
movss [rsp - 0x10], xmm0
|
||||
movss [rsp], xmm0
|
||||
fld dword ptr [rsp]
|
||||
|
||||
/* Change fpu control word to round down */
|
||||
fstcw [rsp - 0x10]
|
||||
mov eax, [rsp - 0x10]
|
||||
fstcw [rsp]
|
||||
mov eax, [rsp]
|
||||
or eax, 0x00400
|
||||
and eax, 0x0f7ff
|
||||
mov [rsp - 0x08], eax
|
||||
fldcw [rsp - 0x08]
|
||||
mov [rsp + 8], eax
|
||||
fldcw [rsp + 8]
|
||||
|
||||
/* Round to integer */
|
||||
frndint
|
||||
|
||||
/* Restore fpu control word */
|
||||
fldcw [rsp - 0x10]
|
||||
fldcw [rsp]
|
||||
|
||||
fstp dword ptr [rsp - 0x10]
|
||||
movss xmm0, [rsp - 0x10]
|
||||
fstp dword ptr [rsp]
|
||||
movss xmm0, [rsp]
|
||||
add rsp, 16
|
||||
ret
|
||||
|
||||
END
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue