1 ! Implementation of the IEEE_ARITHMETIC standard intrinsic module
2 ! Copyright (C) 2013-2021 Free Software Foundation, Inc.
3 ! Contributed by Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
5 ! This file is part of the GNU Fortran runtime library (libgfortran).
7 ! Libgfortran is free software; you can redistribute it and/or
8 ! modify it under the terms of the GNU General Public
9 ! License as published by the Free Software Foundation; either
10 ! version 3 of the License, or (at your option) any later version.
12 ! Libgfortran is distributed in the hope that it will be useful,
13 ! but WITHOUT ANY WARRANTY; without even the implied warranty of
14 ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 ! GNU General Public License for more details.
17 ! Under Section 7 of GPL version 3, you are granted additional
18 ! permissions described in the GCC Runtime Library Exception, version
19 ! 3.1, as published by the Free Software Foundation.
21 ! You should have received a copy of the GNU General Public License and
22 ! a copy of the GCC Runtime Library Exception along with this program;
23 ! see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
24 ! <http://www.gnu.org/licenses/>. */
28 #include "c99_protos.inc"
29 #include "fpu-target.inc"
31 module IEEE_ARITHMETIC
37 ! Every public symbol from IEEE_EXCEPTIONS must be made public here
38 public :: IEEE_FLAG_TYPE, IEEE_INVALID, IEEE_OVERFLOW, &
39 IEEE_DIVIDE_BY_ZERO, IEEE_UNDERFLOW, IEEE_INEXACT, IEEE_USUAL, &
40 IEEE_ALL, IEEE_STATUS_TYPE, IEEE_GET_FLAG, IEEE_GET_HALTING_MODE, &
41 IEEE_GET_STATUS, IEEE_SET_FLAG, IEEE_SET_HALTING_MODE, &
42 IEEE_SET_STATUS, IEEE_SUPPORT_FLAG, IEEE_SUPPORT_HALTING
44 ! Derived types and named constants
46 type, public :: IEEE_CLASS_TYPE
51 type(IEEE_CLASS_TYPE), parameter, public :: &
52 IEEE_OTHER_VALUE = IEEE_CLASS_TYPE(0), &
53 IEEE_SIGNALING_NAN = IEEE_CLASS_TYPE(1), &
54 IEEE_QUIET_NAN = IEEE_CLASS_TYPE(2), &
55 IEEE_NEGATIVE_INF = IEEE_CLASS_TYPE(3), &
56 IEEE_NEGATIVE_NORMAL = IEEE_CLASS_TYPE(4), &
57 IEEE_NEGATIVE_DENORMAL = IEEE_CLASS_TYPE(5), &
58 IEEE_NEGATIVE_SUBNORMAL= IEEE_CLASS_TYPE(5), &
59 IEEE_NEGATIVE_ZERO = IEEE_CLASS_TYPE(6), &
60 IEEE_POSITIVE_ZERO = IEEE_CLASS_TYPE(7), &
61 IEEE_POSITIVE_DENORMAL = IEEE_CLASS_TYPE(8), &
62 IEEE_POSITIVE_SUBNORMAL= IEEE_CLASS_TYPE(8), &
63 IEEE_POSITIVE_NORMAL = IEEE_CLASS_TYPE(9), &
64 IEEE_POSITIVE_INF = IEEE_CLASS_TYPE(10)
66 type, public :: IEEE_ROUND_TYPE
71 type(IEEE_ROUND_TYPE), parameter, public :: &
72 IEEE_NEAREST = IEEE_ROUND_TYPE(GFC_FPE_TONEAREST), &
73 IEEE_TO_ZERO = IEEE_ROUND_TYPE(GFC_FPE_TOWARDZERO), &
74 IEEE_UP = IEEE_ROUND_TYPE(GFC_FPE_UPWARD), &
75 IEEE_DOWN = IEEE_ROUND_TYPE(GFC_FPE_DOWNWARD), &
76 IEEE_OTHER = IEEE_ROUND_TYPE(0)
79 ! Equality operators on the derived types
80 ! Note, the FE overloads .eq. to == and .ne. to /=
81 interface operator (.eq.)
82 module procedure IEEE_CLASS_TYPE_EQ, IEEE_ROUND_TYPE_EQ
84 public :: operator(.eq.)
86 interface operator (.ne.)
87 module procedure IEEE_CLASS_TYPE_NE, IEEE_ROUND_TYPE_NE
89 public :: operator (.ne.)
95 elemental logical function _gfortran_ieee_is_finite_4(X)
96 real(kind=4), intent(in) :: X
98 elemental logical function _gfortran_ieee_is_finite_8(X)
99 real(kind=8), intent(in) :: X
101 #ifdef HAVE_GFC_REAL_10
102 elemental logical function _gfortran_ieee_is_finite_10(X)
103 real(kind=10), intent(in) :: X
106 #ifdef HAVE_GFC_REAL_16
107 elemental logical function _gfortran_ieee_is_finite_16(X)
108 real(kind=16), intent(in) :: X
113 interface IEEE_IS_FINITE
115 #ifdef HAVE_GFC_REAL_16
116 _gfortran_ieee_is_finite_16, &
118 #ifdef HAVE_GFC_REAL_10
119 _gfortran_ieee_is_finite_10, &
121 _gfortran_ieee_is_finite_8, _gfortran_ieee_is_finite_4
123 public :: IEEE_IS_FINITE
128 elemental logical function _gfortran_ieee_is_nan_4(X)
129 real(kind=4), intent(in) :: X
131 elemental logical function _gfortran_ieee_is_nan_8(X)
132 real(kind=8), intent(in) :: X
134 #ifdef HAVE_GFC_REAL_10
135 elemental logical function _gfortran_ieee_is_nan_10(X)
136 real(kind=10), intent(in) :: X
139 #ifdef HAVE_GFC_REAL_16
140 elemental logical function _gfortran_ieee_is_nan_16(X)
141 real(kind=16), intent(in) :: X
146 interface IEEE_IS_NAN
148 #ifdef HAVE_GFC_REAL_16
149 _gfortran_ieee_is_nan_16, &
151 #ifdef HAVE_GFC_REAL_10
152 _gfortran_ieee_is_nan_10, &
154 _gfortran_ieee_is_nan_8, _gfortran_ieee_is_nan_4
156 public :: IEEE_IS_NAN
161 elemental logical function _gfortran_ieee_is_negative_4(X)
162 real(kind=4), intent(in) :: X
164 elemental logical function _gfortran_ieee_is_negative_8(X)
165 real(kind=8), intent(in) :: X
167 #ifdef HAVE_GFC_REAL_10
168 elemental logical function _gfortran_ieee_is_negative_10(X)
169 real(kind=10), intent(in) :: X
172 #ifdef HAVE_GFC_REAL_16
173 elemental logical function _gfortran_ieee_is_negative_16(X)
174 real(kind=16), intent(in) :: X
179 interface IEEE_IS_NEGATIVE
181 #ifdef HAVE_GFC_REAL_16
182 _gfortran_ieee_is_negative_16, &
184 #ifdef HAVE_GFC_REAL_10
185 _gfortran_ieee_is_negative_10, &
187 _gfortran_ieee_is_negative_8, _gfortran_ieee_is_negative_4
189 public :: IEEE_IS_NEGATIVE
194 elemental logical function _gfortran_ieee_is_normal_4(X)
195 real(kind=4), intent(in) :: X
197 elemental logical function _gfortran_ieee_is_normal_8(X)
198 real(kind=8), intent(in) :: X
200 #ifdef HAVE_GFC_REAL_10
201 elemental logical function _gfortran_ieee_is_normal_10(X)
202 real(kind=10), intent(in) :: X
205 #ifdef HAVE_GFC_REAL_16
206 elemental logical function _gfortran_ieee_is_normal_16(X)
207 real(kind=16), intent(in) :: X
212 interface IEEE_IS_NORMAL
214 #ifdef HAVE_GFC_REAL_16
215 _gfortran_ieee_is_normal_16, &
217 #ifdef HAVE_GFC_REAL_10
218 _gfortran_ieee_is_normal_10, &
220 _gfortran_ieee_is_normal_8, _gfortran_ieee_is_normal_4
222 public :: IEEE_IS_NORMAL
226 #define COPYSIGN_MACRO(A,B) \
227 elemental real(kind = A) function \
228 _gfortran_ieee_copy_sign_/**/A/**/_/**/B (X,Y) ; \
229 real(kind = A), intent(in) :: X ; \
230 real(kind = B), intent(in) :: Y ; \
234 #ifdef HAVE_GFC_REAL_16
235 COPYSIGN_MACRO(16,16)
236 #ifdef HAVE_GFC_REAL_10
237 COPYSIGN_MACRO(16,10)
238 COPYSIGN_MACRO(10,16)
245 #ifdef HAVE_GFC_REAL_10
246 COPYSIGN_MACRO(10,10)
258 interface IEEE_COPY_SIGN
260 #ifdef HAVE_GFC_REAL_16
261 _gfortran_ieee_copy_sign_16_16, &
262 #ifdef HAVE_GFC_REAL_10
263 _gfortran_ieee_copy_sign_16_10, &
264 _gfortran_ieee_copy_sign_10_16, &
266 _gfortran_ieee_copy_sign_16_8, &
267 _gfortran_ieee_copy_sign_16_4, &
268 _gfortran_ieee_copy_sign_8_16, &
269 _gfortran_ieee_copy_sign_4_16, &
271 #ifdef HAVE_GFC_REAL_10
272 _gfortran_ieee_copy_sign_10_10, &
273 _gfortran_ieee_copy_sign_10_8, &
274 _gfortran_ieee_copy_sign_10_4, &
275 _gfortran_ieee_copy_sign_8_10, &
276 _gfortran_ieee_copy_sign_4_10, &
278 _gfortran_ieee_copy_sign_8_8, &
279 _gfortran_ieee_copy_sign_8_4, &
280 _gfortran_ieee_copy_sign_4_8, &
281 _gfortran_ieee_copy_sign_4_4
283 public :: IEEE_COPY_SIGN
287 #define UNORDERED_MACRO(A,B) \
288 elemental logical function \
289 _gfortran_ieee_unordered_/**/A/**/_/**/B (X,Y) ; \
290 real(kind = A), intent(in) :: X ; \
291 real(kind = B), intent(in) :: Y ; \
295 #ifdef HAVE_GFC_REAL_16
296 UNORDERED_MACRO(16,16)
297 #ifdef HAVE_GFC_REAL_10
298 UNORDERED_MACRO(16,10)
299 UNORDERED_MACRO(10,16)
301 UNORDERED_MACRO(16,8)
302 UNORDERED_MACRO(16,4)
303 UNORDERED_MACRO(8,16)
304 UNORDERED_MACRO(4,16)
306 #ifdef HAVE_GFC_REAL_10
307 UNORDERED_MACRO(10,10)
308 UNORDERED_MACRO(10,8)
309 UNORDERED_MACRO(10,4)
310 UNORDERED_MACRO(8,10)
311 UNORDERED_MACRO(4,10)
319 interface IEEE_UNORDERED
321 #ifdef HAVE_GFC_REAL_16
322 _gfortran_ieee_unordered_16_16, &
323 #ifdef HAVE_GFC_REAL_10
324 _gfortran_ieee_unordered_16_10, &
325 _gfortran_ieee_unordered_10_16, &
327 _gfortran_ieee_unordered_16_8, &
328 _gfortran_ieee_unordered_16_4, &
329 _gfortran_ieee_unordered_8_16, &
330 _gfortran_ieee_unordered_4_16, &
332 #ifdef HAVE_GFC_REAL_10
333 _gfortran_ieee_unordered_10_10, &
334 _gfortran_ieee_unordered_10_8, &
335 _gfortran_ieee_unordered_10_4, &
336 _gfortran_ieee_unordered_8_10, &
337 _gfortran_ieee_unordered_4_10, &
339 _gfortran_ieee_unordered_8_8, &
340 _gfortran_ieee_unordered_8_4, &
341 _gfortran_ieee_unordered_4_8, &
342 _gfortran_ieee_unordered_4_4
344 public :: IEEE_UNORDERED
349 elemental real(kind=4) function _gfortran_ieee_logb_4 (X)
350 real(kind=4), intent(in) :: X
352 elemental real(kind=8) function _gfortran_ieee_logb_8 (X)
353 real(kind=8), intent(in) :: X
355 #ifdef HAVE_GFC_REAL_10
356 elemental real(kind=10) function _gfortran_ieee_logb_10 (X)
357 real(kind=10), intent(in) :: X
360 #ifdef HAVE_GFC_REAL_16
361 elemental real(kind=16) function _gfortran_ieee_logb_16 (X)
362 real(kind=16), intent(in) :: X
369 #ifdef HAVE_GFC_REAL_16
370 _gfortran_ieee_logb_16, &
372 #ifdef HAVE_GFC_REAL_10
373 _gfortran_ieee_logb_10, &
375 _gfortran_ieee_logb_8, &
376 _gfortran_ieee_logb_4
382 #define NEXT_AFTER_MACRO(A,B) \
383 elemental real(kind = A) function \
384 _gfortran_ieee_next_after_/**/A/**/_/**/B (X,Y) ; \
385 real(kind = A), intent(in) :: X ; \
386 real(kind = B), intent(in) :: Y ; \
390 #ifdef HAVE_GFC_REAL_16
391 NEXT_AFTER_MACRO(16,16)
392 #ifdef HAVE_GFC_REAL_10
393 NEXT_AFTER_MACRO(16,10)
394 NEXT_AFTER_MACRO(10,16)
396 NEXT_AFTER_MACRO(16,8)
397 NEXT_AFTER_MACRO(16,4)
398 NEXT_AFTER_MACRO(8,16)
399 NEXT_AFTER_MACRO(4,16)
401 #ifdef HAVE_GFC_REAL_10
402 NEXT_AFTER_MACRO(10,10)
403 NEXT_AFTER_MACRO(10,8)
404 NEXT_AFTER_MACRO(10,4)
405 NEXT_AFTER_MACRO(8,10)
406 NEXT_AFTER_MACRO(4,10)
408 NEXT_AFTER_MACRO(8,8)
409 NEXT_AFTER_MACRO(8,4)
410 NEXT_AFTER_MACRO(4,8)
411 NEXT_AFTER_MACRO(4,4)
414 interface IEEE_NEXT_AFTER
416 #ifdef HAVE_GFC_REAL_16
417 _gfortran_ieee_next_after_16_16, &
418 #ifdef HAVE_GFC_REAL_10
419 _gfortran_ieee_next_after_16_10, &
420 _gfortran_ieee_next_after_10_16, &
422 _gfortran_ieee_next_after_16_8, &
423 _gfortran_ieee_next_after_16_4, &
424 _gfortran_ieee_next_after_8_16, &
425 _gfortran_ieee_next_after_4_16, &
427 #ifdef HAVE_GFC_REAL_10
428 _gfortran_ieee_next_after_10_10, &
429 _gfortran_ieee_next_after_10_8, &
430 _gfortran_ieee_next_after_10_4, &
431 _gfortran_ieee_next_after_8_10, &
432 _gfortran_ieee_next_after_4_10, &
434 _gfortran_ieee_next_after_8_8, &
435 _gfortran_ieee_next_after_8_4, &
436 _gfortran_ieee_next_after_4_8, &
437 _gfortran_ieee_next_after_4_4
439 public :: IEEE_NEXT_AFTER
443 #define REM_MACRO(RES,A,B) \
444 elemental real(kind = RES) function \
445 _gfortran_ieee_rem_/**/A/**/_/**/B (X,Y) ; \
446 real(kind = A), intent(in) :: X ; \
447 real(kind = B), intent(in) :: Y ; \
451 #ifdef HAVE_GFC_REAL_16
453 #ifdef HAVE_GFC_REAL_10
462 #ifdef HAVE_GFC_REAL_10
477 #ifdef HAVE_GFC_REAL_16
478 _gfortran_ieee_rem_16_16, &
479 #ifdef HAVE_GFC_REAL_10
480 _gfortran_ieee_rem_16_10, &
481 _gfortran_ieee_rem_10_16, &
483 _gfortran_ieee_rem_16_8, &
484 _gfortran_ieee_rem_16_4, &
485 _gfortran_ieee_rem_8_16, &
486 _gfortran_ieee_rem_4_16, &
488 #ifdef HAVE_GFC_REAL_10
489 _gfortran_ieee_rem_10_10, &
490 _gfortran_ieee_rem_10_8, &
491 _gfortran_ieee_rem_10_4, &
492 _gfortran_ieee_rem_8_10, &
493 _gfortran_ieee_rem_4_10, &
495 _gfortran_ieee_rem_8_8, &
496 _gfortran_ieee_rem_8_4, &
497 _gfortran_ieee_rem_4_8, &
498 _gfortran_ieee_rem_4_4
505 elemental real(kind=4) function _gfortran_ieee_rint_4 (X)
506 real(kind=4), intent(in) :: X
508 elemental real(kind=8) function _gfortran_ieee_rint_8 (X)
509 real(kind=8), intent(in) :: X
511 #ifdef HAVE_GFC_REAL_10
512 elemental real(kind=10) function _gfortran_ieee_rint_10 (X)
513 real(kind=10), intent(in) :: X
516 #ifdef HAVE_GFC_REAL_16
517 elemental real(kind=16) function _gfortran_ieee_rint_16 (X)
518 real(kind=16), intent(in) :: X
525 #ifdef HAVE_GFC_REAL_16
526 _gfortran_ieee_rint_16, &
528 #ifdef HAVE_GFC_REAL_10
529 _gfortran_ieee_rint_10, &
531 _gfortran_ieee_rint_8, _gfortran_ieee_rint_4
538 #ifdef HAVE_GFC_INTEGER_16
539 #ifdef HAVE_GFC_REAL_16
540 elemental real(kind=16) function _gfortran_ieee_scalb_16_16 (X, I)
541 real(kind=16), intent(in) :: X
542 integer(kind=16), intent(in) :: I
545 #ifdef HAVE_GFC_REAL_10
546 elemental real(kind=10) function _gfortran_ieee_scalb_10_16 (X, I)
547 real(kind=10), intent(in) :: X
548 integer(kind=16), intent(in) :: I
551 elemental real(kind=8) function _gfortran_ieee_scalb_8_16 (X, I)
552 real(kind=8), intent(in) :: X
553 integer(kind=16), intent(in) :: I
555 elemental real(kind=4) function _gfortran_ieee_scalb_4_16 (X, I)
556 real(kind=4), intent(in) :: X
557 integer(kind=16), intent(in) :: I
561 #ifdef HAVE_GFC_INTEGER_8
562 #ifdef HAVE_GFC_REAL_16
563 elemental real(kind=16) function _gfortran_ieee_scalb_16_8 (X, I)
564 real(kind=16), intent(in) :: X
565 integer(kind=8), intent(in) :: I
568 #ifdef HAVE_GFC_REAL_10
569 elemental real(kind=10) function _gfortran_ieee_scalb_10_8 (X, I)
570 real(kind=10), intent(in) :: X
571 integer(kind=8), intent(in) :: I
574 elemental real(kind=8) function _gfortran_ieee_scalb_8_8 (X, I)
575 real(kind=8), intent(in) :: X
576 integer(kind=8), intent(in) :: I
578 elemental real(kind=4) function _gfortran_ieee_scalb_4_8 (X, I)
579 real(kind=4), intent(in) :: X
580 integer(kind=8), intent(in) :: I
584 #ifdef HAVE_GFC_INTEGER_2
585 #ifdef HAVE_GFC_REAL_16
586 elemental real(kind=16) function _gfortran_ieee_scalb_16_2 (X, I)
587 real(kind=16), intent(in) :: X
588 integer(kind=2), intent(in) :: I
591 #ifdef HAVE_GFC_REAL_10
592 elemental real(kind=10) function _gfortran_ieee_scalb_10_2 (X, I)
593 real(kind=10), intent(in) :: X
594 integer(kind=2), intent(in) :: I
597 elemental real(kind=8) function _gfortran_ieee_scalb_8_2 (X, I)
598 real(kind=8), intent(in) :: X
599 integer(kind=2), intent(in) :: I
601 elemental real(kind=4) function _gfortran_ieee_scalb_4_2 (X, I)
602 real(kind=4), intent(in) :: X
603 integer(kind=2), intent(in) :: I
607 #ifdef HAVE_GFC_INTEGER_1
608 #ifdef HAVE_GFC_REAL_16
609 elemental real(kind=16) function _gfortran_ieee_scalb_16_1 (X, I)
610 real(kind=16), intent(in) :: X
611 integer(kind=1), intent(in) :: I
614 #ifdef HAVE_GFC_REAL_10
615 elemental real(kind=10) function _gfortran_ieee_scalb_10_1 (X, I)
616 real(kind=10), intent(in) :: X
617 integer(kind=1), intent(in) :: I
620 elemental real(kind=8) function _gfortran_ieee_scalb_8_1 (X, I)
621 real(kind=8), intent(in) :: X
622 integer(kind=1), intent(in) :: I
624 elemental real(kind=4) function _gfortran_ieee_scalb_4_1 (X, I)
625 real(kind=4), intent(in) :: X
626 integer(kind=1), intent(in) :: I
630 #ifdef HAVE_GFC_REAL_16
631 elemental real(kind=16) function _gfortran_ieee_scalb_16_4 (X, I)
632 real(kind=16), intent(in) :: X
633 integer, intent(in) :: I
636 #ifdef HAVE_GFC_REAL_10
637 elemental real(kind=10) function _gfortran_ieee_scalb_10_4 (X, I)
638 real(kind=10), intent(in) :: X
639 integer, intent(in) :: I
642 elemental real(kind=8) function _gfortran_ieee_scalb_8_4 (X, I)
643 real(kind=8), intent(in) :: X
644 integer, intent(in) :: I
646 elemental real(kind=4) function _gfortran_ieee_scalb_4_4 (X, I)
647 real(kind=4), intent(in) :: X
648 integer, intent(in) :: I
654 #ifdef HAVE_GFC_INTEGER_16
655 #ifdef HAVE_GFC_REAL_16
656 _gfortran_ieee_scalb_16_16, &
658 #ifdef HAVE_GFC_REAL_10
659 _gfortran_ieee_scalb_10_16, &
661 _gfortran_ieee_scalb_8_16, &
662 _gfortran_ieee_scalb_4_16, &
664 #ifdef HAVE_GFC_INTEGER_8
665 #ifdef HAVE_GFC_REAL_16
666 _gfortran_ieee_scalb_16_8, &
668 #ifdef HAVE_GFC_REAL_10
669 _gfortran_ieee_scalb_10_8, &
671 _gfortran_ieee_scalb_8_8, &
672 _gfortran_ieee_scalb_4_8, &
674 #ifdef HAVE_GFC_INTEGER_2
675 #ifdef HAVE_GFC_REAL_16
676 _gfortran_ieee_scalb_16_2, &
678 #ifdef HAVE_GFC_REAL_10
679 _gfortran_ieee_scalb_10_2, &
681 _gfortran_ieee_scalb_8_2, &
682 _gfortran_ieee_scalb_4_2, &
684 #ifdef HAVE_GFC_INTEGER_1
685 #ifdef HAVE_GFC_REAL_16
686 _gfortran_ieee_scalb_16_1, &
688 #ifdef HAVE_GFC_REAL_10
689 _gfortran_ieee_scalb_10_1, &
691 _gfortran_ieee_scalb_8_1, &
692 _gfortran_ieee_scalb_4_1, &
694 #ifdef HAVE_GFC_REAL_16
695 _gfortran_ieee_scalb_16_4, &
697 #ifdef HAVE_GFC_REAL_10
698 _gfortran_ieee_scalb_10_4, &
700 _gfortran_ieee_scalb_8_4, &
701 _gfortran_ieee_scalb_4_4
709 #ifdef HAVE_GFC_REAL_16
712 #ifdef HAVE_GFC_REAL_10
715 IEEE_VALUE_8, IEEE_VALUE_4
723 #ifdef HAVE_GFC_REAL_16
726 #ifdef HAVE_GFC_REAL_10
729 IEEE_CLASS_8, IEEE_CLASS_4
733 ! Public declarations for contained procedures
734 public :: IEEE_GET_ROUNDING_MODE, IEEE_SET_ROUNDING_MODE
735 public :: IEEE_GET_UNDERFLOW_MODE, IEEE_SET_UNDERFLOW_MODE
736 public :: IEEE_SELECTED_REAL_KIND
738 ! IEEE_SUPPORT_ROUNDING
740 interface IEEE_SUPPORT_ROUNDING
741 module procedure IEEE_SUPPORT_ROUNDING_4, IEEE_SUPPORT_ROUNDING_8, &
742 #ifdef HAVE_GFC_REAL_10
743 IEEE_SUPPORT_ROUNDING_10, &
745 #ifdef HAVE_GFC_REAL_16
746 IEEE_SUPPORT_ROUNDING_16, &
748 IEEE_SUPPORT_ROUNDING_NOARG
750 public :: IEEE_SUPPORT_ROUNDING
752 ! Interface to the FPU-specific function
754 pure integer function support_rounding_helper(flag) &
755 bind(c, name="_gfortrani_support_fpu_rounding_mode")
756 integer, intent(in), value :: flag
760 ! IEEE_SUPPORT_UNDERFLOW_CONTROL
762 interface IEEE_SUPPORT_UNDERFLOW_CONTROL
763 module procedure IEEE_SUPPORT_UNDERFLOW_CONTROL_4, &
764 IEEE_SUPPORT_UNDERFLOW_CONTROL_8, &
765 #ifdef HAVE_GFC_REAL_10
766 IEEE_SUPPORT_UNDERFLOW_CONTROL_10, &
768 #ifdef HAVE_GFC_REAL_16
769 IEEE_SUPPORT_UNDERFLOW_CONTROL_16, &
771 IEEE_SUPPORT_UNDERFLOW_CONTROL_NOARG
773 public :: IEEE_SUPPORT_UNDERFLOW_CONTROL
775 ! Interface to the FPU-specific function
777 pure integer function support_underflow_control_helper(kind) &
778 bind(c, name="_gfortrani_support_fpu_underflow_control")
779 integer, intent(in), value :: kind
783 ! IEEE_SUPPORT_* generic functions
785 #if defined(HAVE_GFC_REAL_10) && defined(HAVE_GFC_REAL_16)
786 # define MACRO1(NAME) NAME/**/_4, NAME/**/_8, NAME/**/_10, NAME/**/_16, NAME/**/_NOARG
787 #elif defined(HAVE_GFC_REAL_10)
788 # define MACRO1(NAME) NAME/**/_4, NAME/**/_8, NAME/**/_10, NAME/**/_NOARG
789 #elif defined(HAVE_GFC_REAL_16)
790 # define MACRO1(NAME) NAME/**/_4, NAME/**/_8, NAME/**/_16, NAME/**/_NOARG
792 # define MACRO1(NAME) NAME/**/_4, NAME/**/_8, NAME/**/_NOARG
795 #define SUPPORTGENERIC(NAME) \
796 interface NAME ; module procedure MACRO1(NAME) ; end interface ; \
799 SUPPORTGENERIC(IEEE_SUPPORT_DATATYPE)
800 SUPPORTGENERIC(IEEE_SUPPORT_DENORMAL)
801 SUPPORTGENERIC(IEEE_SUPPORT_SUBNORMAL)
802 SUPPORTGENERIC(IEEE_SUPPORT_DIVIDE)
803 SUPPORTGENERIC(IEEE_SUPPORT_INF)
804 SUPPORTGENERIC(IEEE_SUPPORT_IO)
805 SUPPORTGENERIC(IEEE_SUPPORT_NAN)
806 SUPPORTGENERIC(IEEE_SUPPORT_SQRT)
807 SUPPORTGENERIC(IEEE_SUPPORT_STANDARD)
811 ! Equality operators for IEEE_CLASS_TYPE and IEEE_ROUNDING_MODE
812 elemental logical function IEEE_CLASS_TYPE_EQ (X, Y) result(res)
814 type(IEEE_CLASS_TYPE), intent(in) :: X, Y
815 res = (X%hidden == Y%hidden)
818 elemental logical function IEEE_CLASS_TYPE_NE (X, Y) result(res)
820 type(IEEE_CLASS_TYPE), intent(in) :: X, Y
821 res = (X%hidden /= Y%hidden)
824 elemental logical function IEEE_ROUND_TYPE_EQ (X, Y) result(res)
826 type(IEEE_ROUND_TYPE), intent(in) :: X, Y
827 res = (X%hidden == Y%hidden)
830 elemental logical function IEEE_ROUND_TYPE_NE (X, Y) result(res)
832 type(IEEE_ROUND_TYPE), intent(in) :: X, Y
833 res = (X%hidden /= Y%hidden)
837 ! IEEE_SELECTED_REAL_KIND
839 integer function IEEE_SELECTED_REAL_KIND (P, R, RADIX) result(res)
841 integer, intent(in), optional :: P, R, RADIX
843 ! Currently, if IEEE is supported and this module is built, it means
844 ! all our floating-point types conform to IEEE. Hence, we simply call
845 ! SELECTED_REAL_KIND.
847 res = SELECTED_REAL_KIND (P, R, RADIX)
854 elemental function IEEE_CLASS_4 (X) result(res)
856 real(kind=4), intent(in) :: X
857 type(IEEE_CLASS_TYPE) :: res
860 pure integer function _gfortrani_ieee_class_helper_4(val)
861 real(kind=4), intent(in) :: val
865 res = IEEE_CLASS_TYPE(_gfortrani_ieee_class_helper_4(X))
868 elemental function IEEE_CLASS_8 (X) result(res)
870 real(kind=8), intent(in) :: X
871 type(IEEE_CLASS_TYPE) :: res
874 pure integer function _gfortrani_ieee_class_helper_8(val)
875 real(kind=8), intent(in) :: val
879 res = IEEE_CLASS_TYPE(_gfortrani_ieee_class_helper_8(X))
882 #ifdef HAVE_GFC_REAL_10
883 elemental function IEEE_CLASS_10 (X) result(res)
885 real(kind=10), intent(in) :: X
886 type(IEEE_CLASS_TYPE) :: res
889 pure integer function _gfortrani_ieee_class_helper_10(val)
890 real(kind=10), intent(in) :: val
894 res = IEEE_CLASS_TYPE(_gfortrani_ieee_class_helper_10(X))
898 #ifdef HAVE_GFC_REAL_16
899 elemental function IEEE_CLASS_16 (X) result(res)
901 real(kind=16), intent(in) :: X
902 type(IEEE_CLASS_TYPE) :: res
905 pure integer function _gfortrani_ieee_class_helper_16(val)
906 real(kind=16), intent(in) :: val
910 res = IEEE_CLASS_TYPE(_gfortrani_ieee_class_helper_16(X))
917 elemental real(kind=4) function IEEE_VALUE_4(X, CLASS) result(res)
919 real(kind=4), intent(in) :: X
920 type(IEEE_CLASS_TYPE), intent(in) :: CLASS
923 select case (CLASS%hidden)
924 case (1) ! IEEE_SIGNALING_NAN
925 if (ieee_support_halting(ieee_invalid)) then
926 call ieee_get_halting_mode(ieee_invalid, flag)
927 call ieee_set_halting_mode(ieee_invalid, .false.)
931 if (ieee_support_halting(ieee_invalid)) then
932 call ieee_set_halting_mode(ieee_invalid, flag)
934 case (2) ! IEEE_QUIET_NAN
935 if (ieee_support_halting(ieee_invalid)) then
936 call ieee_get_halting_mode(ieee_invalid, flag)
937 call ieee_set_halting_mode(ieee_invalid, .false.)
941 if (ieee_support_halting(ieee_invalid)) then
942 call ieee_set_halting_mode(ieee_invalid, flag)
944 case (3) ! IEEE_NEGATIVE_INF
945 if (ieee_support_halting(ieee_overflow)) then
946 call ieee_get_halting_mode(ieee_overflow, flag)
947 call ieee_set_halting_mode(ieee_overflow, .false.)
951 if (ieee_support_halting(ieee_overflow)) then
952 call ieee_set_halting_mode(ieee_overflow, flag)
954 case (4) ! IEEE_NEGATIVE_NORMAL
956 case (5) ! IEEE_NEGATIVE_DENORMAL
959 case (6) ! IEEE_NEGATIVE_ZERO
962 case (7) ! IEEE_POSITIVE_ZERO
964 case (8) ! IEEE_POSITIVE_DENORMAL
967 case (9) ! IEEE_POSITIVE_NORMAL
969 case (10) ! IEEE_POSITIVE_INF
970 if (ieee_support_halting(ieee_overflow)) then
971 call ieee_get_halting_mode(ieee_overflow, flag)
972 call ieee_set_halting_mode(ieee_overflow, .false.)
976 if (ieee_support_halting(ieee_overflow)) then
977 call ieee_set_halting_mode(ieee_overflow, flag)
979 case default ! IEEE_OTHER_VALUE, should not happen
984 elemental real(kind=8) function IEEE_VALUE_8(X, CLASS) result(res)
986 real(kind=8), intent(in) :: X
987 type(IEEE_CLASS_TYPE), intent(in) :: CLASS
990 select case (CLASS%hidden)
991 case (1) ! IEEE_SIGNALING_NAN
992 if (ieee_support_halting(ieee_invalid)) then
993 call ieee_get_halting_mode(ieee_invalid, flag)
994 call ieee_set_halting_mode(ieee_invalid, .false.)
998 if (ieee_support_halting(ieee_invalid)) then
999 call ieee_set_halting_mode(ieee_invalid, flag)
1001 case (2) ! IEEE_QUIET_NAN
1002 if (ieee_support_halting(ieee_invalid)) then
1003 call ieee_get_halting_mode(ieee_invalid, flag)
1004 call ieee_set_halting_mode(ieee_invalid, .false.)
1008 if (ieee_support_halting(ieee_invalid)) then
1009 call ieee_set_halting_mode(ieee_invalid, flag)
1011 case (3) ! IEEE_NEGATIVE_INF
1012 if (ieee_support_halting(ieee_overflow)) then
1013 call ieee_get_halting_mode(ieee_overflow, flag)
1014 call ieee_set_halting_mode(ieee_overflow, .false.)
1018 if (ieee_support_halting(ieee_overflow)) then
1019 call ieee_set_halting_mode(ieee_overflow, flag)
1021 case (4) ! IEEE_NEGATIVE_NORMAL
1023 case (5) ! IEEE_NEGATIVE_DENORMAL
1026 case (6) ! IEEE_NEGATIVE_ZERO
1029 case (7) ! IEEE_POSITIVE_ZERO
1031 case (8) ! IEEE_POSITIVE_DENORMAL
1034 case (9) ! IEEE_POSITIVE_NORMAL
1036 case (10) ! IEEE_POSITIVE_INF
1037 if (ieee_support_halting(ieee_overflow)) then
1038 call ieee_get_halting_mode(ieee_overflow, flag)
1039 call ieee_set_halting_mode(ieee_overflow, .false.)
1043 if (ieee_support_halting(ieee_overflow)) then
1044 call ieee_set_halting_mode(ieee_overflow, flag)
1046 case default ! IEEE_OTHER_VALUE, should not happen
1051 #ifdef HAVE_GFC_REAL_10
1052 elemental real(kind=10) function IEEE_VALUE_10(X, CLASS) result(res)
1054 real(kind=10), intent(in) :: X
1055 type(IEEE_CLASS_TYPE), intent(in) :: CLASS
1058 select case (CLASS%hidden)
1059 case (1) ! IEEE_SIGNALING_NAN
1060 if (ieee_support_halting(ieee_invalid)) then
1061 call ieee_get_halting_mode(ieee_invalid, flag)
1062 call ieee_set_halting_mode(ieee_invalid, .false.)
1066 if (ieee_support_halting(ieee_invalid)) then
1067 call ieee_set_halting_mode(ieee_invalid, flag)
1069 case (2) ! IEEE_QUIET_NAN
1070 if (ieee_support_halting(ieee_invalid)) then
1071 call ieee_get_halting_mode(ieee_invalid, flag)
1072 call ieee_set_halting_mode(ieee_invalid, .false.)
1076 if (ieee_support_halting(ieee_invalid)) then
1077 call ieee_set_halting_mode(ieee_invalid, flag)
1079 case (3) ! IEEE_NEGATIVE_INF
1080 if (ieee_support_halting(ieee_overflow)) then
1081 call ieee_get_halting_mode(ieee_overflow, flag)
1082 call ieee_set_halting_mode(ieee_overflow, .false.)
1086 if (ieee_support_halting(ieee_overflow)) then
1087 call ieee_set_halting_mode(ieee_overflow, flag)
1089 case (4) ! IEEE_NEGATIVE_NORMAL
1091 case (5) ! IEEE_NEGATIVE_DENORMAL
1094 case (6) ! IEEE_NEGATIVE_ZERO
1097 case (7) ! IEEE_POSITIVE_ZERO
1099 case (8) ! IEEE_POSITIVE_DENORMAL
1102 case (9) ! IEEE_POSITIVE_NORMAL
1104 case (10) ! IEEE_POSITIVE_INF
1105 if (ieee_support_halting(ieee_overflow)) then
1106 call ieee_get_halting_mode(ieee_overflow, flag)
1107 call ieee_set_halting_mode(ieee_overflow, .false.)
1111 if (ieee_support_halting(ieee_overflow)) then
1112 call ieee_set_halting_mode(ieee_overflow, flag)
1114 case default ! IEEE_OTHER_VALUE, should not happen
1121 #ifdef HAVE_GFC_REAL_16
1122 elemental real(kind=16) function IEEE_VALUE_16(X, CLASS) result(res)
1124 real(kind=16), intent(in) :: X
1125 type(IEEE_CLASS_TYPE), intent(in) :: CLASS
1128 select case (CLASS%hidden)
1129 case (1) ! IEEE_SIGNALING_NAN
1130 if (ieee_support_halting(ieee_invalid)) then
1131 call ieee_get_halting_mode(ieee_invalid, flag)
1132 call ieee_set_halting_mode(ieee_invalid, .false.)
1136 if (ieee_support_halting(ieee_invalid)) then
1137 call ieee_set_halting_mode(ieee_invalid, flag)
1139 case (2) ! IEEE_QUIET_NAN
1140 if (ieee_support_halting(ieee_invalid)) then
1141 call ieee_get_halting_mode(ieee_invalid, flag)
1142 call ieee_set_halting_mode(ieee_invalid, .false.)
1146 if (ieee_support_halting(ieee_invalid)) then
1147 call ieee_set_halting_mode(ieee_invalid, flag)
1149 case (3) ! IEEE_NEGATIVE_INF
1150 if (ieee_support_halting(ieee_overflow)) then
1151 call ieee_get_halting_mode(ieee_overflow, flag)
1152 call ieee_set_halting_mode(ieee_overflow, .false.)
1156 if (ieee_support_halting(ieee_overflow)) then
1157 call ieee_set_halting_mode(ieee_overflow, flag)
1159 case (4) ! IEEE_NEGATIVE_NORMAL
1161 case (5) ! IEEE_NEGATIVE_DENORMAL
1164 case (6) ! IEEE_NEGATIVE_ZERO
1167 case (7) ! IEEE_POSITIVE_ZERO
1169 case (8) ! IEEE_POSITIVE_DENORMAL
1172 case (9) ! IEEE_POSITIVE_NORMAL
1174 case (10) ! IEEE_POSITIVE_INF
1175 if (ieee_support_halting(ieee_overflow)) then
1176 call ieee_get_halting_mode(ieee_overflow, flag)
1177 call ieee_set_halting_mode(ieee_overflow, .false.)
1181 if (ieee_support_halting(ieee_overflow)) then
1182 call ieee_set_halting_mode(ieee_overflow, flag)
1184 case default ! IEEE_OTHER_VALUE, should not happen
1191 ! IEEE_GET_ROUNDING_MODE
1193 subroutine IEEE_GET_ROUNDING_MODE (ROUND_VALUE)
1195 type(IEEE_ROUND_TYPE), intent(out) :: ROUND_VALUE
1198 integer function helper() &
1199 bind(c, name="_gfortrani_get_fpu_rounding_mode")
1203 ROUND_VALUE = IEEE_ROUND_TYPE(helper())
1207 ! IEEE_SET_ROUNDING_MODE
1209 subroutine IEEE_SET_ROUNDING_MODE (ROUND_VALUE)
1211 type(IEEE_ROUND_TYPE), intent(in) :: ROUND_VALUE
1214 subroutine helper(val) &
1215 bind(c, name="_gfortrani_set_fpu_rounding_mode")
1216 integer, value :: val
1220 call helper(ROUND_VALUE%hidden)
1224 ! IEEE_GET_UNDERFLOW_MODE
1226 subroutine IEEE_GET_UNDERFLOW_MODE (GRADUAL)
1228 logical, intent(out) :: GRADUAL
1231 integer function helper() &
1232 bind(c, name="_gfortrani_get_fpu_underflow_mode")
1236 GRADUAL = (helper() /= 0)
1240 ! IEEE_SET_UNDERFLOW_MODE
1242 subroutine IEEE_SET_UNDERFLOW_MODE (GRADUAL)
1244 logical, intent(in) :: GRADUAL
1247 subroutine helper(val) &
1248 bind(c, name="_gfortrani_set_fpu_underflow_mode")
1249 integer, value :: val
1253 call helper(merge(1, 0, GRADUAL))
1256 ! IEEE_SUPPORT_ROUNDING
1258 pure logical function IEEE_SUPPORT_ROUNDING_4 (ROUND_VALUE, X) result(res)
1260 real(kind=4), intent(in) :: X
1261 type(IEEE_ROUND_TYPE), intent(in) :: ROUND_VALUE
1262 res = (support_rounding_helper(ROUND_VALUE%hidden) /= 0)
1265 pure logical function IEEE_SUPPORT_ROUNDING_8 (ROUND_VALUE, X) result(res)
1267 real(kind=8), intent(in) :: X
1268 type(IEEE_ROUND_TYPE), intent(in) :: ROUND_VALUE
1269 res = (support_rounding_helper(ROUND_VALUE%hidden) /= 0)
1272 #ifdef HAVE_GFC_REAL_10
1273 pure logical function IEEE_SUPPORT_ROUNDING_10 (ROUND_VALUE, X) result(res)
1275 real(kind=10), intent(in) :: X
1276 type(IEEE_ROUND_TYPE), intent(in) :: ROUND_VALUE
1277 res = (support_rounding_helper(ROUND_VALUE%hidden) /= 0)
1281 #ifdef HAVE_GFC_REAL_16
1282 pure logical function IEEE_SUPPORT_ROUNDING_16 (ROUND_VALUE, X) result(res)
1284 real(kind=16), intent(in) :: X
1285 type(IEEE_ROUND_TYPE), intent(in) :: ROUND_VALUE
1286 res = (support_rounding_helper(ROUND_VALUE%hidden) /= 0)
1290 pure logical function IEEE_SUPPORT_ROUNDING_NOARG (ROUND_VALUE) result(res)
1292 type(IEEE_ROUND_TYPE), intent(in) :: ROUND_VALUE
1293 res = (support_rounding_helper(ROUND_VALUE%hidden) /= 0)
1296 ! IEEE_SUPPORT_UNDERFLOW_CONTROL
1298 pure logical function IEEE_SUPPORT_UNDERFLOW_CONTROL_4 (X) result(res)
1300 real(kind=4), intent(in) :: X
1301 res = (support_underflow_control_helper(4) /= 0)
1304 pure logical function IEEE_SUPPORT_UNDERFLOW_CONTROL_8 (X) result(res)
1306 real(kind=8), intent(in) :: X
1307 res = (support_underflow_control_helper(8) /= 0)
1310 #ifdef HAVE_GFC_REAL_10
1311 pure logical function IEEE_SUPPORT_UNDERFLOW_CONTROL_10 (X) result(res)
1313 real(kind=10), intent(in) :: X
1314 res = (support_underflow_control_helper(10) /= 0)
1318 #ifdef HAVE_GFC_REAL_16
1319 pure logical function IEEE_SUPPORT_UNDERFLOW_CONTROL_16 (X) result(res)
1321 real(kind=16), intent(in) :: X
1322 res = (support_underflow_control_helper(16) /= 0)
1326 pure logical function IEEE_SUPPORT_UNDERFLOW_CONTROL_NOARG () result(res)
1328 res = (support_underflow_control_helper(4) /= 0 &
1329 .and. support_underflow_control_helper(8) /= 0 &
1330 #ifdef HAVE_GFC_REAL_10
1331 .and. support_underflow_control_helper(10) /= 0 &
1333 #ifdef HAVE_GFC_REAL_16
1334 .and. support_underflow_control_helper(16) /= 0 &
1339 ! IEEE_SUPPORT_* functions
1341 #define SUPPORTMACRO(NAME, INTKIND, VALUE) \
1342 pure logical function NAME/**/_/**/INTKIND (X) result(res) ; \
1344 real(INTKIND), intent(in) :: X(..) ; \
1348 #define SUPPORTMACRO_NOARG(NAME, VALUE) \
1349 pure logical function NAME/**/_NOARG () result(res) ; \
1354 ! IEEE_SUPPORT_DATATYPE
1356 SUPPORTMACRO(IEEE_SUPPORT_DATATYPE,4,.true.)
1357 SUPPORTMACRO(IEEE_SUPPORT_DATATYPE,8,.true.)
1358 #ifdef HAVE_GFC_REAL_10
1359 SUPPORTMACRO(IEEE_SUPPORT_DATATYPE,10,.true.)
1361 #ifdef HAVE_GFC_REAL_16
1362 SUPPORTMACRO(IEEE_SUPPORT_DATATYPE,16,.true.)
1364 SUPPORTMACRO_NOARG(IEEE_SUPPORT_DATATYPE,.true.)
1366 ! IEEE_SUPPORT_DENORMAL and IEEE_SUPPORT_SUBNORMAL
1368 SUPPORTMACRO(IEEE_SUPPORT_DENORMAL,4,.true.)
1369 SUPPORTMACRO(IEEE_SUPPORT_DENORMAL,8,.true.)
1370 #ifdef HAVE_GFC_REAL_10
1371 SUPPORTMACRO(IEEE_SUPPORT_DENORMAL,10,.true.)
1373 #ifdef HAVE_GFC_REAL_16
1374 SUPPORTMACRO(IEEE_SUPPORT_DENORMAL,16,.true.)
1376 SUPPORTMACRO_NOARG(IEEE_SUPPORT_DENORMAL,.true.)
1378 SUPPORTMACRO(IEEE_SUPPORT_SUBNORMAL,4,.true.)
1379 SUPPORTMACRO(IEEE_SUPPORT_SUBNORMAL,8,.true.)
1380 #ifdef HAVE_GFC_REAL_10
1381 SUPPORTMACRO(IEEE_SUPPORT_SUBNORMAL,10,.true.)
1383 #ifdef HAVE_GFC_REAL_16
1384 SUPPORTMACRO(IEEE_SUPPORT_SUBNORMAL,16,.true.)
1386 SUPPORTMACRO_NOARG(IEEE_SUPPORT_SUBNORMAL,.true.)
1388 ! IEEE_SUPPORT_DIVIDE
1390 SUPPORTMACRO(IEEE_SUPPORT_DIVIDE,4,.true.)
1391 SUPPORTMACRO(IEEE_SUPPORT_DIVIDE,8,.true.)
1392 #ifdef HAVE_GFC_REAL_10
1393 SUPPORTMACRO(IEEE_SUPPORT_DIVIDE,10,.true.)
1395 #ifdef HAVE_GFC_REAL_16
1396 SUPPORTMACRO(IEEE_SUPPORT_DIVIDE,16,.true.)
1398 SUPPORTMACRO_NOARG(IEEE_SUPPORT_DIVIDE,.true.)
1402 SUPPORTMACRO(IEEE_SUPPORT_INF,4,.true.)
1403 SUPPORTMACRO(IEEE_SUPPORT_INF,8,.true.)
1404 #ifdef HAVE_GFC_REAL_10
1405 SUPPORTMACRO(IEEE_SUPPORT_INF,10,.true.)
1407 #ifdef HAVE_GFC_REAL_16
1408 SUPPORTMACRO(IEEE_SUPPORT_INF,16,.true.)
1410 SUPPORTMACRO_NOARG(IEEE_SUPPORT_INF,.true.)
1414 SUPPORTMACRO(IEEE_SUPPORT_IO,4,.true.)
1415 SUPPORTMACRO(IEEE_SUPPORT_IO,8,.true.)
1416 #ifdef HAVE_GFC_REAL_10
1417 SUPPORTMACRO(IEEE_SUPPORT_IO,10,.true.)
1419 #ifdef HAVE_GFC_REAL_16
1420 SUPPORTMACRO(IEEE_SUPPORT_IO,16,.true.)
1422 SUPPORTMACRO_NOARG(IEEE_SUPPORT_IO,.true.)
1426 SUPPORTMACRO(IEEE_SUPPORT_NAN,4,.true.)
1427 SUPPORTMACRO(IEEE_SUPPORT_NAN,8,.true.)
1428 #ifdef HAVE_GFC_REAL_10
1429 SUPPORTMACRO(IEEE_SUPPORT_NAN,10,.true.)
1431 #ifdef HAVE_GFC_REAL_16
1432 SUPPORTMACRO(IEEE_SUPPORT_NAN,16,.true.)
1434 SUPPORTMACRO_NOARG(IEEE_SUPPORT_NAN,.true.)
1438 SUPPORTMACRO(IEEE_SUPPORT_SQRT,4,.true.)
1439 SUPPORTMACRO(IEEE_SUPPORT_SQRT,8,.true.)
1440 #ifdef HAVE_GFC_REAL_10
1441 SUPPORTMACRO(IEEE_SUPPORT_SQRT,10,.true.)
1443 #ifdef HAVE_GFC_REAL_16
1444 SUPPORTMACRO(IEEE_SUPPORT_SQRT,16,.true.)
1446 SUPPORTMACRO_NOARG(IEEE_SUPPORT_SQRT,.true.)
1448 ! IEEE_SUPPORT_STANDARD
1450 SUPPORTMACRO(IEEE_SUPPORT_STANDARD,4,.true.)
1451 SUPPORTMACRO(IEEE_SUPPORT_STANDARD,8,.true.)
1452 #ifdef HAVE_GFC_REAL_10
1453 SUPPORTMACRO(IEEE_SUPPORT_STANDARD,10,.true.)
1455 #ifdef HAVE_GFC_REAL_16
1456 SUPPORTMACRO(IEEE_SUPPORT_STANDARD,16,.true.)
1458 SUPPORTMACRO_NOARG(IEEE_SUPPORT_STANDARD,.true.)
1460 end module IEEE_ARITHMETIC