1
0
Fork 0
mirror of https://gitlab.com/sortix/sortix.git synced 2023-02-13 20:55:38 -05:00
sortix--sortix/libm/arch/i387/lrint.S
Jonas 'Sortie' Termansen 5980be9b3c Add Sortix Math Library.
This work is based in part on code from NetBSD libm, libc and kernel.

The library is partly public domain and partly BSD-style licensed.
2013-12-17 14:30:39 +01:00

23 lines
350 B
ArmAsm

/* $NetBSD: lrint.S,v 1.2 2004/10/13 15:18:32 drochner Exp $ */
/*
* Written by Matthias Drochner <drochner@NetBSD.org>.
* Public domain.
*/
#include <machine/asm.h>
ENTRY(lrint)
#ifdef __i386__
pushl %ebp
movl %esp,%ebp
subl $4,%esp
fldl 8(%ebp)
fistpl (%esp)
movl (%esp),%eax
leave
ret
#else
cvtsd2siq %xmm0,%rax
ret
#endif