2.9
[glibc/nacl-glibc.git] / sysdeps / i386 / fpu / s_nearbyintl.S
blob819af63a8dbe04cc179db9010dd69c8ccf233460
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(__nearbyintl)
10         fldt    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 (__nearbyintl)
29 weak_alias (__nearbyintl, nearbyintl)