2 * Written by J.T. Conklin, Apr 10, 1995
5 * $DragonFly: src/lib/libc/amd64/gen/flt_rounds.c,v 1.1 2006/07/27 00:46:57 corecode Exp $
12 static const int map[] = {
13 1, /* round to nearest */
14 3, /* round to zero */
15 2, /* round to negative infinity */
16 0 /* round to positive infinity */
24 /* Assume that the x87 and the SSE unit agree on the rounding mode. */
25 __asm("fnstcw %0" : "=m" (x));
26 return (map[(x >> 10) & 0x03]);