Fortran: add IEEE_MODES_TYPE, IEEE_GET_MODES and IEEE_SET_MODES
commitde40fab2f32b03c3d8f69f72c7f1e38694f93d35
authorFrancois-Xavier Coudert <fxcoudert@gmail.com>
Sun, 4 Sep 2022 16:24:23 +0000 (4 18:24 +0200)
committerFrancois-Xavier Coudert <fxcoudert@gmail.com>
Mon, 19 Sep 2022 12:26:34 +0000 (19 14:26 +0200)
treea5100ce2c023af13b9659f48592b3719b2577612
parent6efc494a24bb423f1f9ef8dbdc65ca189072eb8d
Fortran: add IEEE_MODES_TYPE, IEEE_GET_MODES and IEEE_SET_MODES

The IEEE_MODES_TYPE type and the two functions that get and set it
were added in Fortran 2018.  They can be implemented using the already
existing target-specific functions.  A future optimization could, on
some targets, set/get all modes through one or two instructions only,
but that would need a new set of functions in all config/fpu-* files.

2022-09-04  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>

libgfortran/

* ieee/ieee_exceptions.F90: Add IEEE_MODES_TYPE, IEEE_GET_MODES
and IEEE_SET_MODES.
* ieee/ieee_arithmetic.F90: Make them public in IEEE_ARITHMETIC
as well.

gcc/testsuite/

* gfortran.dg/ieee/modes_1.f90: New test.
gcc/testsuite/gfortran.dg/ieee/modes_1.f90 [new file with mode: 0644]
libgfortran/ieee/ieee_arithmetic.F90
libgfortran/ieee/ieee_exceptions.F90