aboutsummaryrefslogtreecommitdiff
path: root/libgfortran
diff options
context:
space:
mode:
authorSteven G. Kargl <kargl@gcc.gnu.org>2018-12-29 19:14:32 +0000
committerSteven G. Kargl <kargl@gcc.gnu.org>2018-12-29 19:14:32 +0000
commitede9dea5c4af7ca2c4c557e9f9174c94acc0b1fe (patch)
tree20ff329b4ba94978ae0c6552340ae28cc2d483da /libgfortran
parent600845521e68b5e0da136636ecf174eee8e5ee17 (diff)
expr.c (external_spec_function): Add ieee_support_subnormal to list of IEEE inquiry functions.
2018-12-29 Steven G. Kargl <kargl@gcc.gnu.org> * expr.c (external_spec_function): Add ieee_support_subnormal to list of IEEE inquiry functions. 2018-12-29 Steven G. Kargl <kargl@gcc.gnu.org> * gfortran.map: Expose subnormal functions in dynamic library. * ieee/ieee_arithmetic.F90: Add support for IEEE_SUBNORMAL, IEEE_POSITIVE_SUBNORMAL, and IEEE_NEGATIVE_SUBNORMAL. * ieee/ieee_helper.c: Ditto. * ieee/ieee_features.F90: Add IEEE_SUBNORMAL. 2018-12-29 Steven G. Kargl <kargl@gcc.gnu.org> * gfortran.dg/ieee/ieee_11.F90: New test. From-SVN: r267468
Diffstat (limited to 'libgfortran')
-rw-r--r--libgfortran/ChangeLog8
-rw-r--r--libgfortran/gfortran.map5
-rw-r--r--libgfortran/ieee/ieee_arithmetic.F9015
-rw-r--r--libgfortran/ieee/ieee_features.F901
-rw-r--r--libgfortran/ieee/ieee_helper.c3
5 files changed, 30 insertions, 2 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog
index 6eace449440..ab0dd2115ff 100644
--- a/libgfortran/ChangeLog
+++ b/libgfortran/ChangeLog
@@ -1,4 +1,12 @@
2018-12-29 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ * gfortran.map: Expose subnormal functions in dynamic library.
+ * ieee/ieee_arithmetic.F90: Add support for IEEE_SUBNORMAL,
+ IEEE_POSITIVE_SUBNORMAL, and IEEE_NEGATIVE_SUBNORMAL.
+ * ieee/ieee_helper.c: Ditto.
+ * ieee/ieee_features.F90: Add IEEE_SUBNORMAL.
+
+2018-12-29 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/88342
* ieee/ieee_arithmetic.F90: Prevent exceptions in IEEE_VALUE if
diff --git a/libgfortran/gfortran.map b/libgfortran/gfortran.map
index 8dcb3295b20..ce4fe201b1e 100644
--- a/libgfortran/gfortran.map
+++ b/libgfortran/gfortran.map
@@ -1573,4 +1573,9 @@ GFORTRAN_9 {
_gfortran_sfindloc2_s1;
_gfortran_sfindloc2_s4;
_gfortran_st_wait_async;
+ __ieee_arithmetic_MOD_ieee_support_subnormal_10;
+ __ieee_arithmetic_MOD_ieee_support_subnormal_16;
+ __ieee_arithmetic_MOD_ieee_support_subnormal_4;
+ __ieee_arithmetic_MOD_ieee_support_subnormal_8;
+ __ieee_arithmetic_MOD_ieee_support_subnormal_noarg;
};
diff --git a/libgfortran/ieee/ieee_arithmetic.F90 b/libgfortran/ieee/ieee_arithmetic.F90
index 1cda1c7458b..ac6334cba70 100644
--- a/libgfortran/ieee/ieee_arithmetic.F90
+++ b/libgfortran/ieee/ieee_arithmetic.F90
@@ -55,9 +55,11 @@ module IEEE_ARITHMETIC
IEEE_NEGATIVE_INF = IEEE_CLASS_TYPE(3), &
IEEE_NEGATIVE_NORMAL = IEEE_CLASS_TYPE(4), &
IEEE_NEGATIVE_DENORMAL = IEEE_CLASS_TYPE(5), &
+ IEEE_NEGATIVE_SUBNORMAL= IEEE_CLASS_TYPE(5), &
IEEE_NEGATIVE_ZERO = IEEE_CLASS_TYPE(6), &
IEEE_POSITIVE_ZERO = IEEE_CLASS_TYPE(7), &
IEEE_POSITIVE_DENORMAL = IEEE_CLASS_TYPE(8), &
+ IEEE_POSITIVE_SUBNORMAL= IEEE_CLASS_TYPE(8), &
IEEE_POSITIVE_NORMAL = IEEE_CLASS_TYPE(9), &
IEEE_POSITIVE_INF = IEEE_CLASS_TYPE(10)
@@ -795,6 +797,7 @@ REM_MACRO(4,4,4)
SUPPORTGENERIC(IEEE_SUPPORT_DATATYPE)
SUPPORTGENERIC(IEEE_SUPPORT_DENORMAL)
+SUPPORTGENERIC(IEEE_SUPPORT_SUBNORMAL)
SUPPORTGENERIC(IEEE_SUPPORT_DIVIDE)
SUPPORTGENERIC(IEEE_SUPPORT_INF)
SUPPORTGENERIC(IEEE_SUPPORT_IO)
@@ -1359,7 +1362,7 @@ SUPPORTMACRO(IEEE_SUPPORT_DATATYPE,16,.true.)
#endif
SUPPORTMACRO_NOARG(IEEE_SUPPORT_DATATYPE,.true.)
-! IEEE_SUPPORT_DENORMAL
+! IEEE_SUPPORT_DENORMAL and IEEE_SUPPORT_SUBNORMAL
SUPPORTMACRO(IEEE_SUPPORT_DENORMAL,4,.true.)
SUPPORTMACRO(IEEE_SUPPORT_DENORMAL,8,.true.)
@@ -1371,6 +1374,16 @@ SUPPORTMACRO(IEEE_SUPPORT_DENORMAL,16,.true.)
#endif
SUPPORTMACRO_NOARG(IEEE_SUPPORT_DENORMAL,.true.)
+SUPPORTMACRO(IEEE_SUPPORT_SUBNORMAL,4,.true.)
+SUPPORTMACRO(IEEE_SUPPORT_SUBNORMAL,8,.true.)
+#ifdef HAVE_GFC_REAL_10
+SUPPORTMACRO(IEEE_SUPPORT_SUBNORMAL,10,.true.)
+#endif
+#ifdef HAVE_GFC_REAL_16
+SUPPORTMACRO(IEEE_SUPPORT_SUBNORMAL,16,.true.)
+#endif
+SUPPORTMACRO_NOARG(IEEE_SUPPORT_SUBNORMAL,.true.)
+
! IEEE_SUPPORT_DIVIDE
SUPPORTMACRO(IEEE_SUPPORT_DIVIDE,4,.true.)
diff --git a/libgfortran/ieee/ieee_features.F90 b/libgfortran/ieee/ieee_features.F90
index d5aec3bca1e..af8185e8277 100644
--- a/libgfortran/ieee/ieee_features.F90
+++ b/libgfortran/ieee/ieee_features.F90
@@ -36,6 +36,7 @@ module IEEE_FEATURES
type(IEEE_FEATURES_TYPE), parameter, public :: &
IEEE_DATATYPE = IEEE_FEATURES_TYPE(0), &
IEEE_DENORMAL = IEEE_FEATURES_TYPE(1), &
+ IEEE_SUBNORMAL = IEEE_FEATURES_TYPE(1), &
IEEE_DIVIDE = IEEE_FEATURES_TYPE(2), &
IEEE_HALTING = IEEE_FEATURES_TYPE(3), &
IEEE_INEXACT_FLAG = IEEE_FEATURES_TYPE(4), &
diff --git a/libgfortran/ieee/ieee_helper.c b/libgfortran/ieee/ieee_helper.c
index 5071efa4f82..35231274a1a 100644
--- a/libgfortran/ieee/ieee_helper.c
+++ b/libgfortran/ieee/ieee_helper.c
@@ -50,7 +50,8 @@ internal_proto(ieee_class_helper_16);
enum { IEEE_OTHER_VALUE = 0, IEEE_SIGNALING_NAN, IEEE_QUIET_NAN,
IEEE_NEGATIVE_INF, IEEE_NEGATIVE_NORMAL, IEEE_NEGATIVE_DENORMAL,
IEEE_NEGATIVE_ZERO, IEEE_POSITIVE_ZERO, IEEE_POSITIVE_DENORMAL,
- IEEE_POSITIVE_NORMAL, IEEE_POSITIVE_INF };
+ IEEE_POSITIVE_NORMAL, IEEE_POSITIVE_INF, IEEE_SUBNORMAL,
+ IEEE_NEGATIVE_SUBNORMAL, IEEE_POSITIVE_SUBNORMAL };
#define CLASSMACRO(TYPE) \
int ieee_class_helper_ ## TYPE (GFC_REAL_ ## TYPE *value) \