2.9
[glibc/nacl-glibc.git] / sysdeps / i386 / fpu / s_nearbyintf.S
blob6a6b1d6c2bee0e8b8547e52fc177be1194fcaddc
1 /*
2  * Written by J.T. Conklin <jtc@netbsd.org>.
3  * Public domain.
4  */
5 /* Adapted for use as nearbyint by Ulrich Drepper <drepper@cygnus.com>.  */
7 #include <machine/asm.h>
9 ENTRY(__nearbyintf)
10         flds    4(%esp)
11         pushl   %eax
12         cfi_adjust_cfa_offset (4)
13         pushl   %ecx
14         cfi_adjust_cfa_offset (4)
15         fnstcw  (%esp)
16         movl    (%esp), %eax
17         orl     $0x20, %eax
18         movl    %eax, 4(%esp)
19         fldcw   4(%esp)
20         frndint
21         fclex
22         fldcw   (%esp)
23         popl    %ecx
24         cfi_adjust_cfa_offset (-4)
25         popl    %eax
26         cfi_adjust_cfa_offset (-4)
27         ret
28 END (__nearbyintf)
29 weak_alias (__nearbyintf, nearbyintf)