vx32

Local 9vx git repository for patches.
git clone git://r-36.net/vx32
Log | Files | Refs

s_floorf.S (449B)


      1 /*
      2  * Written by J.T. Conklin <jtc@netbsd.org>.
      3  * Public domain.
      4  */
      5 
      6 #include <asm.h>
      7 
      8 ENTRY(floorf)
      9 	pushl	%ebp
     10 	movl	%esp,%ebp
     11 	subl	$8,%esp
     12 
     13 	fstcw	-12(%ebp)		/* store fpu control word */
     14 	movw	-12(%ebp),%dx
     15 	orw	$0x0400,%dx		/* round towards -oo */
     16 	andw	$0xf7ff,%dx
     17 	movw	%dx,-16(%ebp)
     18 	fldcw	-16(%ebp)		/* load modfied control word */
     19 
     20 	flds	8(%ebp);		/* round */
     21 	frndint
     22 
     23 	fldcw	-12(%ebp)		/* restore original control word */
     24 
     25 	leave
     26 	ret