diff options
Diffstat (limited to 'libgfortran/config/fpu-aix.h')
-rw-r--r-- | libgfortran/config/fpu-aix.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/libgfortran/config/fpu-aix.h b/libgfortran/config/fpu-aix.h index bcb5500..1ba9d4c 100644 --- a/libgfortran/config/fpu-aix.h +++ b/libgfortran/config/fpu-aix.h @@ -29,6 +29,10 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #include <fptrap.h> #endif +#ifdef HAVE_FPXCP_H +#include <fpxcp.h> +#endif + void set_fpu (void) { @@ -81,3 +85,34 @@ set_fpu (void) fp_trap(FP_TRAP_SYNC); fp_enable(mode); } + + +int +get_fpu_except_flags (void) +{ + int result, set_excepts; + + result = 0; + +#ifdef HAVE_FPXCP_H + if (!fp_any_xcp ()) + return 0; + + if (fp_invalid_op ()) + result |= GFC_FPE_INVALID; + + if (fp_divbyzero ()) + result |= GFC_FPE_ZERO; + + if (fp_overflow ()) + result |= GFC_FPE_OVERFLOW; + + if (fp_underflow ()) + result |= GFC_FPE_UNDERFLOW; + + if (fp_inexact ()) + result |= GFC_FPE_INEXACT; +#endif + + return result; +} |