1 /* Floating-point constants for the 68881.
2 Copyright (C) 1992 Free Software Foundation, Inc. */
4 /* IGNORE($ This is used internally in the library. */
5 #include <sysdeps/ieee754/fl.h>
6 /* ansidecl.m4 here inserts the ieee file. Kludge o rama.
7 $) ENDCOMMENT INCLUDE($sysdeps/ieee754/fl.h$) STARTCOMMENT */
9 #if defined(FLT_ROUNDS) && defined(__GNUC__)
12 /* Interrogate the 68881 to find the current rounding mode. */
14 static __const __inline int
15 DEFUN_VOID(__flt_rounds)
17 unsigned long int __fpcr;
18 __asm("fmove%.l fpcr, %0" : "=g" (__fpcr));
19 switch (__fpcr & (1 | 2))
22 return _FLT_ROUNDS_TONEAREST;
24 return _FLT_ROUNDS_TOZERO;
26 return _FLT_ROUNDS_TONEGINF;
28 return _FLT_ROUNDS_TOPOSINF;
30 return _FLT_ROUNDS_INDETERMINATE;
34 #define FLT_ROUNDS (__flt_rounds())