Update.
[glibc.git] / sysdeps / libm-i387 / s_nearbyint.S
blob65ce4f76a15bafe26be0a1e9dd24550142fa586c
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(__nearbyint)
10         fldl    4(%esp)
11         pushl   %eax
12         pushl   %ecx
13         fnstcw  (%esp)
14         movl    (%esp), %eax
15         andl    $~0x20, %eax
16         movl    %eax, 4(%esp)
17         fldcw   4(%esp)
18         frndint
19         fclex
20         fldcw   (%esp)
21         popl    %ecx
22         popl    %eax
23         ret
24 END (__nearbyint)
25 weak_alias (__nearbyint, nearbyint)