Override elf_nacl.xr linker script so that libc_pic.os links correctly
[glibc/nacl-glibc.git] / sysdeps / i386 / fpu / s_nearbyintl.S
blobee358aca2942762bea9e454648fd6c27140ed7b3
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         popl %ecx; nacljmp %ecx
28 END (__nearbyintl)
29 weak_alias (__nearbyintl, nearbyintl)