| 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>. */ |
| 6 | |
| 7 | #include <machine/asm.h> |
| 8 | |
| 9 | ENTRY(__nearbyintl) |
| 10 | fldt 8(%rsp) |
| 11 | fnstenv -28(%rsp) |
| 12 | movl -28(%rsp), %eax |
| 13 | orl $0x20, %eax |
| 14 | movl %eax, -32(%rsp) |
| 15 | fldcw -32(%rsp) |
| 16 | frndint |
| 17 | fnstsw |
| 18 | andl $0x1, %eax |
| 19 | orl %eax, -24(%rsp) |
| 20 | fldenv -28(%rsp) |
| 21 | ret |
| 22 | END (__nearbyintl) |
| 23 | weak_alias (__nearbyintl, nearbyintl) |
| 24 |