mirror of
https://github.com/reactos/reactos.git
synced 2025-08-07 07:03:06 +00:00
Create a branch for Aleksandar Andrejevic for his work on NTVDM. See http://jira.reactos.org/browse/CORE-7250 for more details.
svn path=/branches/ntvdm/; revision=59241
This commit is contained in:
parent
3e3200acef
commit
4f0b8d3db0
20620 changed files with 0 additions and 1232833 deletions
40
lib/sdk/crt/math/i386/floorf.S
Normal file
40
lib/sdk/crt/math/i386/floorf.S
Normal file
|
@ -0,0 +1,40 @@
|
|||
/*
|
||||
* Written by J.T. Conklin <jtc@netbsd.org>.
|
||||
* Public domain.
|
||||
*
|
||||
* Changes for long double by Ulrich Drepper <drepper@cygnus.com>
|
||||
*
|
||||
* Removed header file dependency for use in libmingwex.a by
|
||||
* Danny Smith <dannysmith@users.sourceforge.net>
|
||||
*/
|
||||
|
||||
#include <asm.inc>
|
||||
|
||||
.code
|
||||
.align 4
|
||||
|
||||
PUBLIC _floorf
|
||||
_floorf:
|
||||
|
||||
fld dword ptr [esp + 4]
|
||||
sub esp, 8
|
||||
|
||||
fstcw [esp + 4] /* store fpu control word */
|
||||
|
||||
/* 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. */
|
||||
mov edx, [esp + 4]
|
||||
or edx, HEX(0400) /* round towards -oo */
|
||||
and edx, HEX(0f7ff)
|
||||
mov [esp], edx
|
||||
fldcw [esp] /* load modified control word */
|
||||
|
||||
frndint /* round */
|
||||
|
||||
fldcw [esp + 4] /* restore original control word */
|
||||
|
||||
add esp, 8
|
||||
ret
|
||||
|
||||
END
|
Loading…
Add table
Add a link
Reference in a new issue