tools/llvm: Do not build with symbols
[minix3.git] / lib / libc / arch / i386 / gen / flt_rounds.S
blob5440036cec2525b979f022d4f6b59245eaebb16f
1 /*      $NetBSD: flt_rounds.S,v 1.9 2011/09/30 23:42:00 christos Exp $  */
3 #include <machine/asm.h>
5 /*
6  * 00 0 round to zero 
7  * 01 1 round to nearest
8  * 10 2 round to positive infinity
9  * 11 3 round to negative infinity
10  */
11         .text
12         _ALIGN_TEXT
13 ENTRY(__flt_rounds)
14         fnstcw  -4(%esp)
15         movl    -4(%esp), %ecx
16         shrl    $9, %ecx
17         andl    $6, %ecx
18         movl    $0x2d, %eax     /* 0x2d = 00.10.11.01 */
19         sarl    %cl, %eax       /* 0,1,2,3 -> 1,3,2,0 */
20         andl    $3, %eax
21         ret