Home | History | Annotate | Line # | Download | only in i387
      1 /* $NetBSD: lrint.S,v 1.2 2004/10/13 15:18:32 drochner Exp $ */
      2 
      3 /*
      4  * Written by Matthias Drochner <drochner (at) NetBSD.org>.
      5  * Public domain.
      6  */
      7 
      8 #include <machine/asm.h>
      9 
     10 ENTRY(lrint)
     11 #ifdef __i386__
     12 	pushl   %ebp
     13 	movl    %esp,%ebp
     14 	subl    $4,%esp
     15 	fldl	8(%ebp)
     16 	fistpl	(%esp)
     17 	movl	(%esp),%eax
     18 	leave
     19 	ret
     20 #else
     21 	cvtsd2siq %xmm0,%rax
     22 	ret
     23 #endif
     24