]> git.ipfire.org Git - thirdparty/gcc.git/blame - libgfortran/config/fpu-aix.h
Update copyright years in libgfortran.
[thirdparty/gcc.git] / libgfortran / config / fpu-aix.h
CommitLineData
3b14f664 1/* AIX FPU-related code.
e3c063ce 2 Copyright (C) 2005-2013 Free Software Foundation, Inc.
3b14f664
FXC
3 Contributed by Francois-Xavier Coudert <coudert@clipper.ens.fr>
4
1028b2bd 5This file is part of the GNU Fortran runtime library (libgfortran).
3b14f664
FXC
6
7Libgfortran is free software; you can redistribute it and/or
8modify it under the terms of the GNU General Public
9License as published by the Free Software Foundation; either
748086b7 10version 3 of the License, or (at your option) any later version.
3b14f664
FXC
11
12Libgfortran is distributed in the hope that it will be useful,
13but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15GNU General Public License for more details.
16
748086b7
JJ
17Under Section 7 of GPL version 3, you are granted additional
18permissions described in the GCC Runtime Library Exception, version
193.1, as published by the Free Software Foundation.
20
21You should have received a copy of the GNU General Public License and
22a copy of the GCC Runtime Library Exception along with this program;
23see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
24<http://www.gnu.org/licenses/>. */
3b14f664
FXC
25
26
27/* FPU-related code for AIX. */
28#ifdef HAVE_FPTRAP_H
29#include <fptrap.h>
30#endif
31
3b14f664
FXC
32void
33set_fpu (void)
34{
35 fptrap_t mode = 0;
36
37 if (options.fpe & GFC_FPE_INVALID)
38#ifdef TRP_INVALID
39 mode |= TRP_INVALID;
40#else
1028b2bd
JB
41 estr_write ("Fortran runtime warning: IEEE 'invalid operation' "
42 "exception not supported.\n");
3b14f664
FXC
43#endif
44
45 if (options.fpe & GFC_FPE_DENORMAL)
57b4d355 46 estr_write ("Fortran runtime warning: Floating point 'denormal operand' "
1028b2bd 47 "exception not supported.\n");
3b14f664
FXC
48
49 if (options.fpe & GFC_FPE_ZERO)
50#ifdef TRP_DIV_BY_ZERO
51 mode |= TRP_DIV_BY_ZERO;
52#else
1028b2bd
JB
53 estr_write ("Fortran runtime warning: IEEE 'division by zero' "
54 "exception not supported.\n");
3b14f664
FXC
55#endif
56
57 if (options.fpe & GFC_FPE_OVERFLOW)
58#ifdef TRP_OVERFLOW
59 mode |= TRP_OVERFLOW;
60#else
1028b2bd
JB
61 estr_write ("Fortran runtime warning: IEEE 'overflow' "
62 "exception not supported.\n");
3b14f664
FXC
63#endif
64
65 if (options.fpe & GFC_FPE_UNDERFLOW)
66#ifdef TRP_UNDERFLOW
67 mode |= TRP_UNDERFLOW;
68#else
1028b2bd
JB
69 estr_write ("Fortran runtime warning: IEEE 'underflow' "
70 "exception not supported.\n");
3b14f664
FXC
71#endif
72
57b4d355
JB
73 if (options.fpe & GFC_FPE_INEXACT)
74#ifdef TRP_INEXACT
75 mode |= TRP_INEXACT;
3b14f664 76#else
57b4d355 77 estr_write ("Fortran runtime warning: IEEE 'inexact' "
1028b2bd 78 "exception not supported.\n");
3b14f664
FXC
79#endif
80
81 fp_trap(FP_TRAP_SYNC);
82 fp_enable(mode);
83}