xref: /reactos/sdk/lib/crt/math/arm/floor.s (revision 8a978a17)
1/*
2 * COPYRIGHT:         BSD - See COPYING.ARM in the top level directory
3 * PROJECT:           ReactOS CRT library
4 * PURPOSE:           Implementation of floor
5 * PROGRAMMER:        Timo Kreuzer (timo.kreuzer@reactos.org)
6 *                    Original implementation: dawncrow
7 * SOURCE:            MinGW-w64\mingw-w64-crt\math\floor.S
8 */
9
10/* INCLUDES ******************************************************************/
11
12#include <kxarm.h>
13
14/* CODE **********************************************************************/
15
16    TEXTAREA
17
18    LEAF_ENTRY floor
19
20	vmrs	r1, fpscr
21	bic		r0, r1, #0x00c00000
22	orr		r0, r0, #0x00800000 /* Round towards Minus Infinity */
23	vmsr	fpscr, r0
24	vcvtr.s32.f64	s0, d0
25	vcvt.f64.s32	d0, s0
26	vmsr	fpscr, r1
27	bx	lr
28
29    LEAF_END floor
30
31    END
32/* EOF */
33