annotate flang/module/ieee_arithmetic.f90 @ 240:ca573705d418

merge
author matac
date Fri, 28 Jul 2023 20:50:09 +0900
parents c4bab56944e8
children 1f2b6ac9f198
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
173
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1 !===-- module/ieee_arithmetic.f90 ------------------------------------------===!
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
2 !
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
3 ! Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
4 ! See https://llvm.org/LICENSE.txt for license information.
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
5 ! SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
6 !
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
7 !===------------------------------------------------------------------------===!
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
8
236
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
9 ! Fortran 2018 Clause 17
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
10
173
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
11 module ieee_arithmetic
236
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
12 ! 17.1: "The module IEEE_ARITHMETIC behaves as if it contained a
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
13 ! USE statement for IEEE_EXCEPTIONS; everything that is public in
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
14 ! IEEE_EXCEPTIONS is public in IEEE_ARITHMETIC."
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
15 use __Fortran_ieee_exceptions
173
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
16
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
17 use __Fortran_builtins, only: &
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
18 ieee_is_nan => __builtin_ieee_is_nan, &
236
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
19 ieee_is_negative => __builtin_ieee_is_negative, &
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
20 ieee_is_normal => __builtin_ieee_is_normal, &
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
21 ieee_next_after => __builtin_ieee_next_after, &
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
22 ieee_next_down => __builtin_ieee_next_down, &
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
23 ieee_next_up => __builtin_ieee_next_up, &
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
24 ieee_scalb => scale, &
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
25 ieee_selected_real_kind => __builtin_ieee_selected_real_kind, &
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
26 ieee_support_datatype => __builtin_ieee_support_datatype, &
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
27 ieee_support_denormal => __builtin_ieee_support_denormal, &
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
28 ieee_support_divide => __builtin_ieee_support_divide, &
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
29 ieee_support_inf => __builtin_ieee_support_inf, &
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
30 ieee_support_io => __builtin_ieee_support_io, &
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
31 ieee_support_nan => __builtin_ieee_support_nan, &
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
32 ieee_support_sqrt => __builtin_ieee_support_sqrt, &
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
33 ieee_support_standard => __builtin_ieee_support_standard, &
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
34 ieee_support_subnormal => __builtin_ieee_support_subnormal, &
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
35 ieee_support_underflow_control => __builtin_ieee_support_underflow_control
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
36
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
37 implicit none
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
38
173
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
39 type :: ieee_class_type
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
40 private
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
41 integer(kind=1) :: which = 0
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
42 end type ieee_class_type
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
43
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
44 type(ieee_class_type), parameter :: &
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
45 ieee_signaling_nan = ieee_class_type(1), &
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
46 ieee_quiet_nan = ieee_class_type(2), &
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
47 ieee_negative_inf = ieee_class_type(3), &
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
48 ieee_negative_normal = ieee_class_type(4), &
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
49 ieee_negative_denormal = ieee_class_type(5), &
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
50 ieee_negative_zero = ieee_class_type(6), &
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
51 ieee_positive_zero = ieee_class_type(7), &
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
52 ieee_positive_subnormal = ieee_class_type(8), &
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
53 ieee_positive_normal = ieee_class_type(9), &
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
54 ieee_positive_inf = ieee_class_type(10), &
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
55 ieee_other_value = ieee_class_type(11)
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
56
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
57 type(ieee_class_type), parameter :: &
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
58 ieee_negative_subnormal = ieee_negative_denormal, &
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
59 ieee_positive_denormal = ieee_negative_subnormal
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
60
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
61 type :: ieee_round_type
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
62 private
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
63 integer(kind=1) :: mode = 0
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
64 end type ieee_round_type
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
65
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
66 type(ieee_round_type), parameter :: &
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
67 ieee_nearest = ieee_round_type(1), &
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
68 ieee_to_zero = ieee_round_type(2), &
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
69 ieee_up = ieee_round_type(3), &
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
70 ieee_down = ieee_round_type(4), &
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
71 ieee_away = ieee_round_type(5), &
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
72 ieee_other = ieee_round_type(6)
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
73
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
74 interface operator(==)
236
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
75 elemental logical function ieee_class_eq(x, y)
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
76 import ieee_class_type
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
77 type(ieee_class_type), intent(in) :: x, y
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
78 end function ieee_class_eq
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
79 elemental logical function ieee_round_eq(x, y)
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
80 import ieee_round_type
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
81 type(ieee_round_type), intent(in) :: x, y
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
82 end function ieee_round_eq
173
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
83 end interface operator(==)
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
84 interface operator(/=)
236
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
85 elemental logical function ieee_class_ne(x, y)
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
86 import ieee_class_type
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
87 type(ieee_class_type), intent(in) :: x, y
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
88 end function ieee_class_ne
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
89 elemental logical function ieee_round_ne(x, y)
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
90 import ieee_round_type
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
91 type(ieee_round_type), intent(in) :: x, y
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
92 end function ieee_round_ne
173
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
93 end interface operator(/=)
236
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
94 private :: ieee_class_eq, ieee_round_eq, ieee_class_ne, ieee_round_ne
173
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
95
236
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
96 ! Define specifics with 1 or 2 INTEGER, LOGICAL, or REAL arguments for
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
97 ! generic G.
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
98 #define SPECIFICS_I(G) \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
99 G(1) G(2) G(4) G(8) G(16)
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
100 #define SPECIFICS_L(G) \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
101 G(1) G(2) G(4) G(8)
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
102 #if __x86_64__
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
103 #define SPECIFICS_R(G) \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
104 G(2) G(3) G(4) G(8) G(10) G(16)
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
105 #else
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
106 #define SPECIFICS_R(G) \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
107 G(2) G(3) G(4) G(8) G(16)
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
108 #endif
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
109 #define SPECIFICS_II(G) \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
110 G(1,1) G(1,2) G(1,4) G(1,8) G(1,16) \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
111 G(2,1) G(2,2) G(2,4) G(2,8) G(2,16) \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
112 G(4,1) G(4,2) G(4,4) G(4,8) G(4,16) \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
113 G(8,1) G(8,2) G(8,4) G(8,8) G(8,16) \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
114 G(16,1) G(16,2) G(16,4) G(16,8) G(16,16)
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
115 #if __x86_64__
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
116 #define SPECIFICS_RI(G) \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
117 G(2,1) G(2,2) G(2,4) G(2,8) G(2,16) \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
118 G(3,1) G(3,2) G(3,4) G(3,8) G(3,16) \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
119 G(4,1) G(4,2) G(4,4) G(4,8) G(4,16) \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
120 G(8,1) G(8,2) G(8,4) G(8,8) G(8,16) \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
121 G(10,1) G(10,2) G(10,4) G(10,8) G(10,16) \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
122 G(16,1) G(16,2) G(16,4) G(16,8) G(16,16)
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
123 #else
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
124 #define SPECIFICS_RI(G) \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
125 G(2,1) G(2,2) G(2,4) G(2,8) G(2,16) \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
126 G(3,1) G(3,2) G(3,4) G(3,8) G(3,16) \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
127 G(4,1) G(4,2) G(4,4) G(4,8) G(4,16) \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
128 G(8,1) G(8,2) G(8,4) G(8,8) G(8,16) \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
129 G(16,1) G(16,2) G(16,4) G(16,8) G(16,16)
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
130 #endif
173
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
131
236
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
132 #if __x86_64__
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
133 #define SPECIFICS_RR(G) \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
134 G(2,2) G(2,3) G(2,4) G(2,8) G(2,10) G(2,16) \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
135 G(3,2) G(3,3) G(3,4) G(3,8) G(3,10) G(3,16) \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
136 G(4,2) G(4,3) G(4,4) G(4,8) G(4,10) G(4,16) \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
137 G(8,2) G(8,3) G(8,4) G(8,8) G(8,10) G(8,16) \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
138 G(10,2) G(10,3) G(10,4) G(10,8) G(10,10) G(10,16) \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
139 G(16,2) G(16,3) G(16,4) G(16,8) G(16,10) G(16,16)
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
140 #else
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
141 #define SPECIFICS_RR(G) \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
142 G(2,2) G(2,3) G(2,4) G(2,8) G(2,16) \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
143 G(3,2) G(3,3) G(3,4) G(3,8) G(3,16) \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
144 G(4,2) G(4,3) G(4,4) G(4,8) G(4,16) \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
145 G(8,2) G(8,3) G(8,4) G(8,8) G(8,16) \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
146 G(16,2) G(16,3) G(16,4) G(16,8) G(16,16)
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
147 #endif
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
148
236
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
149 ! Set PRIVATE accessibility for specifics with 1 or 2 INTEGER, LOGICAL, or REAL
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
150 ! arguments for generic G.
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
151 #define PRIVATE_I(G) private :: \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
152 G##_i1, G##_i2, G##_i4, G##_i8, G##_i16
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
153 #define PRIVATE_L(G) private :: \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
154 G##_l1, G##_l2, G##_l4, G##_l8
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
155 #if __x86_64__
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
156 #define PRIVATE_R(G) private :: \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
157 G##_a2, G##_a3, G##_a4, G##_a8, G##_a10, G##_a16
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
158 #else
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
159 #define PRIVATE_R(G) private :: \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
160 G##_a2, G##_a3, G##_a4, G##_a8, G##_a16
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
161 #endif
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
162 #define PRIVATE_II(G) private :: \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
163 G##_i1_i1, G##_i1_i2, G##_i1_i4, G##_i1_i8, G##_i1_i16, \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
164 G##_i2_i1, G##_i2_i2, G##_i2_i4, G##_i2_i8, G##_i2_i16, \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
165 G##_i4_i1, G##_i4_i2, G##_i4_i4, G##_i4_i8, G##_i4_i16, \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
166 G##_i8_i1, G##_i8_i2, G##_i8_i4, G##_i8_i8, G##_i8_i16, \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
167 G##_i16_i1, G##_i16_i2, G##_i16_i4, G##_i16_i8, G##_i16_i16
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
168 #if __x86_64__
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
169 #define PRIVATE_RI(G) private :: \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
170 G##_a2_i1, G##_a2_i2, G##_a2_i4, G##_a2_i8, G##_a2_i16, \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
171 G##_a3_i1, G##_a3_i2, G##_a3_i4, G##_a3_i8, G##_a3_i16, \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
172 G##_a4_i1, G##_a4_i2, G##_a4_i4, G##_a4_i8, G##_a4_i16, \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
173 G##_a8_i1, G##_a8_i2, G##_a8_i4, G##_a8_i8, G##_a8_i16, \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
174 G##_a10_i1, G##_a10_i2, G##_a10_i4, G##_a10_i8, G##_a10_i16, \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
175 G##_a16_i1, G##_a16_i2, G##_a16_i4, G##_a16_i8, G##_a16_i16
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
176 #else
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
177 #define PRIVATE_RI(G) private :: \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
178 G##_a2_i1, G##_a2_i2, G##_a2_i4, G##_a2_i8, G##_a2_i16, \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
179 G##_a3_i1, G##_a3_i2, G##_a3_i4, G##_a3_i8, G##_a3_i16, \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
180 G##_a4_i1, G##_a4_i2, G##_a4_i4, G##_a4_i8, G##_a4_i16, \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
181 G##_a8_i1, G##_a8_i2, G##_a8_i4, G##_a8_i8, G##_a8_i16, \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
182 G##_a16_i1, G##_a16_i2, G##_a16_i4, G##_a16_i8, G##_a16_i16
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
183 #endif
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
184 #if __x86_64__
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
185 #define PRIVATE_RR(G) private :: \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
186 G##_a2_a2, G##_a2_a3, G##_a2_a4, G##_a2_a8, G##_a2_a10, G##_a2_a16, \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
187 G##_a3_a2, G##_a3_a3, G##_a3_a4, G##_a3_a8, G##_a3_a10, G##_a3_a16, \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
188 G##_a4_a2, G##_a4_a3, G##_a4_a4, G##_a4_a8, G##_a4_a10, G##_a4_a16, \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
189 G##_a8_a2, G##_a8_a3, G##_a8_a4, G##_a8_a8, G##_a8_a10, G##_a8_a16, \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
190 G##_a10_a2, G##_a10_a3, G##_a10_a4, G##_a10_a8, G##_a10_a10, G##_a10_a16, \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
191 G##_a16_a2, G##_a16_a3, G##_a16_a4, G##_a16_a8, G##_a16_a10, G##_a16_a16
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
192 #else
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
193 #define PRIVATE_RR(G) private :: \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
194 G##_a2_a2, G##_a2_a3, G##_a2_a4, G##_a2_a8, G##_a2_a16, \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
195 G##_a3_a2, G##_a3_a3, G##_a3_a4, G##_a3_a8, G##_a3_a16, \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
196 G##_a4_a2, G##_a4_a3, G##_a4_a4, G##_a4_a8, G##_a4_a16, \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
197 G##_a8_a2, G##_a8_a3, G##_a8_a4, G##_a8_a8, G##_a8_a16, \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
198 G##_a16_a2, G##_a16_a3, G##_a16_a4, G##_a16_a8, G##_a16_a16
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
199 #endif
173
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
200
236
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
201 #define IEEE_CLASS_R(XKIND) \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
202 elemental type(ieee_class_type) function ieee_class_a##XKIND(x); \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
203 import ieee_class_type; \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
204 real(XKIND), intent(in) :: x; \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
205 end function ieee_class_a##XKIND;
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
206 interface ieee_class
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
207 SPECIFICS_R(IEEE_CLASS_R)
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
208 end interface ieee_class
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
209 PRIVATE_R(IEEE_CLASS)
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
210 #undef IEEE_CLASS_R
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
211
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
212 #define IEEE_COPY_SIGN_RR(XKIND, YKIND) \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
213 elemental real(XKIND) function ieee_copy_sign_a##XKIND##_a##YKIND(x, y); \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
214 real(XKIND), intent(in) :: x; \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
215 real(YKIND), intent(in) :: y; \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
216 end function ieee_copy_sign_a##XKIND##_a##YKIND;
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
217 interface ieee_copy_sign
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
218 SPECIFICS_RR(IEEE_COPY_SIGN_RR)
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
219 end interface ieee_copy_sign
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
220 PRIVATE_RR(IEEE_COPY_SIGN)
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
221 #undef IEEE_COPY_SIGN_RR
173
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
222
236
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
223 #define IEEE_FMA_R(AKIND) \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
224 elemental real(AKIND) function ieee_fma_a##AKIND(a, b, c); \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
225 real(AKIND), intent(in) :: a, b, c; \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
226 end function ieee_fma_a##AKIND;
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
227 interface ieee_fma
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
228 SPECIFICS_R(IEEE_FMA_R)
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
229 end interface ieee_fma
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
230 PRIVATE_R(IEEE_FMA)
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
231 #undef IEEE_FMA_R
173
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
232
236
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
233 #define IEEE_GET_ROUNDING_MODE_I(RKIND) \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
234 subroutine ieee_get_rounding_mode_i##RKIND(round_value, radix); \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
235 import ieee_round_type; \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
236 type(ieee_round_type), intent(out) :: round_value; \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
237 integer(RKIND), intent(in) :: radix; \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
238 end subroutine ieee_get_rounding_mode_i##RKIND;
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
239 interface ieee_get_rounding_mode
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
240 subroutine ieee_get_rounding_mode_0(round_value)
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
241 import ieee_round_type
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
242 type(ieee_round_type), intent(out) :: round_value
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
243 end subroutine ieee_get_rounding_mode_0
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
244 SPECIFICS_I(IEEE_GET_ROUNDING_MODE_I)
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
245 end interface ieee_get_rounding_mode
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
246 PRIVATE_I(IEEE_GET_ROUNDING_MODE)
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
247 #undef IEEE_GET_ROUNDING_MODE_I
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
248
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
249 #define IEEE_GET_UNDERFLOW_MODE_L(GKIND) \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
250 subroutine ieee_get_underflow_mode_l##GKIND(gradual); \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
251 logical(GKIND), intent(out) :: gradual; \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
252 end subroutine ieee_get_underflow_mode_l##GKIND;
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
253 interface ieee_get_underflow_mode
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
254 SPECIFICS_L(IEEE_GET_UNDERFLOW_MODE_L)
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
255 end interface ieee_get_underflow_mode
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
256 PRIVATE_L(IEEE_GET_UNDERFLOW_MODE)
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
257 #undef IEEE_GET_UNDERFLOW_MODE_L
173
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
258
236
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
259 ! When kind argument is present, kind(result) is value(kind), not kind(kind).
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
260 ! That is not known here, so return integer(16).
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
261 #define IEEE_INT_R(AKIND) \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
262 elemental integer function ieee_int_a##AKIND(a, round); \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
263 import ieee_round_type; \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
264 real(AKIND), intent(in) :: a; \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
265 type(ieee_round_type), intent(in) :: round; \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
266 end function ieee_int_a##AKIND;
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
267 #define IEEE_INT_RI(AKIND, KKIND) \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
268 elemental integer(16) function ieee_int_a##AKIND##_i##KKIND(a, round, kind); \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
269 import ieee_round_type; \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
270 real(AKIND), intent(in) :: a; \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
271 type(ieee_round_type), intent(in) :: round; \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
272 integer(KKIND), intent(in) :: kind; \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
273 end function ieee_int_a##AKIND##_i##KKIND;
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
274 interface ieee_int
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
275 SPECIFICS_R(IEEE_INT_R)
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
276 SPECIFICS_RI(IEEE_INT_RI)
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
277 end interface ieee_int
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
278 PRIVATE_R(IEEE_INT)
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
279 PRIVATE_RI(IEEE_INT)
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
280 #undef IEEE_INT_R
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
281 #undef IEEE_INT_RI
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
282
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
283 #define IEEE_IS_FINITE_R(XKIND) \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
284 elemental logical function ieee_is_finite_a##XKIND(x); \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
285 real(XKIND), intent(in) :: x; \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
286 end function ieee_is_finite_a##XKIND;
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
287 interface ieee_is_finite
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
288 SPECIFICS_R(IEEE_IS_FINITE_R)
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
289 end interface ieee_is_finite
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
290 PRIVATE_R(IEEE_IS_FINITE)
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
291 #undef IEEE_IS_FINITE_R
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
292
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
293 #define IEEE_LOGB_R(XKIND) \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
294 elemental real(XKIND) function ieee_logb_a##XKIND(x); \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
295 real(XKIND), intent(in) :: x; \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
296 end function ieee_logb_a##XKIND;
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
297 interface ieee_logb
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
298 SPECIFICS_R(IEEE_LOGB_R)
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
299 end interface ieee_logb
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
300 PRIVATE_R(IEEE_LOGB)
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
301 #undef IEEE_LOGB_R
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
302
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
303 #define IEEE_MAX_NUM_R(XKIND) \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
304 elemental real(XKIND) function ieee_max_num_a##XKIND(x, y); \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
305 real(XKIND), intent(in) :: x, y; \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
306 end function ieee_max_num_a##XKIND;
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
307 interface ieee_max_num
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
308 SPECIFICS_R(IEEE_MAX_NUM_R)
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
309 end interface ieee_max_num
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
310 PRIVATE_R(IEEE_MAX_NUM)
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
311 #undef IEEE_MAX_NUM_R
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
312
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
313 #define IEEE_MAX_NUM_MAG_R(XKIND) \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
314 elemental real(XKIND) function ieee_max_num_mag_a##XKIND(x, y); \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
315 real(XKIND), intent(in) :: x, y; \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
316 end function ieee_max_num_mag_a##XKIND;
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
317 interface ieee_max_num_mag
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
318 SPECIFICS_R(IEEE_MAX_NUM_MAG_R)
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
319 end interface ieee_max_num_mag
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
320 PRIVATE_R(IEEE_MAX_NUM_MAG)
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
321 #undef IEEE_MAX_NUM_MAG_R
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
322
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
323 #define IEEE_MIN_NUM_R(XKIND) \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
324 elemental real(XKIND) function ieee_min_num_a##XKIND(x, y); \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
325 real(XKIND), intent(in) :: x, y; \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
326 end function ieee_min_num_a##XKIND;
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
327 interface ieee_min_num
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
328 SPECIFICS_R(IEEE_MIN_NUM_R)
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
329 end interface ieee_min_num
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
330 PRIVATE_R(IEEE_MIN_NUM)
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
331 #undef IEEE_MIN_NUM_R
173
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
332
236
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
333 #define IEEE_MIN_NUM_MAG_R(XKIND) \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
334 elemental real(XKIND) function ieee_min_num_mag_a##XKIND(x, y); \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
335 real(XKIND), intent(in) :: x, y; \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
336 end function ieee_min_num_mag_a##XKIND;
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
337 interface ieee_min_num_mag
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
338 SPECIFICS_R(IEEE_MIN_NUM_MAG_R)
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
339 end interface ieee_min_num_mag
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
340 PRIVATE_R(IEEE_MIN_NUM_MAG)
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
341 #undef IEEE_MIN_NUM_MAG_R
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
342
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
343 #define IEEE_QUIET_EQ_R(AKIND) \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
344 elemental logical function ieee_quiet_eq_a##AKIND(a, b); \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
345 real(AKIND), intent(in) :: a, b; \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
346 end function ieee_quiet_eq_a##AKIND;
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
347 interface ieee_quiet_eq
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
348 SPECIFICS_R(IEEE_QUIET_EQ_R)
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
349 end interface ieee_quiet_eq
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
350 PRIVATE_R(IEEE_QUIET_EQ)
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
351 #undef IEEE_QUIET_EQ_R
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
352
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
353 #define IEEE_QUIET_GE_R(AKIND) \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
354 elemental logical function ieee_quiet_ge_a##AKIND(a, b); \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
355 real(AKIND), intent(in) :: a, b; \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
356 end function ieee_quiet_ge_a##AKIND;
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
357 interface ieee_quiet_ge
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
358 SPECIFICS_R(IEEE_QUIET_GE_R)
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
359 end interface ieee_quiet_ge
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
360 PRIVATE_R(IEEE_QUIET_GE)
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
361 #undef IEEE_QUIET_GE_R
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
362
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
363 #define IEEE_QUIET_GT_R(AKIND) \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
364 elemental logical function ieee_quiet_gt_a##AKIND(a, b); \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
365 real(AKIND), intent(in) :: a, b; \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
366 end function ieee_quiet_gt_a##AKIND;
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
367 interface ieee_quiet_gt
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
368 SPECIFICS_R(IEEE_QUIET_GT_R)
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
369 end interface ieee_quiet_gt
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
370 PRIVATE_R(IEEE_QUIET_GT)
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
371 #undef IEEE_QUIET_GT_R
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
372
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
373 #define IEEE_QUIET_LE_R(AKIND) \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
374 elemental logical function ieee_quiet_le_a##AKIND(a, b); \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
375 real(AKIND), intent(in) :: a, b; \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
376 end function ieee_quiet_le_a##AKIND;
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
377 interface ieee_quiet_le
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
378 SPECIFICS_R(IEEE_QUIET_LE_R)
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
379 end interface ieee_quiet_le
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
380 PRIVATE_R(IEEE_QUIET_LE)
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
381 #undef IEEE_QUIET_LE_R
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
382
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
383 #define IEEE_QUIET_LT_R(AKIND) \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
384 elemental logical function ieee_quiet_lt_a##AKIND(a, b); \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
385 real(AKIND), intent(in) :: a, b; \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
386 end function ieee_quiet_lt_a##AKIND;
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
387 interface ieee_quiet_lt
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
388 SPECIFICS_R(IEEE_QUIET_LT_R)
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
389 end interface ieee_quiet_lt
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
390 PRIVATE_R(IEEE_QUIET_LT)
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
391 #undef IEEE_QUIET_LT_R
173
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
392
236
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
393 #define IEEE_QUIET_NE_R(AKIND) \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
394 elemental logical function ieee_quiet_ne_a##AKIND(a, b); \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
395 real(AKIND), intent(in) :: a, b; \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
396 end function ieee_quiet_ne_a##AKIND;
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
397 interface ieee_quiet_ne
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
398 SPECIFICS_R(IEEE_QUIET_NE_R)
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
399 end interface ieee_quiet_ne
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
400 PRIVATE_R(IEEE_QUIET_NE)
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
401 #undef IEEE_QUIET_NE_R
173
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
402
236
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
403 ! When kind argument is present, kind(result) is value(kind), not kind(kind).
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
404 ! That is not known here, so return real(16).
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
405 #define IEEE_REAL_I(AKIND) \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
406 elemental real function ieee_real_i##AKIND(a); \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
407 integer(AKIND), intent(in) :: a; \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
408 end function ieee_real_i##AKIND;
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
409 #define IEEE_REAL_R(AKIND) \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
410 elemental real function ieee_real_a##AKIND(a); \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
411 real(AKIND), intent(in) :: a; \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
412 end function ieee_real_a##AKIND;
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
413 #define IEEE_REAL_II(AKIND, KKIND) \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
414 elemental real(16) function ieee_real_i##AKIND##_i##KKIND(a, kind); \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
415 integer(AKIND), intent(in) :: a; \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
416 integer(KKIND), intent(in) :: kind; \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
417 end function ieee_real_i##AKIND##_i##KKIND;
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
418 #define IEEE_REAL_RI(AKIND, KKIND) \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
419 elemental real(16) function ieee_real_a##AKIND##_i##KKIND(a, kind); \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
420 real(AKIND), intent(in) :: a; \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
421 integer(KKIND), intent(in) :: kind; \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
422 end function ieee_real_a##AKIND##_i##KKIND;
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
423 interface ieee_real
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
424 SPECIFICS_I(IEEE_REAL_I)
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
425 SPECIFICS_R(IEEE_REAL_R)
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
426 SPECIFICS_II(IEEE_REAL_II)
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
427 SPECIFICS_RI(IEEE_REAL_RI)
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
428 end interface ieee_real
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
429 PRIVATE_I(IEEE_REAL)
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
430 PRIVATE_R(IEEE_REAL)
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
431 PRIVATE_II(IEEE_REAL)
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
432 PRIVATE_RI(IEEE_REAL)
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
433 #undef IEEE_REAL_I
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
434 #undef IEEE_REAL_R
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
435 #undef IEEE_REAL_II
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
436 #undef IEEE_REAL_RI
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
437
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
438 #define IEEE_REM_RR(XKIND, YKIND) \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
439 elemental real(XKIND) function ieee_rem_a##XKIND##_a##YKIND(x, y); \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
440 real(XKIND), intent(in) :: x; \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
441 real(YKIND), intent(in) :: y; \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
442 end function ieee_rem_a##XKIND##_a##YKIND;
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
443 interface ieee_rem
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
444 SPECIFICS_RR(IEEE_REM_RR)
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
445 end interface ieee_rem
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
446 PRIVATE_RR(IEEE_REM)
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
447 #undef IEEE_REM_RR
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
448
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
449 #define IEEE_RINT_R(XKIND) \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
450 elemental real(XKIND) function ieee_rint_a##XKIND(x, round); \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
451 import ieee_round_type; \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
452 real(XKIND), intent(in) :: x; \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
453 type(ieee_round_type), optional, intent(in) :: round; \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
454 end function ieee_rint_a##XKIND;
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
455 interface ieee_rint
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
456 SPECIFICS_R(IEEE_RINT_R)
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
457 end interface ieee_rint
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
458 PRIVATE_R(IEEE_RINT)
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
459 #undef IEEE_RINT_R
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
460
236
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
461 #define IEEE_SET_ROUNDING_MODE_I(RKIND) \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
462 subroutine ieee_set_rounding_mode_i##RKIND(round_value, radix); \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
463 import ieee_round_type; \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
464 type(ieee_round_type), intent(in) :: round_value; \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
465 integer(RKIND), intent(in) :: radix; \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
466 end subroutine ieee_set_rounding_mode_i##RKIND;
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
467 interface ieee_set_rounding_mode
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
468 subroutine ieee_set_rounding_mode_0(round_value)
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
469 import ieee_round_type
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
470 type(ieee_round_type), intent(in) :: round_value
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
471 end subroutine ieee_set_rounding_mode_0
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
472 SPECIFICS_I(IEEE_SET_ROUNDING_MODE_I)
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
473 end interface ieee_set_rounding_mode
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
474 PRIVATE_I(IEEE_SET_ROUNDING_MODE)
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
475 #undef IEEE_SET_ROUNDING_MODE_I
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
476
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
477 #define IEEE_SET_UNDERFLOW_MODE_L(GKIND) \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
478 subroutine ieee_set_underflow_mode_l##GKIND(gradual); \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
479 logical(GKIND), intent(in) :: gradual; \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
480 end subroutine ieee_set_underflow_mode_l##GKIND;
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
481 interface ieee_set_underflow_mode
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
482 SPECIFICS_L(IEEE_SET_UNDERFLOW_MODE_L)
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
483 end interface ieee_set_underflow_mode
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
484 PRIVATE_L(IEEE_SET_UNDERFLOW_MODE)
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
485 #undef IEEE_SET_UNDERFLOW_MODE_L
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
486
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
487 #define IEEE_SIGNALING_EQ_R(AKIND) \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
488 elemental logical function ieee_signaling_eq_a##AKIND(a, b); \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
489 real(AKIND), intent(in) :: a, b; \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
490 end function ieee_signaling_eq_a##AKIND;
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
491 interface ieee_signaling_eq
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
492 SPECIFICS_R(IEEE_SIGNALING_EQ_R)
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
493 end interface ieee_signaling_eq
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
494 PRIVATE_R(IEEE_SIGNALING_EQ)
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
495 #undef IEEE_SIGNALING_EQ_R
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
496
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
497 #define IEEE_SIGNALING_GE_R(AKIND) \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
498 elemental logical function ieee_signaling_ge_a##AKIND(a, b); \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
499 real(AKIND), intent(in) :: a, b; \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
500 end function ieee_signaling_ge_a##AKIND;
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
501 interface ieee_signaling_ge
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
502 SPECIFICS_R(IEEE_SIGNALING_GE_R)
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
503 end interface ieee_signaling_ge
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
504 PRIVATE_R(IEEE_SIGNALING_GE)
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
505 #undef IEEE_SIGNALING_GE_R
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
506
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
507 #define IEEE_SIGNALING_GT_R(AKIND) \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
508 elemental logical function ieee_signaling_gt_a##AKIND(a, b); \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
509 real(AKIND), intent(in) :: a, b; \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
510 end function ieee_signaling_gt_a##AKIND;
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
511 interface ieee_signaling_gt
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
512 SPECIFICS_R(IEEE_SIGNALING_GT_R)
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
513 end interface ieee_signaling_gt
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
514 PRIVATE_R(IEEE_SIGNALING_GT)
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
515 #undef IEEE_SIGNALING_GT_R
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
516
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
517 #define IEEE_SIGNALING_LE_R(AKIND) \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
518 elemental logical function ieee_signaling_le_a##AKIND(a, b); \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
519 real(AKIND), intent(in) :: a, b; \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
520 end function ieee_signaling_le_a##AKIND;
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
521 interface ieee_signaling_le
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
522 SPECIFICS_R(IEEE_SIGNALING_LE_R)
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
523 end interface ieee_signaling_le
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
524 PRIVATE_R(IEEE_SIGNALING_LE)
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
525 #undef IEEE_SIGNALING_LE_R
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
526
236
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
527 #define IEEE_SIGNALING_LT_R(AKIND) \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
528 elemental logical function ieee_signaling_lt_a##AKIND(a, b); \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
529 real(AKIND), intent(in) :: a, b; \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
530 end function ieee_signaling_lt_a##AKIND;
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
531 interface ieee_signaling_lt
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
532 SPECIFICS_R(IEEE_SIGNALING_LT_R)
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
533 end interface ieee_signaling_lt
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
534 PRIVATE_R(IEEE_SIGNALING_LT)
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
535 #undef IEEE_SIGNALING_LT_R
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
536
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
537 #define IEEE_SIGNALING_NE_R(AKIND) \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
538 elemental logical function ieee_signaling_ne_a##AKIND(a, b); \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
539 real(AKIND), intent(in) :: a, b; \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
540 end function ieee_signaling_ne_a##AKIND;
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
541 interface ieee_signaling_ne
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
542 SPECIFICS_R(IEEE_SIGNALING_NE_R)
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
543 end interface ieee_signaling_ne
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
544 PRIVATE_R(IEEE_SIGNALING_NE)
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
545 #undef IEEE_SIGNALING_NE_R
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
546
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
547 #define IEEE_SIGNBIT_R(XKIND) \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
548 elemental logical function ieee_signbit_a##XKIND(x); \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
549 real(XKIND), intent(in) :: x; \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
550 end function ieee_signbit_a##XKIND;
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
551 interface ieee_signbit
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
552 SPECIFICS_R(IEEE_SIGNBIT_R)
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
553 end interface ieee_signbit
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
554 PRIVATE_R(IEEE_SIGNBIT)
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
555 #undef IEEE_SIGNBIT_R
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
556
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
557 #define IEEE_SUPPORT_ROUNDING_R(XKIND) \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
558 pure logical function ieee_support_rounding_a##XKIND(round_value, x); \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
559 import ieee_round_type; \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
560 type(ieee_round_type), intent(in) :: round_value; \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
561 real(XKIND), intent(in) :: x(..); \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
562 end function ieee_support_rounding_a##XKIND;
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
563 interface ieee_support_rounding
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
564 pure logical function ieee_support_rounding_0(round_value)
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
565 import ieee_round_type
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
566 type(ieee_round_type), intent(in) :: round_value
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
567 end function ieee_support_rounding_0
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
568 SPECIFICS_R(IEEE_SUPPORT_ROUNDING_R)
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
569 end interface ieee_support_rounding
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
570 PRIVATE_R(IEEE_SUPPORT_ROUNDING)
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
571 #undef IEEE_SUPPORT_ROUNDING_R
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
572
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
573 #define IEEE_UNORDERED_RR(XKIND, YKIND) \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
574 elemental logical function ieee_unordered_a##XKIND##_a##YKIND(x, y); \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
575 real(XKIND), intent(in) :: x; \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
576 real(YKIND), intent(in) :: y; \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
577 end function ieee_unordered_a##XKIND##_a##YKIND;
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
578 interface ieee_unordered
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
579 SPECIFICS_RR(IEEE_UNORDERED_RR)
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
580 end interface ieee_unordered
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
581 PRIVATE_RR(IEEE_UNORDERED)
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
582 #undef IEEE_UNORDERED_RR
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
583
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
584 #define IEEE_VALUE_R(XKIND) \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
585 elemental real(XKIND) function ieee_value_a##XKIND(x, class); \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
586 import ieee_class_type; \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
587 real(XKIND), intent(in) :: x; \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
588 type(ieee_class_type), intent(in) :: class; \
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
589 end function ieee_value_a##XKIND;
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
590 interface ieee_value
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
591 SPECIFICS_R(IEEE_VALUE_R)
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
592 end interface ieee_value
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
593 PRIVATE_R(IEEE_VALUE)
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
594 #undef IEEE_VALUE_R
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
595
173
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
596 end module ieee_arithmetic