111
|
1 /* Common declarations for all of libgfortran.
|
|
2 Copyright (C) 2002-2017 Free Software Foundation, Inc.
|
|
3 Contributed by Paul Brook <paul@nowt.org>, and
|
|
4 Andy Vaught <andy@xena.eas.asu.edu>
|
|
5
|
|
6 This file is part of the GNU Fortran runtime library (libgfortran).
|
|
7
|
|
8 Libgfortran is free software; you can redistribute it and/or modify
|
|
9 it under the terms of the GNU General Public License as published by
|
|
10 the Free Software Foundation; either version 3, or (at your option)
|
|
11 any later version.
|
|
12
|
|
13 Libgfortran is distributed in the hope that it will be useful,
|
|
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16 GNU General Public License for more details.
|
|
17
|
|
18 Under Section 7 of GPL version 3, you are granted additional
|
|
19 permissions described in the GCC Runtime Library Exception, version
|
|
20 3.1, as published by the Free Software Foundation.
|
|
21
|
|
22 You should have received a copy of the GNU General Public License and
|
|
23 a copy of the GCC Runtime Library Exception along with this program;
|
|
24 see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
|
25 <http://www.gnu.org/licenses/>. */
|
|
26
|
|
27 #ifndef LIBGFOR_H
|
|
28 #define LIBGFOR_H
|
|
29
|
|
30 /* Ensure that ANSI conform stdio is used. This needs to be set before
|
|
31 any system header file is included. */
|
|
32 #if defined __MINGW32__
|
|
33 # define _POSIX 1
|
|
34 # define gfc_printf gnu_printf
|
|
35 #else
|
|
36 # define gfc_printf __printf__
|
|
37 #endif
|
|
38
|
|
39 /* config.h MUST be first because it can affect system headers. */
|
|
40 #include "config.h"
|
|
41
|
|
42 #include <stdio.h>
|
|
43 #include <stdlib.h>
|
|
44 #include <stddef.h>
|
|
45 #include <float.h>
|
|
46 #include <stdarg.h>
|
|
47 #include <stdbool.h>
|
|
48
|
|
49 #if HAVE_COMPLEX_H
|
|
50 /* Must appear before math.h on VMS systems. */
|
|
51 # include <complex.h>
|
|
52 #else
|
|
53 #define complex __complex__
|
|
54 #endif
|
|
55
|
|
56 #include <math.h>
|
|
57
|
|
58 /* If we're support quad-precision floating-point type, include the
|
|
59 header to our support library. */
|
|
60 #ifdef HAVE_FLOAT128
|
|
61 # include "quadmath_weak.h"
|
|
62 #endif
|
|
63
|
|
64 #ifdef __MINGW32__
|
|
65 extern float __strtof (const char *, char **);
|
|
66 #define gfc_strtof __strtof
|
|
67 extern double __strtod (const char *, char **);
|
|
68 #define gfc_strtod __strtod
|
|
69 extern long double __strtold (const char *, char **);
|
|
70 #define gfc_strtold __strtold
|
|
71 #else
|
|
72 #define gfc_strtof strtof
|
|
73 #define gfc_strtod strtod
|
|
74 #define gfc_strtold strtold
|
|
75 #endif
|
|
76
|
|
77 #include "../gcc/fortran/libgfortran.h"
|
|
78
|
|
79 #include "c99_protos.h"
|
|
80
|
|
81 #if HAVE_IEEEFP_H
|
|
82 #include <ieeefp.h>
|
|
83 #endif
|
|
84
|
|
85 #include "gstdint.h"
|
|
86
|
|
87 #if HAVE_SYS_TYPES_H
|
|
88 #include <sys/types.h>
|
|
89 #endif
|
|
90
|
|
91 #ifdef __MINGW32__
|
|
92 typedef off64_t gfc_offset;
|
|
93 #else
|
|
94 typedef off_t gfc_offset;
|
|
95 #endif
|
|
96
|
|
97 #ifndef NULL
|
|
98 #define NULL (void *) 0
|
|
99 #endif
|
|
100
|
|
101
|
|
102 /* The following macros can be used to annotate conditions which are likely or
|
|
103 unlikely to be true. Avoid using them when a condition is only slightly
|
|
104 more likely/less unlikely than average to avoid the performance penalties of
|
|
105 branch misprediction. In addition, as __builtin_expect overrides the compiler
|
|
106 heuristic, do not use in conditions where one of the branches ends with a
|
|
107 call to a function with __attribute__((noreturn)): the compiler internal
|
|
108 heuristic will mark this branch as much less likely as unlikely() would
|
|
109 do. */
|
|
110
|
|
111 #define likely(x) __builtin_expect(!!(x), 1)
|
|
112 #define unlikely(x) __builtin_expect(!!(x), 0)
|
|
113
|
|
114 /* This macro can be used to annotate conditions which we know to
|
|
115 be true, so that the compiler can optimize based on the condition. */
|
|
116
|
|
117 #define GFC_ASSERT(EXPR) \
|
|
118 ((void)(__builtin_expect (!(EXPR), 0) ? __builtin_unreachable (), 0 : 0))
|
|
119
|
|
120 /* Make sure we have ptrdiff_t. */
|
|
121 #ifndef HAVE_PTRDIFF_T
|
|
122 typedef intptr_t ptrdiff_t;
|
|
123 #endif
|
|
124
|
|
125 /* On mingw, work around the buggy Windows snprintf() by using the one
|
|
126 mingw provides, __mingw_snprintf(). We also provide a prototype for
|
|
127 __mingw_snprintf(), because the mingw headers currently don't have one. */
|
|
128 #if HAVE_MINGW_SNPRINTF
|
|
129 extern int __mingw_snprintf (char *, size_t, const char *, ...)
|
|
130 __attribute__ ((format (gnu_printf, 3, 4)));
|
|
131 #undef snprintf
|
|
132 #define snprintf __mingw_snprintf
|
|
133 /* Fallback to sprintf if target does not have snprintf. */
|
|
134 #elif !defined(HAVE_SNPRINTF)
|
|
135 #undef snprintf
|
|
136 #define snprintf(str, size, ...) sprintf (str, __VA_ARGS__)
|
|
137 #endif
|
|
138
|
|
139
|
|
140 /* For a library, a standard prefix is a requirement in order to partition
|
|
141 the namespace. IPREFIX is for symbols intended to be internal to the
|
|
142 library. */
|
|
143 #define PREFIX(x) _gfortran_ ## x
|
|
144 #define IPREFIX(x) _gfortrani_ ## x
|
|
145
|
|
146 /* Magic to rename a symbol at the compiler level. You continue to refer
|
|
147 to the symbol as OLD in the source, but it'll be named NEW in the asm. */
|
|
148 #define sym_rename(old, new) sym_rename1(old, __USER_LABEL_PREFIX__, new)
|
|
149 #define sym_rename1(old, ulp, new) sym_rename2(old, ulp, new)
|
|
150 #define sym_rename2(old, ulp, new) extern __typeof(old) old __asm__(#ulp #new)
|
|
151
|
|
152 /* There are several classifications of routines:
|
|
153
|
|
154 (1) Symbols used only within the library,
|
|
155 (2) Symbols to be exported from the library,
|
|
156 (3) Symbols to be exported from the library, but
|
|
157 also used inside the library.
|
|
158
|
|
159 By telling the compiler about these different classifications we can
|
|
160 tightly control the interface seen by the user, and get better code
|
|
161 from the compiler at the same time.
|
|
162
|
|
163 One of the following should be used immediately after the declaration
|
|
164 of each symbol:
|
|
165
|
|
166 internal_proto Marks a symbol used only within the library,
|
|
167 and adds IPREFIX to the assembly-level symbol
|
|
168 name. The later is important for maintaining
|
|
169 the namespace partition for the static library.
|
|
170
|
|
171 export_proto Marks a symbol to be exported, and adds PREFIX
|
|
172 to the assembly-level symbol name.
|
|
173
|
|
174 export_proto_np Marks a symbol to be exported without adding PREFIX.
|
|
175
|
|
176 iexport_proto Marks a function to be exported, but with the
|
|
177 understanding that it can be used inside as well.
|
|
178
|
|
179 iexport_data_proto Similarly, marks a data symbol to be exported.
|
|
180 Unfortunately, some systems can't play the hidden
|
|
181 symbol renaming trick on data symbols, thanks to
|
|
182 the horribleness of COPY relocations.
|
|
183
|
|
184 If iexport_proto or iexport_data_proto is used, you must also use
|
|
185 iexport or iexport_data after the *definition* of the symbol. */
|
|
186
|
|
187 #if defined(HAVE_ATTRIBUTE_VISIBILITY)
|
|
188 # define internal_proto(x) \
|
|
189 sym_rename(x, IPREFIX (x)) __attribute__((__visibility__("hidden")))
|
|
190 #else
|
|
191 # define internal_proto(x) sym_rename(x, IPREFIX(x))
|
|
192 #endif
|
|
193
|
|
194 #if defined(HAVE_ATTRIBUTE_VISIBILITY) && defined(HAVE_ATTRIBUTE_ALIAS)
|
|
195 # define export_proto(x) sym_rename(x, PREFIX(x))
|
|
196 # define export_proto_np(x) extern char swallow_semicolon
|
|
197 # define iexport_proto(x) internal_proto(x)
|
|
198 # define iexport(x) iexport1(x, IPREFIX(x))
|
|
199 # define iexport1(x,y) iexport2(x,y)
|
|
200 # define iexport2(x,y) \
|
|
201 extern __typeof(x) PREFIX(x) __attribute__((__alias__(#y)))
|
|
202 #else
|
|
203 # define export_proto(x) sym_rename(x, PREFIX(x))
|
|
204 # define export_proto_np(x) extern char swallow_semicolon
|
|
205 # define iexport_proto(x) export_proto(x)
|
|
206 # define iexport(x) extern char swallow_semicolon
|
|
207 #endif
|
|
208
|
|
209 /* TODO: detect the case when we *can* hide the symbol. */
|
|
210 #define iexport_data_proto(x) export_proto(x)
|
|
211 #define iexport_data(x) extern char swallow_semicolon
|
|
212
|
|
213 /* The only reliable way to get the offset of a field in a struct
|
|
214 in a system independent way is via this macro. */
|
|
215 #ifndef offsetof
|
|
216 #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *) 0)->MEMBER)
|
|
217 #endif
|
|
218
|
|
219 /* The C99 classification macros isfinite, isinf, isnan, isnormal
|
|
220 and signbit are broken or inconsistent on quite a few targets.
|
|
221 So, we use GCC's builtins instead.
|
|
222
|
|
223 Another advantage for GCC's builtins for these type-generic macros
|
|
224 is that it handles floating-point types that the system headers
|
|
225 may not support (like __float128). */
|
|
226
|
|
227 #undef isnan
|
|
228 #define isnan(x) __builtin_isnan(x)
|
|
229 #undef isfinite
|
|
230 #define isfinite(x) __builtin_isfinite(x)
|
|
231 #undef isinf
|
|
232 #define isinf(x) __builtin_isinf(x)
|
|
233 #undef isnormal
|
|
234 #define isnormal(x) __builtin_isnormal(x)
|
|
235 #undef signbit
|
|
236 #define signbit(x) __builtin_signbit(x)
|
|
237
|
|
238 #include "kinds.h"
|
|
239
|
|
240 /* Define the type used for the current record number for large file I/O.
|
|
241 The size must be consistent with the size defined on the compiler side. */
|
|
242 #ifdef HAVE_GFC_INTEGER_8
|
|
243 typedef GFC_INTEGER_8 GFC_IO_INT;
|
|
244 #else
|
|
245 #ifdef HAVE_GFC_INTEGER_4
|
|
246 typedef GFC_INTEGER_4 GFC_IO_INT;
|
|
247 #else
|
|
248 #error "GFC_INTEGER_4 should be available for the library to compile".
|
|
249 #endif
|
|
250 #endif
|
|
251
|
|
252 /* The following two definitions must be consistent with the types used
|
|
253 by the compiler. */
|
|
254 /* The type used of array indices, amongst other things. */
|
|
255 typedef ptrdiff_t index_type;
|
|
256
|
|
257 /* The type used for the lengths of character variables. */
|
|
258 typedef GFC_INTEGER_4 gfc_charlen_type;
|
|
259
|
|
260 /* Definitions of CHARACTER data types:
|
|
261 - CHARACTER(KIND=1) corresponds to the C char type,
|
|
262 - CHARACTER(KIND=4) corresponds to an unsigned 32-bit integer. */
|
|
263 typedef GFC_UINTEGER_4 gfc_char4_t;
|
|
264
|
|
265 /* Byte size of character kinds. For the kinds currently supported, it's
|
|
266 simply equal to the kind parameter itself. */
|
|
267 #define GFC_SIZE_OF_CHAR_KIND(kind) (kind)
|
|
268
|
|
269 /* This will be 0 on little-endian machines and one on big-endian machines. */
|
|
270 extern int big_endian;
|
|
271 internal_proto(big_endian);
|
|
272
|
|
273 #define GFOR_POINTER_TO_L1(p, kind) \
|
|
274 (big_endian * (kind - 1) + (GFC_LOGICAL_1 *)(p))
|
|
275
|
|
276 #define GFC_INTEGER_1_HUGE \
|
|
277 (GFC_INTEGER_1)((((GFC_UINTEGER_1)1) << 7) - 1)
|
|
278 #define GFC_INTEGER_2_HUGE \
|
|
279 (GFC_INTEGER_2)((((GFC_UINTEGER_2)1) << 15) - 1)
|
|
280 #define GFC_INTEGER_4_HUGE \
|
|
281 (GFC_INTEGER_4)((((GFC_UINTEGER_4)1) << 31) - 1)
|
|
282 #define GFC_INTEGER_8_HUGE \
|
|
283 (GFC_INTEGER_8)((((GFC_UINTEGER_8)1) << 63) - 1)
|
|
284 #ifdef HAVE_GFC_INTEGER_16
|
|
285 #define GFC_INTEGER_16_HUGE \
|
|
286 (GFC_INTEGER_16)((((GFC_UINTEGER_16)1) << 127) - 1)
|
|
287 #endif
|
|
288
|
|
289 /* M{IN,AX}{LOC,VAL} need also infinities and NaNs if supported. */
|
|
290
|
|
291 #ifdef __FLT_HAS_INFINITY__
|
|
292 # define GFC_REAL_4_INFINITY __builtin_inff ()
|
|
293 #endif
|
|
294 #ifdef __DBL_HAS_INFINITY__
|
|
295 # define GFC_REAL_8_INFINITY __builtin_inf ()
|
|
296 #endif
|
|
297 #ifdef __LDBL_HAS_INFINITY__
|
|
298 # ifdef HAVE_GFC_REAL_10
|
|
299 # define GFC_REAL_10_INFINITY __builtin_infl ()
|
|
300 # endif
|
|
301 # ifdef HAVE_GFC_REAL_16
|
|
302 # ifdef GFC_REAL_16_IS_LONG_DOUBLE
|
|
303 # define GFC_REAL_16_INFINITY __builtin_infl ()
|
|
304 # else
|
|
305 # define GFC_REAL_16_INFINITY __builtin_infq ()
|
|
306 # endif
|
|
307 # endif
|
|
308 #endif
|
|
309 #ifdef __FLT_HAS_QUIET_NAN__
|
|
310 # define GFC_REAL_4_QUIET_NAN __builtin_nanf ("")
|
|
311 #endif
|
|
312 #ifdef __DBL_HAS_QUIET_NAN__
|
|
313 # define GFC_REAL_8_QUIET_NAN __builtin_nan ("")
|
|
314 #endif
|
|
315 #ifdef __LDBL_HAS_QUIET_NAN__
|
|
316 # ifdef HAVE_GFC_REAL_10
|
|
317 # define GFC_REAL_10_QUIET_NAN __builtin_nanl ("")
|
|
318 # endif
|
|
319 # ifdef HAVE_GFC_REAL_16
|
|
320 # ifdef GFC_REAL_16_IS_LONG_DOUBLE
|
|
321 # define GFC_REAL_16_QUIET_NAN __builtin_nanl ("")
|
|
322 # else
|
|
323 # define GFC_REAL_16_QUIET_NAN nanq ("")
|
|
324 # endif
|
|
325 # endif
|
|
326 #endif
|
|
327
|
|
328 typedef struct descriptor_dimension
|
|
329 {
|
|
330 index_type _stride;
|
|
331 index_type lower_bound;
|
|
332 index_type _ubound;
|
|
333 }
|
|
334
|
|
335 descriptor_dimension;
|
|
336
|
|
337 #define GFC_ARRAY_DESCRIPTOR(r, type) \
|
|
338 struct {\
|
|
339 type *base_addr;\
|
|
340 size_t offset;\
|
|
341 index_type dtype;\
|
|
342 index_type span;\
|
|
343 descriptor_dimension dim[r];\
|
|
344 }
|
|
345
|
|
346 /* Commonly used array descriptor types. */
|
|
347 typedef GFC_ARRAY_DESCRIPTOR (GFC_MAX_DIMENSIONS, void) gfc_array_void;
|
|
348 typedef GFC_ARRAY_DESCRIPTOR (GFC_MAX_DIMENSIONS, char) gfc_array_char;
|
|
349 typedef GFC_ARRAY_DESCRIPTOR (GFC_MAX_DIMENSIONS, GFC_INTEGER_1) gfc_array_i1;
|
|
350 typedef GFC_ARRAY_DESCRIPTOR (GFC_MAX_DIMENSIONS, GFC_INTEGER_2) gfc_array_i2;
|
|
351 typedef GFC_ARRAY_DESCRIPTOR (GFC_MAX_DIMENSIONS, GFC_INTEGER_4) gfc_array_i4;
|
|
352 typedef GFC_ARRAY_DESCRIPTOR (GFC_MAX_DIMENSIONS, GFC_INTEGER_8) gfc_array_i8;
|
|
353 #ifdef HAVE_GFC_INTEGER_16
|
|
354 typedef GFC_ARRAY_DESCRIPTOR (GFC_MAX_DIMENSIONS, GFC_INTEGER_16) gfc_array_i16;
|
|
355 #endif
|
|
356 typedef GFC_ARRAY_DESCRIPTOR (GFC_MAX_DIMENSIONS, GFC_REAL_4) gfc_array_r4;
|
|
357 typedef GFC_ARRAY_DESCRIPTOR (GFC_MAX_DIMENSIONS, GFC_REAL_8) gfc_array_r8;
|
|
358 #ifdef HAVE_GFC_REAL_10
|
|
359 typedef GFC_ARRAY_DESCRIPTOR (GFC_MAX_DIMENSIONS, GFC_REAL_10) gfc_array_r10;
|
|
360 #endif
|
|
361 #ifdef HAVE_GFC_REAL_16
|
|
362 typedef GFC_ARRAY_DESCRIPTOR (GFC_MAX_DIMENSIONS, GFC_REAL_16) gfc_array_r16;
|
|
363 #endif
|
|
364 typedef GFC_ARRAY_DESCRIPTOR (GFC_MAX_DIMENSIONS, GFC_COMPLEX_4) gfc_array_c4;
|
|
365 typedef GFC_ARRAY_DESCRIPTOR (GFC_MAX_DIMENSIONS, GFC_COMPLEX_8) gfc_array_c8;
|
|
366 #ifdef HAVE_GFC_COMPLEX_10
|
|
367 typedef GFC_ARRAY_DESCRIPTOR (GFC_MAX_DIMENSIONS, GFC_COMPLEX_10) gfc_array_c10;
|
|
368 #endif
|
|
369 #ifdef HAVE_GFC_COMPLEX_16
|
|
370 typedef GFC_ARRAY_DESCRIPTOR (GFC_MAX_DIMENSIONS, GFC_COMPLEX_16) gfc_array_c16;
|
|
371 #endif
|
|
372 typedef GFC_ARRAY_DESCRIPTOR (GFC_MAX_DIMENSIONS, GFC_LOGICAL_1) gfc_array_l1;
|
|
373 typedef GFC_ARRAY_DESCRIPTOR (GFC_MAX_DIMENSIONS, GFC_LOGICAL_2) gfc_array_l2;
|
|
374 typedef GFC_ARRAY_DESCRIPTOR (GFC_MAX_DIMENSIONS, GFC_LOGICAL_4) gfc_array_l4;
|
|
375 typedef GFC_ARRAY_DESCRIPTOR (GFC_MAX_DIMENSIONS, GFC_LOGICAL_8) gfc_array_l8;
|
|
376 #ifdef HAVE_GFC_LOGICAL_16
|
|
377 typedef GFC_ARRAY_DESCRIPTOR (GFC_MAX_DIMENSIONS, GFC_LOGICAL_16) gfc_array_l16;
|
|
378 #endif
|
|
379
|
|
380
|
|
381 #define GFC_DESCRIPTOR_RANK(desc) ((desc)->dtype & GFC_DTYPE_RANK_MASK)
|
|
382 #define GFC_DESCRIPTOR_TYPE(desc) (((desc)->dtype & GFC_DTYPE_TYPE_MASK) \
|
|
383 >> GFC_DTYPE_TYPE_SHIFT)
|
|
384 #define GFC_DESCRIPTOR_SIZE(desc) ((desc)->dtype >> GFC_DTYPE_SIZE_SHIFT)
|
|
385 #define GFC_DESCRIPTOR_DATA(desc) ((desc)->base_addr)
|
|
386 #define GFC_DESCRIPTOR_DTYPE(desc) ((desc)->dtype)
|
|
387
|
|
388 #define GFC_DIMENSION_LBOUND(dim) ((dim).lower_bound)
|
|
389 #define GFC_DIMENSION_UBOUND(dim) ((dim)._ubound)
|
|
390 #define GFC_DIMENSION_STRIDE(dim) ((dim)._stride)
|
|
391 #define GFC_DIMENSION_EXTENT(dim) ((dim)._ubound + 1 - (dim).lower_bound)
|
|
392 #define GFC_DIMENSION_SET(dim,lb,ub,str) \
|
|
393 do \
|
|
394 { \
|
|
395 (dim).lower_bound = lb; \
|
|
396 (dim)._ubound = ub; \
|
|
397 (dim)._stride = str; \
|
|
398 } while (0)
|
|
399
|
|
400
|
|
401 #define GFC_DESCRIPTOR_LBOUND(desc,i) ((desc)->dim[i].lower_bound)
|
|
402 #define GFC_DESCRIPTOR_UBOUND(desc,i) ((desc)->dim[i]._ubound)
|
|
403 #define GFC_DESCRIPTOR_EXTENT(desc,i) ((desc)->dim[i]._ubound + 1 \
|
|
404 - (desc)->dim[i].lower_bound)
|
|
405 #define GFC_DESCRIPTOR_EXTENT_BYTES(desc,i) \
|
|
406 (GFC_DESCRIPTOR_EXTENT(desc,i) * GFC_DESCRIPTOR_SIZE(desc))
|
|
407
|
|
408 #define GFC_DESCRIPTOR_STRIDE(desc,i) ((desc)->dim[i]._stride)
|
|
409 #define GFC_DESCRIPTOR_STRIDE_BYTES(desc,i) \
|
|
410 (GFC_DESCRIPTOR_STRIDE(desc,i) * GFC_DESCRIPTOR_SIZE(desc))
|
|
411
|
|
412 /* Macros to get both the size and the type with a single masking operation */
|
|
413
|
|
414 #define GFC_DTYPE_SIZE_MASK (-((index_type) 1 << GFC_DTYPE_SIZE_SHIFT))
|
|
415 #define GFC_DTYPE_TYPE_SIZE_MASK (GFC_DTYPE_SIZE_MASK | GFC_DTYPE_TYPE_MASK)
|
|
416
|
|
417 #define GFC_DTYPE_TYPE_SIZE(desc) ((desc)->dtype & GFC_DTYPE_TYPE_SIZE_MASK)
|
|
418
|
|
419 #define GFC_DTYPE_INTEGER_1 ((BT_INTEGER << GFC_DTYPE_TYPE_SHIFT) \
|
|
420 | (sizeof(GFC_INTEGER_1) << GFC_DTYPE_SIZE_SHIFT))
|
|
421 #define GFC_DTYPE_INTEGER_2 ((BT_INTEGER << GFC_DTYPE_TYPE_SHIFT) \
|
|
422 | (sizeof(GFC_INTEGER_2) << GFC_DTYPE_SIZE_SHIFT))
|
|
423 #define GFC_DTYPE_INTEGER_4 ((BT_INTEGER << GFC_DTYPE_TYPE_SHIFT) \
|
|
424 | (sizeof(GFC_INTEGER_4) << GFC_DTYPE_SIZE_SHIFT))
|
|
425 #define GFC_DTYPE_INTEGER_8 ((BT_INTEGER << GFC_DTYPE_TYPE_SHIFT) \
|
|
426 | (sizeof(GFC_INTEGER_8) << GFC_DTYPE_SIZE_SHIFT))
|
|
427 #ifdef HAVE_GFC_INTEGER_16
|
|
428 #define GFC_DTYPE_INTEGER_16 ((BT_INTEGER << GFC_DTYPE_TYPE_SHIFT) \
|
|
429 | (sizeof(GFC_INTEGER_16) << GFC_DTYPE_SIZE_SHIFT))
|
|
430 #endif
|
|
431
|
|
432 #define GFC_DTYPE_LOGICAL_1 ((BT_LOGICAL << GFC_DTYPE_TYPE_SHIFT) \
|
|
433 | (sizeof(GFC_LOGICAL_1) << GFC_DTYPE_SIZE_SHIFT))
|
|
434 #define GFC_DTYPE_LOGICAL_2 ((BT_LOGICAL << GFC_DTYPE_TYPE_SHIFT) \
|
|
435 | (sizeof(GFC_LOGICAL_2) << GFC_DTYPE_SIZE_SHIFT))
|
|
436 #define GFC_DTYPE_LOGICAL_4 ((BT_LOGICAL << GFC_DTYPE_TYPE_SHIFT) \
|
|
437 | (sizeof(GFC_LOGICAL_4) << GFC_DTYPE_SIZE_SHIFT))
|
|
438 #define GFC_DTYPE_LOGICAL_8 ((BT_LOGICAL << GFC_DTYPE_TYPE_SHIFT) \
|
|
439 | (sizeof(GFC_LOGICAL_8) << GFC_DTYPE_SIZE_SHIFT))
|
|
440 #ifdef HAVE_GFC_LOGICAL_16
|
|
441 #define GFC_DTYPE_LOGICAL_16 ((BT_LOGICAL << GFC_DTYPE_TYPE_SHIFT) \
|
|
442 | (sizeof(GFC_LOGICAL_16) << GFC_DTYPE_SIZE_SHIFT))
|
|
443 #endif
|
|
444
|
|
445 #define GFC_DTYPE_REAL_4 ((BT_REAL << GFC_DTYPE_TYPE_SHIFT) \
|
|
446 | (sizeof(GFC_REAL_4) << GFC_DTYPE_SIZE_SHIFT))
|
|
447 #define GFC_DTYPE_REAL_8 ((BT_REAL << GFC_DTYPE_TYPE_SHIFT) \
|
|
448 | (sizeof(GFC_REAL_8) << GFC_DTYPE_SIZE_SHIFT))
|
|
449 #ifdef HAVE_GFC_REAL_10
|
|
450 #define GFC_DTYPE_REAL_10 ((BT_REAL << GFC_DTYPE_TYPE_SHIFT) \
|
|
451 | (sizeof(GFC_REAL_10) << GFC_DTYPE_SIZE_SHIFT))
|
|
452 #endif
|
|
453 #ifdef HAVE_GFC_REAL_16
|
|
454 #define GFC_DTYPE_REAL_16 ((BT_REAL << GFC_DTYPE_TYPE_SHIFT) \
|
|
455 | (sizeof(GFC_REAL_16) << GFC_DTYPE_SIZE_SHIFT))
|
|
456 #endif
|
|
457
|
|
458 #define GFC_DTYPE_COMPLEX_4 ((BT_COMPLEX << GFC_DTYPE_TYPE_SHIFT) \
|
|
459 | (sizeof(GFC_COMPLEX_4) << GFC_DTYPE_SIZE_SHIFT))
|
|
460 #define GFC_DTYPE_COMPLEX_8 ((BT_COMPLEX << GFC_DTYPE_TYPE_SHIFT) \
|
|
461 | (sizeof(GFC_COMPLEX_8) << GFC_DTYPE_SIZE_SHIFT))
|
|
462 #ifdef HAVE_GFC_COMPLEX_10
|
|
463 #define GFC_DTYPE_COMPLEX_10 ((BT_COMPLEX << GFC_DTYPE_TYPE_SHIFT) \
|
|
464 | (sizeof(GFC_COMPLEX_10) << GFC_DTYPE_SIZE_SHIFT))
|
|
465 #endif
|
|
466 #ifdef HAVE_GFC_COMPLEX_16
|
|
467 #define GFC_DTYPE_COMPLEX_16 ((BT_COMPLEX << GFC_DTYPE_TYPE_SHIFT) \
|
|
468 | (sizeof(GFC_COMPLEX_16) << GFC_DTYPE_SIZE_SHIFT))
|
|
469 #endif
|
|
470
|
|
471 #define GFC_DTYPE_DERIVED_1 ((BT_DERIVED << GFC_DTYPE_TYPE_SHIFT) \
|
|
472 | (sizeof(GFC_INTEGER_1) << GFC_DTYPE_SIZE_SHIFT))
|
|
473 #define GFC_DTYPE_DERIVED_2 ((BT_DERIVED << GFC_DTYPE_TYPE_SHIFT) \
|
|
474 | (sizeof(GFC_INTEGER_2) << GFC_DTYPE_SIZE_SHIFT))
|
|
475 #define GFC_DTYPE_DERIVED_4 ((BT_DERIVED << GFC_DTYPE_TYPE_SHIFT) \
|
|
476 | (sizeof(GFC_INTEGER_4) << GFC_DTYPE_SIZE_SHIFT))
|
|
477 #define GFC_DTYPE_DERIVED_8 ((BT_DERIVED << GFC_DTYPE_TYPE_SHIFT) \
|
|
478 | (sizeof(GFC_INTEGER_8) << GFC_DTYPE_SIZE_SHIFT))
|
|
479 #ifdef HAVE_GFC_INTEGER_16
|
|
480 #define GFC_DTYPE_DERIVED_16 ((BT_DERIVED << GFC_DTYPE_TYPE_SHIFT) \
|
|
481 | (sizeof(GFC_INTEGER_16) << GFC_DTYPE_SIZE_SHIFT))
|
|
482 #endif
|
|
483
|
|
484 /* Macros to determine the alignment of pointers. */
|
|
485
|
|
486 #define GFC_UNALIGNED_2(x) (((uintptr_t)(x)) & \
|
|
487 (__alignof__(GFC_INTEGER_2) - 1))
|
|
488 #define GFC_UNALIGNED_4(x) (((uintptr_t)(x)) & \
|
|
489 (__alignof__(GFC_INTEGER_4) - 1))
|
|
490 #define GFC_UNALIGNED_8(x) (((uintptr_t)(x)) & \
|
|
491 (__alignof__(GFC_INTEGER_8) - 1))
|
|
492 #ifdef HAVE_GFC_INTEGER_16
|
|
493 #define GFC_UNALIGNED_16(x) (((uintptr_t)(x)) & \
|
|
494 (__alignof__(GFC_INTEGER_16) - 1))
|
|
495 #endif
|
|
496
|
|
497 #define GFC_UNALIGNED_C4(x) (((uintptr_t)(x)) & \
|
|
498 (__alignof__(GFC_COMPLEX_4) - 1))
|
|
499
|
|
500 #define GFC_UNALIGNED_C8(x) (((uintptr_t)(x)) & \
|
|
501 (__alignof__(GFC_COMPLEX_8) - 1))
|
|
502
|
|
503 /* Runtime library include. */
|
|
504 #define stringize(x) expand_macro(x)
|
|
505 #define expand_macro(x) # x
|
|
506
|
|
507 /* Runtime options structure. */
|
|
508
|
|
509 typedef struct
|
|
510 {
|
|
511 int stdin_unit, stdout_unit, stderr_unit, optional_plus;
|
|
512 int locus;
|
|
513
|
|
514 int separator_len;
|
|
515 const char *separator;
|
|
516
|
|
517 int all_unbuffered, unbuffered_preconnected, default_recl;
|
|
518 int fpe, backtrace;
|
|
519 }
|
|
520 options_t;
|
|
521
|
|
522 extern options_t options;
|
|
523 internal_proto(options);
|
|
524
|
|
525 extern void backtrace_handler (int);
|
|
526 internal_proto(backtrace_handler);
|
|
527
|
|
528
|
|
529 /* Compile-time options that will influence the library. */
|
|
530
|
|
531 typedef struct
|
|
532 {
|
|
533 int warn_std;
|
|
534 int allow_std;
|
|
535 int pedantic;
|
|
536 int convert;
|
|
537 int backtrace;
|
|
538 int sign_zero;
|
|
539 size_t record_marker;
|
|
540 int max_subrecord_length;
|
|
541 int bounds_check;
|
|
542 int fpe_summary;
|
|
543 }
|
|
544 compile_options_t;
|
|
545
|
|
546 extern compile_options_t compile_options;
|
|
547 internal_proto(compile_options);
|
|
548
|
|
549 extern void init_compile_options (void);
|
|
550 internal_proto(init_compile_options);
|
|
551
|
|
552 #define GFC_MAX_SUBRECORD_LENGTH 2147483639 /* 2**31 - 9 */
|
|
553
|
|
554 /* Structure for statement options. */
|
|
555
|
|
556 typedef struct
|
|
557 {
|
|
558 const char *name;
|
|
559 int value;
|
|
560 }
|
|
561 st_option;
|
|
562
|
|
563
|
|
564 /* This is returned by notification_std to know if, given the flags
|
|
565 that were given (-std=, -pedantic) we should issue an error, a warning
|
|
566 or nothing. */
|
|
567 typedef enum
|
|
568 { NOTIFICATION_SILENT, NOTIFICATION_WARNING, NOTIFICATION_ERROR }
|
|
569 notification;
|
|
570
|
|
571
|
|
572 /* The filename and line number don't go inside the globals structure.
|
|
573 They are set by the rest of the program and must be linked to. */
|
|
574
|
|
575 /* Location of the current library call (optional). */
|
|
576 extern unsigned line;
|
|
577 iexport_data_proto(line);
|
|
578
|
|
579 extern char *filename;
|
|
580 iexport_data_proto(filename);
|
|
581
|
|
582
|
|
583 /* The default value of record length for preconnected units is defined
|
|
584 here. This value can be overriden by an environment variable.
|
|
585 Default value is 1 Gb. */
|
|
586 #define DEFAULT_RECL 1073741824
|
|
587
|
|
588
|
|
589 #define CHARACTER2(name) \
|
|
590 gfc_charlen_type name ## _len; \
|
|
591 char * name
|
|
592
|
|
593 typedef struct st_parameter_common
|
|
594 {
|
|
595 GFC_INTEGER_4 flags;
|
|
596 GFC_INTEGER_4 unit;
|
|
597 const char *filename;
|
|
598 GFC_INTEGER_4 line;
|
|
599 CHARACTER2 (iomsg);
|
|
600 GFC_INTEGER_4 *iostat;
|
|
601 }
|
|
602 st_parameter_common;
|
|
603
|
|
604 #undef CHARACTER2
|
|
605
|
|
606 #define IOPARM_LIBRETURN_MASK (3 << 0)
|
|
607 #define IOPARM_LIBRETURN_OK (0 << 0)
|
|
608 #define IOPARM_LIBRETURN_ERROR (1 << 0)
|
|
609 #define IOPARM_LIBRETURN_END (2 << 0)
|
|
610 #define IOPARM_LIBRETURN_EOR (3 << 0)
|
|
611 #define IOPARM_ERR (1 << 2)
|
|
612 #define IOPARM_END (1 << 3)
|
|
613 #define IOPARM_EOR (1 << 4)
|
|
614 #define IOPARM_HAS_IOSTAT (1 << 5)
|
|
615 #define IOPARM_HAS_IOMSG (1 << 6)
|
|
616
|
|
617 #define IOPARM_COMMON_MASK ((1 << 7) - 1)
|
|
618
|
|
619 /* Make sure to keep in sync with io/io.h (st_parameter_open). */
|
|
620 #define IOPARM_OPEN_HAS_RECL_IN (1 << 7)
|
|
621 #define IOPARM_OPEN_HAS_FILE (1 << 8)
|
|
622 #define IOPARM_OPEN_HAS_STATUS (1 << 9)
|
|
623 #define IOPARM_OPEN_HAS_ACCESS (1 << 10)
|
|
624 #define IOPARM_OPEN_HAS_FORM (1 << 11)
|
|
625 #define IOPARM_OPEN_HAS_BLANK (1 << 12)
|
|
626 #define IOPARM_OPEN_HAS_POSITION (1 << 13)
|
|
627 #define IOPARM_OPEN_HAS_ACTION (1 << 14)
|
|
628 #define IOPARM_OPEN_HAS_DELIM (1 << 15)
|
|
629 #define IOPARM_OPEN_HAS_PAD (1 << 16)
|
|
630 #define IOPARM_OPEN_HAS_CONVERT (1 << 17)
|
|
631 #define IOPARM_OPEN_HAS_DECIMAL (1 << 18)
|
|
632 #define IOPARM_OPEN_HAS_ENCODING (1 << 19)
|
|
633 #define IOPARM_OPEN_HAS_ROUND (1 << 20)
|
|
634 #define IOPARM_OPEN_HAS_SIGN (1 << 21)
|
|
635 #define IOPARM_OPEN_HAS_ASYNCHRONOUS (1 << 22)
|
|
636 #define IOPARM_OPEN_HAS_NEWUNIT (1 << 23)
|
|
637 #define IOPARM_OPEN_HAS_READONLY (1 << 24)
|
|
638 #define IOPARM_OPEN_HAS_CC (1 << 25)
|
|
639 #define IOPARM_OPEN_HAS_SHARE (1 << 26)
|
|
640
|
|
641 /* library start function and end macro. These can be expanded if needed
|
|
642 in the future. cmp is st_parameter_common *cmp */
|
|
643
|
|
644 extern void library_start (st_parameter_common *);
|
|
645 internal_proto(library_start);
|
|
646
|
|
647 #define library_end()
|
|
648
|
|
649 /* main.c */
|
|
650
|
|
651 extern void stupid_function_name_for_static_linking (void);
|
|
652 internal_proto(stupid_function_name_for_static_linking);
|
|
653
|
|
654 extern void set_args (int, char **);
|
|
655 iexport_proto(set_args);
|
|
656
|
|
657 extern void get_args (int *, char ***);
|
|
658 internal_proto(get_args);
|
|
659
|
|
660 /* backtrace.c */
|
|
661
|
|
662 extern void show_backtrace (bool);
|
|
663 internal_proto(show_backtrace);
|
|
664
|
|
665
|
|
666 /* error.c */
|
|
667
|
|
668 #if defined(HAVE_GFC_REAL_16)
|
|
669 #define GFC_LARGEST_BUF (sizeof (GFC_REAL_16))
|
|
670 #elif defined(HAVE_GFC_INTEGER_16)
|
|
671 #define GFC_LARGEST_BUF (sizeof (GFC_INTEGER_LARGEST))
|
|
672 #elif defined(HAVE_GFC_REAL_10)
|
|
673 #define GFC_LARGEST_BUF (sizeof (GFC_REAL_10))
|
|
674 #else
|
|
675 #define GFC_LARGEST_BUF (sizeof (GFC_INTEGER_LARGEST))
|
|
676 #endif
|
|
677
|
|
678 #define GFC_ITOA_BUF_SIZE (sizeof (GFC_INTEGER_LARGEST) * 3 + 2)
|
|
679 #define GFC_XTOA_BUF_SIZE (GFC_LARGEST_BUF * 2 + 1)
|
|
680 #define GFC_OTOA_BUF_SIZE (GFC_LARGEST_BUF * 3 + 1)
|
|
681 #define GFC_BTOA_BUF_SIZE (GFC_LARGEST_BUF * 8 + 1)
|
|
682
|
|
683 extern _Noreturn void sys_abort (void);
|
|
684 internal_proto(sys_abort);
|
|
685
|
|
686 extern _Noreturn void exit_error (int);
|
|
687 internal_proto(exit_error);
|
|
688
|
|
689 extern ssize_t estr_write (const char *);
|
|
690 internal_proto(estr_write);
|
|
691
|
|
692 extern int st_vprintf (const char *, va_list);
|
|
693 internal_proto(st_vprintf);
|
|
694
|
|
695 extern int st_printf (const char *, ...)
|
|
696 __attribute__((format (gfc_printf, 1, 2)));
|
|
697 internal_proto(st_printf);
|
|
698
|
|
699 extern const char *gfc_xtoa (GFC_UINTEGER_LARGEST, char *, size_t);
|
|
700 internal_proto(gfc_xtoa);
|
|
701
|
|
702 extern _Noreturn void os_error (const char *);
|
|
703 iexport_proto(os_error);
|
|
704
|
|
705 extern void show_locus (st_parameter_common *);
|
|
706 internal_proto(show_locus);
|
|
707
|
|
708 extern _Noreturn void runtime_error (const char *, ...)
|
|
709 __attribute__ ((format (gfc_printf, 1, 2)));
|
|
710 iexport_proto(runtime_error);
|
|
711
|
|
712 extern _Noreturn void runtime_error_at (const char *, const char *, ...)
|
|
713 __attribute__ ((format (gfc_printf, 2, 3)));
|
|
714 iexport_proto(runtime_error_at);
|
|
715
|
|
716 extern void runtime_warning_at (const char *, const char *, ...)
|
|
717 __attribute__ ((format (gfc_printf, 2, 3)));
|
|
718 iexport_proto(runtime_warning_at);
|
|
719
|
|
720 extern _Noreturn void internal_error (st_parameter_common *, const char *);
|
|
721 internal_proto(internal_error);
|
|
722
|
|
723 extern const char *translate_error (int);
|
|
724 internal_proto(translate_error);
|
|
725
|
|
726 extern void generate_error (st_parameter_common *, int, const char *);
|
|
727 iexport_proto(generate_error);
|
|
728
|
|
729 extern void generate_warning (st_parameter_common *, const char *);
|
|
730 internal_proto(generate_warning);
|
|
731
|
|
732 extern bool notify_std (st_parameter_common *, int, const char *);
|
|
733 internal_proto(notify_std);
|
|
734
|
|
735 extern notification notification_std(int);
|
|
736 internal_proto(notification_std);
|
|
737
|
|
738 extern char *gf_strerror (int, char *, size_t);
|
|
739 internal_proto(gf_strerror);
|
|
740
|
|
741 /* fpu.c */
|
|
742
|
|
743 extern void set_fpu (void);
|
|
744 internal_proto(set_fpu);
|
|
745
|
|
746 extern int get_fpu_trap_exceptions (void);
|
|
747 internal_proto(get_fpu_trap_exceptions);
|
|
748
|
|
749 extern void set_fpu_trap_exceptions (int, int);
|
|
750 internal_proto(set_fpu_trap_exceptions);
|
|
751
|
|
752 extern int support_fpu_trap (int);
|
|
753 internal_proto(support_fpu_trap);
|
|
754
|
|
755 extern int get_fpu_except_flags (void);
|
|
756 internal_proto(get_fpu_except_flags);
|
|
757
|
|
758 extern void set_fpu_except_flags (int, int);
|
|
759 internal_proto(set_fpu_except_flags);
|
|
760
|
|
761 extern int support_fpu_flag (int);
|
|
762 internal_proto(support_fpu_flag);
|
|
763
|
|
764 extern void set_fpu_rounding_mode (int);
|
|
765 internal_proto(set_fpu_rounding_mode);
|
|
766
|
|
767 extern int get_fpu_rounding_mode (void);
|
|
768 internal_proto(get_fpu_rounding_mode);
|
|
769
|
|
770 extern int support_fpu_rounding_mode (int);
|
|
771 internal_proto(support_fpu_rounding_mode);
|
|
772
|
|
773 extern void get_fpu_state (void *);
|
|
774 internal_proto(get_fpu_state);
|
|
775
|
|
776 extern void set_fpu_state (void *);
|
|
777 internal_proto(set_fpu_state);
|
|
778
|
|
779 extern int get_fpu_underflow_mode (void);
|
|
780 internal_proto(get_fpu_underflow_mode);
|
|
781
|
|
782 extern void set_fpu_underflow_mode (int);
|
|
783 internal_proto(set_fpu_underflow_mode);
|
|
784
|
|
785 extern int support_fpu_underflow_control (int);
|
|
786 internal_proto(support_fpu_underflow_control);
|
|
787
|
|
788 /* memory.c */
|
|
789
|
|
790 extern void *xmalloc (size_t) __attribute__ ((malloc));
|
|
791 internal_proto(xmalloc);
|
|
792
|
|
793 extern void *xmallocarray (size_t, size_t) __attribute__ ((malloc));
|
|
794 internal_proto(xmallocarray);
|
|
795
|
|
796 extern void *xcalloc (size_t, size_t) __attribute__ ((malloc));
|
|
797 internal_proto(xcalloc);
|
|
798
|
|
799 extern void *xrealloc (void *, size_t);
|
|
800 internal_proto(xrealloc);
|
|
801
|
|
802 /* environ.c */
|
|
803
|
|
804 extern void init_variables (void);
|
|
805 internal_proto(init_variables);
|
|
806
|
|
807 unit_convert get_unformatted_convert (int);
|
|
808 internal_proto(get_unformatted_convert);
|
|
809
|
|
810 /* Secure getenv() which returns NULL if running as SUID/SGID. */
|
|
811 #ifndef HAVE_SECURE_GETENV
|
|
812 #if defined(HAVE_GETUID) && defined(HAVE_GETEUID) \
|
|
813 && defined(HAVE_GETGID) && defined(HAVE_GETEGID)
|
|
814 #define FALLBACK_SECURE_GETENV
|
|
815 extern char *secure_getenv (const char *);
|
|
816 internal_proto(secure_getenv);
|
|
817 #else
|
|
818 #define secure_getenv getenv
|
|
819 #endif
|
|
820 #endif
|
|
821
|
|
822 /* string.c */
|
|
823
|
|
824 extern int find_option (st_parameter_common *, const char *, gfc_charlen_type,
|
|
825 const st_option *, const char *);
|
|
826 internal_proto(find_option);
|
|
827
|
|
828 extern gfc_charlen_type fstrlen (const char *, gfc_charlen_type);
|
|
829 internal_proto(fstrlen);
|
|
830
|
|
831 extern gfc_charlen_type fstrcpy (char *, gfc_charlen_type, const char *, gfc_charlen_type);
|
|
832 internal_proto(fstrcpy);
|
|
833
|
|
834 extern gfc_charlen_type cf_strcpy (char *, gfc_charlen_type, const char *);
|
|
835 internal_proto(cf_strcpy);
|
|
836
|
|
837 extern gfc_charlen_type string_len_trim (gfc_charlen_type, const char *);
|
|
838 export_proto(string_len_trim);
|
|
839
|
|
840 extern gfc_charlen_type string_len_trim_char4 (gfc_charlen_type,
|
|
841 const gfc_char4_t *);
|
|
842 export_proto(string_len_trim_char4);
|
|
843
|
|
844 extern char *fc_strdup(const char *, gfc_charlen_type);
|
|
845 internal_proto(fc_strdup);
|
|
846
|
|
847 extern char *fc_strdup_notrim(const char *, gfc_charlen_type);
|
|
848 internal_proto(fc_strdup_notrim);
|
|
849
|
|
850 extern const char *gfc_itoa(GFC_INTEGER_LARGEST, char *, size_t);
|
|
851 internal_proto(gfc_itoa);
|
|
852
|
|
853 /* io/intrinsics.c */
|
|
854
|
|
855 extern void flush_all_units (void);
|
|
856 internal_proto(flush_all_units);
|
|
857
|
|
858 /* io.c */
|
|
859
|
|
860 extern void init_units (void);
|
|
861 internal_proto(init_units);
|
|
862
|
|
863 extern void close_units (void);
|
|
864 internal_proto(close_units);
|
|
865
|
|
866 extern int unit_to_fd (int);
|
|
867 internal_proto(unit_to_fd);
|
|
868
|
|
869 extern char * filename_from_unit (int);
|
|
870 internal_proto(filename_from_unit);
|
|
871
|
|
872 /* stop.c */
|
|
873
|
|
874 extern _Noreturn void stop_string (const char *, GFC_INTEGER_4);
|
|
875 export_proto(stop_string);
|
|
876
|
|
877 /* reshape_packed.c */
|
|
878
|
|
879 extern void reshape_packed (char *, index_type, const char *, index_type,
|
|
880 const char *, index_type);
|
|
881 internal_proto(reshape_packed);
|
|
882
|
|
883 /* Repacking functions. These are called internally by internal_pack
|
|
884 and internal_unpack. */
|
|
885
|
|
886 GFC_INTEGER_1 *internal_pack_1 (gfc_array_i1 *);
|
|
887 internal_proto(internal_pack_1);
|
|
888
|
|
889 GFC_INTEGER_2 *internal_pack_2 (gfc_array_i2 *);
|
|
890 internal_proto(internal_pack_2);
|
|
891
|
|
892 GFC_INTEGER_4 *internal_pack_4 (gfc_array_i4 *);
|
|
893 internal_proto(internal_pack_4);
|
|
894
|
|
895 GFC_INTEGER_8 *internal_pack_8 (gfc_array_i8 *);
|
|
896 internal_proto(internal_pack_8);
|
|
897
|
|
898 #if defined HAVE_GFC_INTEGER_16
|
|
899 GFC_INTEGER_16 *internal_pack_16 (gfc_array_i16 *);
|
|
900 internal_proto(internal_pack_16);
|
|
901 #endif
|
|
902
|
|
903 GFC_REAL_4 *internal_pack_r4 (gfc_array_r4 *);
|
|
904 internal_proto(internal_pack_r4);
|
|
905
|
|
906 GFC_REAL_8 *internal_pack_r8 (gfc_array_r8 *);
|
|
907 internal_proto(internal_pack_r8);
|
|
908
|
|
909 #if defined HAVE_GFC_REAL_10
|
|
910 GFC_REAL_10 *internal_pack_r10 (gfc_array_r10 *);
|
|
911 internal_proto(internal_pack_r10);
|
|
912 #endif
|
|
913
|
|
914 #if defined HAVE_GFC_REAL_16
|
|
915 GFC_REAL_16 *internal_pack_r16 (gfc_array_r16 *);
|
|
916 internal_proto(internal_pack_r16);
|
|
917 #endif
|
|
918
|
|
919 GFC_COMPLEX_4 *internal_pack_c4 (gfc_array_c4 *);
|
|
920 internal_proto(internal_pack_c4);
|
|
921
|
|
922 GFC_COMPLEX_8 *internal_pack_c8 (gfc_array_c8 *);
|
|
923 internal_proto(internal_pack_c8);
|
|
924
|
|
925 #if defined HAVE_GFC_COMPLEX_10
|
|
926 GFC_COMPLEX_10 *internal_pack_c10 (gfc_array_c10 *);
|
|
927 internal_proto(internal_pack_c10);
|
|
928 #endif
|
|
929
|
|
930 #if defined HAVE_GFC_COMPLEX_16
|
|
931 GFC_COMPLEX_16 *internal_pack_c16 (gfc_array_c16 *);
|
|
932 internal_proto(internal_pack_c16);
|
|
933 #endif
|
|
934
|
|
935 extern void internal_unpack_1 (gfc_array_i1 *, const GFC_INTEGER_1 *);
|
|
936 internal_proto(internal_unpack_1);
|
|
937
|
|
938 extern void internal_unpack_2 (gfc_array_i2 *, const GFC_INTEGER_2 *);
|
|
939 internal_proto(internal_unpack_2);
|
|
940
|
|
941 extern void internal_unpack_4 (gfc_array_i4 *, const GFC_INTEGER_4 *);
|
|
942 internal_proto(internal_unpack_4);
|
|
943
|
|
944 extern void internal_unpack_8 (gfc_array_i8 *, const GFC_INTEGER_8 *);
|
|
945 internal_proto(internal_unpack_8);
|
|
946
|
|
947 #if defined HAVE_GFC_INTEGER_16
|
|
948 extern void internal_unpack_16 (gfc_array_i16 *, const GFC_INTEGER_16 *);
|
|
949 internal_proto(internal_unpack_16);
|
|
950 #endif
|
|
951
|
|
952 extern void internal_unpack_r4 (gfc_array_r4 *, const GFC_REAL_4 *);
|
|
953 internal_proto(internal_unpack_r4);
|
|
954
|
|
955 extern void internal_unpack_r8 (gfc_array_r8 *, const GFC_REAL_8 *);
|
|
956 internal_proto(internal_unpack_r8);
|
|
957
|
|
958 #if defined HAVE_GFC_REAL_10
|
|
959 extern void internal_unpack_r10 (gfc_array_r10 *, const GFC_REAL_10 *);
|
|
960 internal_proto(internal_unpack_r10);
|
|
961 #endif
|
|
962
|
|
963 #if defined HAVE_GFC_REAL_16
|
|
964 extern void internal_unpack_r16 (gfc_array_r16 *, const GFC_REAL_16 *);
|
|
965 internal_proto(internal_unpack_r16);
|
|
966 #endif
|
|
967
|
|
968 extern void internal_unpack_c4 (gfc_array_c4 *, const GFC_COMPLEX_4 *);
|
|
969 internal_proto(internal_unpack_c4);
|
|
970
|
|
971 extern void internal_unpack_c8 (gfc_array_c8 *, const GFC_COMPLEX_8 *);
|
|
972 internal_proto(internal_unpack_c8);
|
|
973
|
|
974 #if defined HAVE_GFC_COMPLEX_10
|
|
975 extern void internal_unpack_c10 (gfc_array_c10 *, const GFC_COMPLEX_10 *);
|
|
976 internal_proto(internal_unpack_c10);
|
|
977 #endif
|
|
978
|
|
979 #if defined HAVE_GFC_COMPLEX_16
|
|
980 extern void internal_unpack_c16 (gfc_array_c16 *, const GFC_COMPLEX_16 *);
|
|
981 internal_proto(internal_unpack_c16);
|
|
982 #endif
|
|
983
|
|
984 /* Internal auxiliary functions for the pack intrinsic. */
|
|
985
|
|
986 extern void pack_i1 (gfc_array_i1 *, const gfc_array_i1 *,
|
|
987 const gfc_array_l1 *, const gfc_array_i1 *);
|
|
988 internal_proto(pack_i1);
|
|
989
|
|
990 extern void pack_i2 (gfc_array_i2 *, const gfc_array_i2 *,
|
|
991 const gfc_array_l1 *, const gfc_array_i2 *);
|
|
992 internal_proto(pack_i2);
|
|
993
|
|
994 extern void pack_i4 (gfc_array_i4 *, const gfc_array_i4 *,
|
|
995 const gfc_array_l1 *, const gfc_array_i4 *);
|
|
996 internal_proto(pack_i4);
|
|
997
|
|
998 extern void pack_i8 (gfc_array_i8 *, const gfc_array_i8 *,
|
|
999 const gfc_array_l1 *, const gfc_array_i8 *);
|
|
1000 internal_proto(pack_i8);
|
|
1001
|
|
1002 #ifdef HAVE_GFC_INTEGER_16
|
|
1003 extern void pack_i16 (gfc_array_i16 *, const gfc_array_i16 *,
|
|
1004 const gfc_array_l1 *, const gfc_array_i16 *);
|
|
1005 internal_proto(pack_i16);
|
|
1006 #endif
|
|
1007
|
|
1008 extern void pack_r4 (gfc_array_r4 *, const gfc_array_r4 *,
|
|
1009 const gfc_array_l1 *, const gfc_array_r4 *);
|
|
1010 internal_proto(pack_r4);
|
|
1011
|
|
1012 extern void pack_r8 (gfc_array_r8 *, const gfc_array_r8 *,
|
|
1013 const gfc_array_l1 *, const gfc_array_r8 *);
|
|
1014 internal_proto(pack_r8);
|
|
1015
|
|
1016 #ifdef HAVE_GFC_REAL_10
|
|
1017 extern void pack_r10 (gfc_array_r10 *, const gfc_array_r10 *,
|
|
1018 const gfc_array_l1 *, const gfc_array_r10 *);
|
|
1019 internal_proto(pack_r10);
|
|
1020 #endif
|
|
1021
|
|
1022 #ifdef HAVE_GFC_REAL_16
|
|
1023 extern void pack_r16 (gfc_array_r16 *, const gfc_array_r16 *,
|
|
1024 const gfc_array_l1 *, const gfc_array_r16 *);
|
|
1025 internal_proto(pack_r16);
|
|
1026 #endif
|
|
1027
|
|
1028 extern void pack_c4 (gfc_array_c4 *, const gfc_array_c4 *,
|
|
1029 const gfc_array_l1 *, const gfc_array_c4 *);
|
|
1030 internal_proto(pack_c4);
|
|
1031
|
|
1032 extern void pack_c8 (gfc_array_c8 *, const gfc_array_c8 *,
|
|
1033 const gfc_array_l1 *, const gfc_array_c8 *);
|
|
1034 internal_proto(pack_c8);
|
|
1035
|
|
1036 #ifdef HAVE_GFC_REAL_10
|
|
1037 extern void pack_c10 (gfc_array_c10 *, const gfc_array_c10 *,
|
|
1038 const gfc_array_l1 *, const gfc_array_c10 *);
|
|
1039 internal_proto(pack_c10);
|
|
1040 #endif
|
|
1041
|
|
1042 #ifdef HAVE_GFC_REAL_16
|
|
1043 extern void pack_c16 (gfc_array_c16 *, const gfc_array_c16 *,
|
|
1044 const gfc_array_l1 *, const gfc_array_c16 *);
|
|
1045 internal_proto(pack_c16);
|
|
1046 #endif
|
|
1047
|
|
1048 /* Internal auxiliary functions for the unpack intrinsic. */
|
|
1049
|
|
1050 extern void unpack0_i1 (gfc_array_i1 *, const gfc_array_i1 *,
|
|
1051 const gfc_array_l1 *, const GFC_INTEGER_1 *);
|
|
1052 internal_proto(unpack0_i1);
|
|
1053
|
|
1054 extern void unpack0_i2 (gfc_array_i2 *, const gfc_array_i2 *,
|
|
1055 const gfc_array_l1 *, const GFC_INTEGER_2 *);
|
|
1056 internal_proto(unpack0_i2);
|
|
1057
|
|
1058 extern void unpack0_i4 (gfc_array_i4 *, const gfc_array_i4 *,
|
|
1059 const gfc_array_l1 *, const GFC_INTEGER_4 *);
|
|
1060 internal_proto(unpack0_i4);
|
|
1061
|
|
1062 extern void unpack0_i8 (gfc_array_i8 *, const gfc_array_i8 *,
|
|
1063 const gfc_array_l1 *, const GFC_INTEGER_8 *);
|
|
1064 internal_proto(unpack0_i8);
|
|
1065
|
|
1066 #ifdef HAVE_GFC_INTEGER_16
|
|
1067
|
|
1068 extern void unpack0_i16 (gfc_array_i16 *, const gfc_array_i16 *,
|
|
1069 const gfc_array_l1 *, const GFC_INTEGER_16 *);
|
|
1070 internal_proto(unpack0_i16);
|
|
1071
|
|
1072 #endif
|
|
1073
|
|
1074 extern void unpack0_r4 (gfc_array_r4 *, const gfc_array_r4 *,
|
|
1075 const gfc_array_l1 *, const GFC_REAL_4 *);
|
|
1076 internal_proto(unpack0_r4);
|
|
1077
|
|
1078 extern void unpack0_r8 (gfc_array_r8 *, const gfc_array_r8 *,
|
|
1079 const gfc_array_l1 *, const GFC_REAL_8 *);
|
|
1080 internal_proto(unpack0_r8);
|
|
1081
|
|
1082 #ifdef HAVE_GFC_REAL_10
|
|
1083
|
|
1084 extern void unpack0_r10 (gfc_array_r10 *, const gfc_array_r10 *,
|
|
1085 const gfc_array_l1 *, const GFC_REAL_10 *);
|
|
1086 internal_proto(unpack0_r10);
|
|
1087
|
|
1088 #endif
|
|
1089
|
|
1090 #ifdef HAVE_GFC_REAL_16
|
|
1091
|
|
1092 extern void unpack0_r16 (gfc_array_r16 *, const gfc_array_r16 *,
|
|
1093 const gfc_array_l1 *, const GFC_REAL_16 *);
|
|
1094 internal_proto(unpack0_r16);
|
|
1095
|
|
1096 #endif
|
|
1097
|
|
1098 extern void unpack0_c4 (gfc_array_c4 *, const gfc_array_c4 *,
|
|
1099 const gfc_array_l1 *, const GFC_COMPLEX_4 *);
|
|
1100 internal_proto(unpack0_c4);
|
|
1101
|
|
1102 extern void unpack0_c8 (gfc_array_c8 *, const gfc_array_c8 *,
|
|
1103 const gfc_array_l1 *, const GFC_COMPLEX_8 *);
|
|
1104 internal_proto(unpack0_c8);
|
|
1105
|
|
1106 #ifdef HAVE_GFC_COMPLEX_10
|
|
1107
|
|
1108 extern void unpack0_c10 (gfc_array_c10 *, const gfc_array_c10 *,
|
|
1109 const gfc_array_l1 *mask, const GFC_COMPLEX_10 *);
|
|
1110 internal_proto(unpack0_c10);
|
|
1111
|
|
1112 #endif
|
|
1113
|
|
1114 #ifdef HAVE_GFC_COMPLEX_16
|
|
1115
|
|
1116 extern void unpack0_c16 (gfc_array_c16 *, const gfc_array_c16 *,
|
|
1117 const gfc_array_l1 *, const GFC_COMPLEX_16 *);
|
|
1118 internal_proto(unpack0_c16);
|
|
1119
|
|
1120 #endif
|
|
1121
|
|
1122 extern void unpack1_i1 (gfc_array_i1 *, const gfc_array_i1 *,
|
|
1123 const gfc_array_l1 *, const gfc_array_i1 *);
|
|
1124 internal_proto(unpack1_i1);
|
|
1125
|
|
1126 extern void unpack1_i2 (gfc_array_i2 *, const gfc_array_i2 *,
|
|
1127 const gfc_array_l1 *, const gfc_array_i2 *);
|
|
1128 internal_proto(unpack1_i2);
|
|
1129
|
|
1130 extern void unpack1_i4 (gfc_array_i4 *, const gfc_array_i4 *,
|
|
1131 const gfc_array_l1 *, const gfc_array_i4 *);
|
|
1132 internal_proto(unpack1_i4);
|
|
1133
|
|
1134 extern void unpack1_i8 (gfc_array_i8 *, const gfc_array_i8 *,
|
|
1135 const gfc_array_l1 *, const gfc_array_i8 *);
|
|
1136 internal_proto(unpack1_i8);
|
|
1137
|
|
1138 #ifdef HAVE_GFC_INTEGER_16
|
|
1139 extern void unpack1_i16 (gfc_array_i16 *, const gfc_array_i16 *,
|
|
1140 const gfc_array_l1 *, const gfc_array_i16 *);
|
|
1141 internal_proto(unpack1_i16);
|
|
1142 #endif
|
|
1143
|
|
1144 extern void unpack1_r4 (gfc_array_r4 *, const gfc_array_r4 *,
|
|
1145 const gfc_array_l1 *, const gfc_array_r4 *);
|
|
1146 internal_proto(unpack1_r4);
|
|
1147
|
|
1148 extern void unpack1_r8 (gfc_array_r8 *, const gfc_array_r8 *,
|
|
1149 const gfc_array_l1 *, const gfc_array_r8 *);
|
|
1150 internal_proto(unpack1_r8);
|
|
1151
|
|
1152 #ifdef HAVE_GFC_REAL_10
|
|
1153 extern void unpack1_r10 (gfc_array_r10 *, const gfc_array_r10 *,
|
|
1154 const gfc_array_l1 *, const gfc_array_r10 *);
|
|
1155 internal_proto(unpack1_r10);
|
|
1156 #endif
|
|
1157
|
|
1158 #ifdef HAVE_GFC_REAL_16
|
|
1159 extern void unpack1_r16 (gfc_array_r16 *, const gfc_array_r16 *,
|
|
1160 const gfc_array_l1 *, const gfc_array_r16 *);
|
|
1161 internal_proto(unpack1_r16);
|
|
1162 #endif
|
|
1163
|
|
1164 extern void unpack1_c4 (gfc_array_c4 *, const gfc_array_c4 *,
|
|
1165 const gfc_array_l1 *, const gfc_array_c4 *);
|
|
1166 internal_proto(unpack1_c4);
|
|
1167
|
|
1168 extern void unpack1_c8 (gfc_array_c8 *, const gfc_array_c8 *,
|
|
1169 const gfc_array_l1 *, const gfc_array_c8 *);
|
|
1170 internal_proto(unpack1_c8);
|
|
1171
|
|
1172 #ifdef HAVE_GFC_COMPLEX_10
|
|
1173 extern void unpack1_c10 (gfc_array_c10 *, const gfc_array_c10 *,
|
|
1174 const gfc_array_l1 *, const gfc_array_c10 *);
|
|
1175 internal_proto(unpack1_c10);
|
|
1176 #endif
|
|
1177
|
|
1178 #ifdef HAVE_GFC_COMPLEX_16
|
|
1179 extern void unpack1_c16 (gfc_array_c16 *, const gfc_array_c16 *,
|
|
1180 const gfc_array_l1 *, const gfc_array_c16 *);
|
|
1181 internal_proto(unpack1_c16);
|
|
1182 #endif
|
|
1183
|
|
1184 /* Helper functions for spread. */
|
|
1185
|
|
1186 extern void spread_i1 (gfc_array_i1 *, const gfc_array_i1 *,
|
|
1187 const index_type, const index_type);
|
|
1188 internal_proto(spread_i1);
|
|
1189
|
|
1190 extern void spread_i2 (gfc_array_i2 *, const gfc_array_i2 *,
|
|
1191 const index_type, const index_type);
|
|
1192 internal_proto(spread_i2);
|
|
1193
|
|
1194 extern void spread_i4 (gfc_array_i4 *, const gfc_array_i4 *,
|
|
1195 const index_type, const index_type);
|
|
1196 internal_proto(spread_i4);
|
|
1197
|
|
1198 extern void spread_i8 (gfc_array_i8 *, const gfc_array_i8 *,
|
|
1199 const index_type, const index_type);
|
|
1200 internal_proto(spread_i8);
|
|
1201
|
|
1202 #ifdef HAVE_GFC_INTEGER_16
|
|
1203 extern void spread_i16 (gfc_array_i16 *, const gfc_array_i16 *,
|
|
1204 const index_type, const index_type);
|
|
1205 internal_proto(spread_i16);
|
|
1206
|
|
1207 #endif
|
|
1208
|
|
1209 extern void spread_r4 (gfc_array_r4 *, const gfc_array_r4 *,
|
|
1210 const index_type, const index_type);
|
|
1211 internal_proto(spread_r4);
|
|
1212
|
|
1213 extern void spread_r8 (gfc_array_r8 *, const gfc_array_r8 *,
|
|
1214 const index_type, const index_type);
|
|
1215 internal_proto(spread_r8);
|
|
1216
|
|
1217 #ifdef HAVE_GFC_REAL_10
|
|
1218 extern void spread_r10 (gfc_array_r10 *, const gfc_array_r10 *,
|
|
1219 const index_type, const index_type);
|
|
1220 internal_proto(spread_r10);
|
|
1221
|
|
1222 #endif
|
|
1223
|
|
1224 #ifdef HAVE_GFC_REAL_16
|
|
1225 extern void spread_r16 (gfc_array_r16 *, const gfc_array_r16 *,
|
|
1226 const index_type, const index_type);
|
|
1227 internal_proto(spread_r16);
|
|
1228
|
|
1229 #endif
|
|
1230
|
|
1231 extern void spread_c4 (gfc_array_c4 *, const gfc_array_c4 *,
|
|
1232 const index_type, const index_type);
|
|
1233 internal_proto(spread_c4);
|
|
1234
|
|
1235 extern void spread_c8 (gfc_array_c8 *, const gfc_array_c8 *,
|
|
1236 const index_type, const index_type);
|
|
1237 internal_proto(spread_c8);
|
|
1238
|
|
1239 #ifdef HAVE_GFC_COMPLEX_10
|
|
1240 extern void spread_c10 (gfc_array_c10 *, const gfc_array_c10 *,
|
|
1241 const index_type, const index_type);
|
|
1242 internal_proto(spread_c10);
|
|
1243
|
|
1244 #endif
|
|
1245
|
|
1246 #ifdef HAVE_GFC_COMPLEX_16
|
|
1247 extern void spread_c16 (gfc_array_c16 *, const gfc_array_c16 *,
|
|
1248 const index_type, const index_type);
|
|
1249 internal_proto(spread_c16);
|
|
1250
|
|
1251 #endif
|
|
1252
|
|
1253 extern void spread_scalar_i1 (gfc_array_i1 *, const GFC_INTEGER_1 *,
|
|
1254 const index_type, const index_type);
|
|
1255 internal_proto(spread_scalar_i1);
|
|
1256
|
|
1257 extern void spread_scalar_i2 (gfc_array_i2 *, const GFC_INTEGER_2 *,
|
|
1258 const index_type, const index_type);
|
|
1259 internal_proto(spread_scalar_i2);
|
|
1260
|
|
1261 extern void spread_scalar_i4 (gfc_array_i4 *, const GFC_INTEGER_4 *,
|
|
1262 const index_type, const index_type);
|
|
1263 internal_proto(spread_scalar_i4);
|
|
1264
|
|
1265 extern void spread_scalar_i8 (gfc_array_i8 *, const GFC_INTEGER_8 *,
|
|
1266 const index_type, const index_type);
|
|
1267 internal_proto(spread_scalar_i8);
|
|
1268
|
|
1269 #ifdef HAVE_GFC_INTEGER_16
|
|
1270 extern void spread_scalar_i16 (gfc_array_i16 *, const GFC_INTEGER_16 *,
|
|
1271 const index_type, const index_type);
|
|
1272 internal_proto(spread_scalar_i16);
|
|
1273
|
|
1274 #endif
|
|
1275
|
|
1276 extern void spread_scalar_r4 (gfc_array_r4 *, const GFC_REAL_4 *,
|
|
1277 const index_type, const index_type);
|
|
1278 internal_proto(spread_scalar_r4);
|
|
1279
|
|
1280 extern void spread_scalar_r8 (gfc_array_r8 *, const GFC_REAL_8 *,
|
|
1281 const index_type, const index_type);
|
|
1282 internal_proto(spread_scalar_r8);
|
|
1283
|
|
1284 #ifdef HAVE_GFC_REAL_10
|
|
1285 extern void spread_scalar_r10 (gfc_array_r10 *, const GFC_REAL_10 *,
|
|
1286 const index_type, const index_type);
|
|
1287 internal_proto(spread_scalar_r10);
|
|
1288
|
|
1289 #endif
|
|
1290
|
|
1291 #ifdef HAVE_GFC_REAL_16
|
|
1292 extern void spread_scalar_r16 (gfc_array_r16 *, const GFC_REAL_16 *,
|
|
1293 const index_type, const index_type);
|
|
1294 internal_proto(spread_scalar_r16);
|
|
1295
|
|
1296 #endif
|
|
1297
|
|
1298 extern void spread_scalar_c4 (gfc_array_c4 *, const GFC_COMPLEX_4 *,
|
|
1299 const index_type, const index_type);
|
|
1300 internal_proto(spread_scalar_c4);
|
|
1301
|
|
1302 extern void spread_scalar_c8 (gfc_array_c8 *, const GFC_COMPLEX_8 *,
|
|
1303 const index_type, const index_type);
|
|
1304 internal_proto(spread_scalar_c8);
|
|
1305
|
|
1306 #ifdef HAVE_GFC_COMPLEX_10
|
|
1307 extern void spread_scalar_c10 (gfc_array_c10 *, const GFC_COMPLEX_10 *,
|
|
1308 const index_type, const index_type);
|
|
1309 internal_proto(spread_scalar_c10);
|
|
1310
|
|
1311 #endif
|
|
1312
|
|
1313 #ifdef HAVE_GFC_COMPLEX_16
|
|
1314 extern void spread_scalar_c16 (gfc_array_c16 *, const GFC_COMPLEX_16 *,
|
|
1315 const index_type, const index_type);
|
|
1316 internal_proto(spread_scalar_c16);
|
|
1317
|
|
1318 #endif
|
|
1319
|
|
1320 /* string_intrinsics.c */
|
|
1321
|
|
1322 extern int compare_string (gfc_charlen_type, const char *,
|
|
1323 gfc_charlen_type, const char *);
|
|
1324 iexport_proto(compare_string);
|
|
1325
|
|
1326 extern int compare_string_char4 (gfc_charlen_type, const gfc_char4_t *,
|
|
1327 gfc_charlen_type, const gfc_char4_t *);
|
|
1328 iexport_proto(compare_string_char4);
|
|
1329
|
|
1330 extern int memcmp_char4 (const void *, const void *, size_t);
|
|
1331 internal_proto(memcmp_char4);
|
|
1332
|
|
1333
|
|
1334 /* random.c */
|
|
1335
|
|
1336 extern void random_seed_i4 (GFC_INTEGER_4 * size, gfc_array_i4 * put,
|
|
1337 gfc_array_i4 * get);
|
|
1338 iexport_proto(random_seed_i4);
|
|
1339 extern void random_seed_i8 (GFC_INTEGER_8 * size, gfc_array_i8 * put,
|
|
1340 gfc_array_i8 * get);
|
|
1341 iexport_proto(random_seed_i8);
|
|
1342
|
|
1343 /* size.c */
|
|
1344
|
|
1345 typedef GFC_ARRAY_DESCRIPTOR (GFC_MAX_DIMENSIONS, void) array_t;
|
|
1346
|
|
1347 extern index_type size0 (const array_t * array);
|
|
1348 iexport_proto(size0);
|
|
1349
|
|
1350 /* bounds.c */
|
|
1351
|
|
1352 extern void bounds_equal_extents (array_t *, array_t *, const char *,
|
|
1353 const char *);
|
|
1354 internal_proto(bounds_equal_extents);
|
|
1355
|
|
1356 extern void bounds_reduced_extents (array_t *, array_t *, int, const char *,
|
|
1357 const char *intrinsic);
|
|
1358 internal_proto(bounds_reduced_extents);
|
|
1359
|
|
1360 extern void bounds_iforeach_return (array_t *, array_t *, const char *);
|
|
1361 internal_proto(bounds_iforeach_return);
|
|
1362
|
|
1363 extern void bounds_ifunction_return (array_t *, const index_type *,
|
|
1364 const char *, const char *);
|
|
1365 internal_proto(bounds_ifunction_return);
|
|
1366
|
|
1367 extern index_type count_0 (const gfc_array_l1 *);
|
|
1368
|
|
1369 internal_proto(count_0);
|
|
1370
|
|
1371 /* Internal auxiliary functions for cshift */
|
|
1372
|
|
1373 void cshift0_i1 (gfc_array_i1 *, const gfc_array_i1 *, ptrdiff_t, int);
|
|
1374 internal_proto(cshift0_i1);
|
|
1375
|
|
1376 void cshift0_i2 (gfc_array_i2 *, const gfc_array_i2 *, ptrdiff_t, int);
|
|
1377 internal_proto(cshift0_i2);
|
|
1378
|
|
1379 void cshift0_i4 (gfc_array_i4 *, const gfc_array_i4 *, ptrdiff_t, int);
|
|
1380 internal_proto(cshift0_i4);
|
|
1381
|
|
1382 void cshift0_i8 (gfc_array_i8 *, const gfc_array_i8 *, ptrdiff_t, int);
|
|
1383 internal_proto(cshift0_i8);
|
|
1384
|
|
1385 #ifdef HAVE_GFC_INTEGER_16
|
|
1386 void cshift0_i16 (gfc_array_i16 *, const gfc_array_i16 *, ptrdiff_t, int);
|
|
1387 internal_proto(cshift0_i16);
|
|
1388 #endif
|
|
1389
|
|
1390 void cshift0_r4 (gfc_array_r4 *, const gfc_array_r4 *, ptrdiff_t, int);
|
|
1391 internal_proto(cshift0_r4);
|
|
1392
|
|
1393 void cshift0_r8 (gfc_array_r8 *, const gfc_array_r8 *, ptrdiff_t, int);
|
|
1394 internal_proto(cshift0_r8);
|
|
1395
|
|
1396 #ifdef HAVE_GFC_REAL_10
|
|
1397 void cshift0_r10 (gfc_array_r10 *, const gfc_array_r10 *, ptrdiff_t, int);
|
|
1398 internal_proto(cshift0_r10);
|
|
1399 #endif
|
|
1400
|
|
1401 #ifdef HAVE_GFC_REAL_16
|
|
1402 void cshift0_r16 (gfc_array_r16 *, const gfc_array_r16 *, ptrdiff_t, int);
|
|
1403 internal_proto(cshift0_r16);
|
|
1404 #endif
|
|
1405
|
|
1406 void cshift0_c4 (gfc_array_c4 *, const gfc_array_c4 *, ptrdiff_t, int);
|
|
1407 internal_proto(cshift0_c4);
|
|
1408
|
|
1409 void cshift0_c8 (gfc_array_c8 *, const gfc_array_c8 *, ptrdiff_t, int);
|
|
1410 internal_proto(cshift0_c8);
|
|
1411
|
|
1412 #ifdef HAVE_GFC_COMPLEX_10
|
|
1413 void cshift0_c10 (gfc_array_c10 *, const gfc_array_c10 *, ptrdiff_t, int);
|
|
1414 internal_proto(cshift0_c10);
|
|
1415 #endif
|
|
1416
|
|
1417 #ifdef HAVE_GFC_COMPLEX_16
|
|
1418 void cshift0_c16 (gfc_array_c16 *, const gfc_array_c16 *, ptrdiff_t, int);
|
|
1419 internal_proto(cshift0_c16);
|
|
1420 #endif
|
|
1421
|
|
1422 #if defined (HAVE_GFC_INTEGER_4) && defined (HAVE_GFC_INTEGER_1)
|
|
1423 void cshift1_4_i1 (gfc_array_i1 * const restrict,
|
|
1424 const gfc_array_i1 * const restrict,
|
|
1425 const gfc_array_i4 * const restrict,
|
|
1426 const GFC_INTEGER_4 * const restrict);
|
|
1427 internal_proto(cshift1_4_i1);
|
|
1428 #endif
|
|
1429
|
|
1430 #if defined (HAVE_GFC_INTEGER_4) && defined (HAVE_GFC_INTEGER_2)
|
|
1431 void cshift1_4_i2 (gfc_array_i2 * const restrict,
|
|
1432 const gfc_array_i2 * const restrict,
|
|
1433 const gfc_array_i4 * const restrict,
|
|
1434 const GFC_INTEGER_4 * const restrict);
|
|
1435 internal_proto(cshift1_4_i2);
|
|
1436 #endif
|
|
1437
|
|
1438 #if defined (HAVE_GFC_INTEGER_4) && defined (HAVE_GFC_INTEGER_4)
|
|
1439 void cshift1_4_i4 (gfc_array_i4 * const restrict,
|
|
1440 const gfc_array_i4 * const restrict,
|
|
1441 const gfc_array_i4 * const restrict,
|
|
1442 const GFC_INTEGER_4 * const restrict);
|
|
1443 internal_proto(cshift1_4_i4);
|
|
1444 #endif
|
|
1445
|
|
1446 #if defined (HAVE_GFC_INTEGER_4) && defined (HAVE_GFC_INTEGER_8)
|
|
1447 void cshift1_4_i8 (gfc_array_i8 * const restrict,
|
|
1448 const gfc_array_i8 * const restrict,
|
|
1449 const gfc_array_i4 * const restrict,
|
|
1450 const GFC_INTEGER_4 * const restrict);
|
|
1451 internal_proto(cshift1_4_i8);
|
|
1452 #endif
|
|
1453
|
|
1454 #if defined (HAVE_GFC_INTEGER_4) && defined (HAVE_GFC_INTEGER_16)
|
|
1455 void cshift1_4_i16 (gfc_array_i16 * const restrict,
|
|
1456 const gfc_array_i16 * const restrict,
|
|
1457 const gfc_array_i4 * const restrict,
|
|
1458 const GFC_INTEGER_4 * const restrict);
|
|
1459 internal_proto(cshift1_4_i16);
|
|
1460 #endif
|
|
1461
|
|
1462 #if defined (HAVE_GFC_INTEGER_8) && defined (HAVE_GFC_INTEGER_1)
|
|
1463 void cshift1_8_i1 (gfc_array_i1 * const restrict,
|
|
1464 const gfc_array_i1 * const restrict,
|
|
1465 const gfc_array_i8 * const restrict,
|
|
1466 const GFC_INTEGER_8 * const restrict);
|
|
1467 internal_proto(cshift1_8_i1);
|
|
1468 #endif
|
|
1469
|
|
1470 #if defined (HAVE_GFC_INTEGER_8) && defined (HAVE_GFC_INTEGER_2)
|
|
1471 void cshift1_8_i2 (gfc_array_i2 * const restrict,
|
|
1472 const gfc_array_i2 * const restrict,
|
|
1473 const gfc_array_i8 * const restrict,
|
|
1474 const GFC_INTEGER_8 * const restrict);
|
|
1475 internal_proto(cshift1_8_i2);
|
|
1476 #endif
|
|
1477
|
|
1478 #if defined (HAVE_GFC_INTEGER_8) && defined (HAVE_GFC_INTEGER_4)
|
|
1479 void cshift1_8_i4 (gfc_array_i4 * const restrict,
|
|
1480 const gfc_array_i4 * const restrict,
|
|
1481 const gfc_array_i8 * const restrict,
|
|
1482 const GFC_INTEGER_8 * const restrict);
|
|
1483 internal_proto(cshift1_8_i4);
|
|
1484 #endif
|
|
1485
|
|
1486 #if defined (HAVE_GFC_INTEGER_8) && defined (HAVE_GFC_INTEGER_8)
|
|
1487 void cshift1_8_i8 (gfc_array_i8 * const restrict,
|
|
1488 const gfc_array_i8 * const restrict,
|
|
1489 const gfc_array_i8 * const restrict,
|
|
1490 const GFC_INTEGER_8 * const restrict);
|
|
1491 internal_proto(cshift1_8_i8);
|
|
1492 #endif
|
|
1493
|
|
1494 #if defined (HAVE_GFC_INTEGER_8) && defined (HAVE_GFC_INTEGER_16)
|
|
1495 void cshift1_8_i16 (gfc_array_i16 * const restrict,
|
|
1496 const gfc_array_i16 * const restrict,
|
|
1497 const gfc_array_i8 * const restrict,
|
|
1498 const GFC_INTEGER_8 * const restrict);
|
|
1499 internal_proto(cshift1_8_i16);
|
|
1500 #endif
|
|
1501
|
|
1502 #if defined (HAVE_GFC_INTEGER_16) && defined (HAVE_GFC_INTEGER_1)
|
|
1503 void cshift1_16_i1 (gfc_array_i1 * const restrict,
|
|
1504 const gfc_array_i1 * const restrict,
|
|
1505 const gfc_array_i16 * const restrict,
|
|
1506 const GFC_INTEGER_16 * const restrict);
|
|
1507 internal_proto(cshift1_16_i1);
|
|
1508 #endif
|
|
1509
|
|
1510 #if defined (HAVE_GFC_INTEGER_16) && defined (HAVE_GFC_INTEGER_2)
|
|
1511 void cshift1_16_i2 (gfc_array_i2 * const restrict,
|
|
1512 const gfc_array_i2 * const restrict,
|
|
1513 const gfc_array_i16 * const restrict,
|
|
1514 const GFC_INTEGER_16 * const restrict);
|
|
1515 internal_proto(cshift1_16_i2);
|
|
1516 #endif
|
|
1517
|
|
1518 #if defined (HAVE_GFC_INTEGER_16) && defined (HAVE_GFC_INTEGER_4)
|
|
1519 void cshift1_16_i4 (gfc_array_i4 * const restrict,
|
|
1520 const gfc_array_i4 * const restrict,
|
|
1521 const gfc_array_i16 * const restrict,
|
|
1522 const GFC_INTEGER_16 * const restrict);
|
|
1523 internal_proto(cshift1_16_i4);
|
|
1524 #endif
|
|
1525
|
|
1526 #if defined (HAVE_GFC_INTEGER_16) && defined (HAVE_GFC_INTEGER_8)
|
|
1527 void cshift1_16_i8 (gfc_array_i8 * const restrict,
|
|
1528 const gfc_array_i8 * const restrict,
|
|
1529 const gfc_array_i16 * const restrict,
|
|
1530 const GFC_INTEGER_16 * const restrict);
|
|
1531 internal_proto(cshift1_16_i8);
|
|
1532 #endif
|
|
1533
|
|
1534 #if defined (HAVE_GFC_INTEGER_16) && defined (HAVE_GFC_INTEGER_16)
|
|
1535 void cshift1_16_i16 (gfc_array_i16 * const restrict,
|
|
1536 const gfc_array_i16 * const restrict,
|
|
1537 const gfc_array_i16 * const restrict,
|
|
1538 const GFC_INTEGER_16 * const restrict);
|
|
1539 internal_proto(cshift1_16_i16);
|
|
1540 #endif
|
|
1541
|
|
1542 #if defined (HAVE_GFC_INTEGER_4) && defined (HAVE_GFC_REAL_4)
|
|
1543 void cshift1_4_r4 (gfc_array_r4 * const restrict,
|
|
1544 const gfc_array_r4 * const restrict,
|
|
1545 const gfc_array_i4 * const restrict,
|
|
1546 const GFC_INTEGER_4 * const restrict);
|
|
1547 internal_proto(cshift1_4_r4);
|
|
1548 #endif
|
|
1549
|
|
1550 #if defined (HAVE_GFC_INTEGER_4) && defined (HAVE_GFC_REAL_8)
|
|
1551 void cshift1_4_r8 (gfc_array_r8 * const restrict,
|
|
1552 const gfc_array_r8 * const restrict,
|
|
1553 const gfc_array_i4 * const restrict,
|
|
1554 const GFC_INTEGER_4 * const restrict);
|
|
1555 internal_proto(cshift1_4_r8);
|
|
1556 #endif
|
|
1557
|
|
1558 #if defined (HAVE_GFC_INTEGER_4) && defined (HAVE_GFC_REAL_10)
|
|
1559 void cshift1_4_r10 (gfc_array_r10 * const restrict,
|
|
1560 const gfc_array_r10 * const restrict,
|
|
1561 const gfc_array_i4 * const restrict,
|
|
1562 const GFC_INTEGER_4 * const restrict);
|
|
1563 internal_proto(cshift1_4_r10);
|
|
1564 #endif
|
|
1565
|
|
1566 #if defined (HAVE_GFC_INTEGER_4) && defined (HAVE_GFC_REAL_16)
|
|
1567 void cshift1_4_r16 (gfc_array_r16 * const restrict,
|
|
1568 const gfc_array_r16 * const restrict,
|
|
1569 const gfc_array_i4 * const restrict,
|
|
1570 const GFC_INTEGER_4 * const restrict);
|
|
1571 internal_proto(cshift1_4_r16);
|
|
1572 #endif
|
|
1573
|
|
1574 #if defined (HAVE_GFC_INTEGER_8) && defined (HAVE_GFC_REAL_4)
|
|
1575 void cshift1_8_r4 (gfc_array_r4 * const restrict,
|
|
1576 const gfc_array_r4 * const restrict,
|
|
1577 const gfc_array_i8 * const restrict,
|
|
1578 const GFC_INTEGER_8 * const restrict);
|
|
1579 internal_proto(cshift1_8_r4);
|
|
1580 #endif
|
|
1581
|
|
1582 #if defined (HAVE_GFC_INTEGER_8) && defined (HAVE_GFC_REAL_8)
|
|
1583 void cshift1_8_r8 (gfc_array_r8 * const restrict,
|
|
1584 const gfc_array_r8 * const restrict,
|
|
1585 const gfc_array_i8 * const restrict,
|
|
1586 const GFC_INTEGER_8 * const restrict);
|
|
1587 internal_proto(cshift1_8_r8);
|
|
1588 #endif
|
|
1589
|
|
1590 #if defined (HAVE_GFC_INTEGER_8) && defined (HAVE_GFC_REAL_10)
|
|
1591 void cshift1_8_r10 (gfc_array_r10 * const restrict,
|
|
1592 const gfc_array_r10 * const restrict,
|
|
1593 const gfc_array_i8 * const restrict,
|
|
1594 const GFC_INTEGER_8 * const restrict);
|
|
1595 internal_proto(cshift1_8_r10);
|
|
1596 #endif
|
|
1597
|
|
1598 #if defined (HAVE_GFC_INTEGER_8) && defined (HAVE_GFC_REAL_16)
|
|
1599 void cshift1_8_r16 (gfc_array_r16 * const restrict,
|
|
1600 const gfc_array_r16 * const restrict,
|
|
1601 const gfc_array_i8 * const restrict,
|
|
1602 const GFC_INTEGER_8 * const restrict);
|
|
1603 internal_proto(cshift1_8_r16);
|
|
1604 #endif
|
|
1605
|
|
1606 #if defined (HAVE_GFC_INTEGER_16) && defined (HAVE_GFC_REAL_4)
|
|
1607 void cshift1_16_r4 (gfc_array_r4 * const restrict,
|
|
1608 const gfc_array_r4 * const restrict,
|
|
1609 const gfc_array_i16 * const restrict,
|
|
1610 const GFC_INTEGER_16 * const restrict);
|
|
1611 internal_proto(cshift1_16_r4);
|
|
1612 #endif
|
|
1613
|
|
1614 #if defined (HAVE_GFC_INTEGER_16) && defined (HAVE_GFC_REAL_8)
|
|
1615 void cshift1_16_r8 (gfc_array_r8 * const restrict,
|
|
1616 const gfc_array_r8 * const restrict,
|
|
1617 const gfc_array_i16 * const restrict,
|
|
1618 const GFC_INTEGER_16 * const restrict);
|
|
1619 internal_proto(cshift1_16_r8);
|
|
1620 #endif
|
|
1621
|
|
1622 #if defined (HAVE_GFC_INTEGER_16) && defined (HAVE_GFC_REAL_10)
|
|
1623 void cshift1_16_r10 (gfc_array_r10 * const restrict,
|
|
1624 const gfc_array_r10 * const restrict,
|
|
1625 const gfc_array_i16 * const restrict,
|
|
1626 const GFC_INTEGER_16 * const restrict);
|
|
1627 internal_proto(cshift1_16_r10);
|
|
1628 #endif
|
|
1629
|
|
1630 #if defined (HAVE_GFC_INTEGER_16) && defined (HAVE_GFC_REAL_16)
|
|
1631 void cshift1_16_r16 (gfc_array_r16 * const restrict,
|
|
1632 const gfc_array_r16 * const restrict,
|
|
1633 const gfc_array_i16 * const restrict,
|
|
1634 const GFC_INTEGER_16 * const restrict);
|
|
1635 internal_proto(cshift1_16_r16);
|
|
1636 #endif
|
|
1637
|
|
1638 #if defined (HAVE_GFC_INTEGER_4) && defined (HAVE_GFC_COMPLEX_4)
|
|
1639 void cshift1_4_c4 (gfc_array_c4 * const restrict,
|
|
1640 const gfc_array_c4 * const restrict,
|
|
1641 const gfc_array_i4 * const restrict,
|
|
1642 const GFC_INTEGER_4 * const restrict);
|
|
1643 internal_proto(cshift1_4_c4);
|
|
1644 #endif
|
|
1645
|
|
1646 #if defined (HAVE_GFC_INTEGER_4) && defined (HAVE_GFC_COMPLEX_8)
|
|
1647 void cshift1_4_c8 (gfc_array_c8 * const restrict,
|
|
1648 const gfc_array_c8 * const restrict,
|
|
1649 const gfc_array_i4 * const restrict,
|
|
1650 const GFC_INTEGER_4 * const restrict);
|
|
1651 internal_proto(cshift1_4_c8);
|
|
1652 #endif
|
|
1653
|
|
1654 #if defined (HAVE_GFC_INTEGER_4) && defined (HAVE_GFC_COMPLEX_10)
|
|
1655 void cshift1_4_c10 (gfc_array_c10 * const restrict,
|
|
1656 const gfc_array_c10 * const restrict,
|
|
1657 const gfc_array_i4 * const restrict,
|
|
1658 const GFC_INTEGER_4 * const restrict);
|
|
1659 internal_proto(cshift1_4_c10);
|
|
1660 #endif
|
|
1661
|
|
1662 #if defined (HAVE_GFC_INTEGER_4) && defined (HAVE_GFC_COMPLEX_16)
|
|
1663 void cshift1_4_c16 (gfc_array_c16 * const restrict,
|
|
1664 const gfc_array_c16 * const restrict,
|
|
1665 const gfc_array_i4 * const restrict,
|
|
1666 const GFC_INTEGER_4 * const restrict);
|
|
1667 internal_proto(cshift1_4_c16);
|
|
1668 #endif
|
|
1669
|
|
1670 #if defined (HAVE_GFC_INTEGER_8) && defined (HAVE_GFC_COMPLEX_4)
|
|
1671 void cshift1_8_c4 (gfc_array_c4 * const restrict,
|
|
1672 const gfc_array_c4 * const restrict,
|
|
1673 const gfc_array_i8 * const restrict,
|
|
1674 const GFC_INTEGER_8 * const restrict);
|
|
1675 internal_proto(cshift1_8_c4);
|
|
1676 #endif
|
|
1677
|
|
1678 #if defined (HAVE_GFC_INTEGER_8) && defined (HAVE_GFC_COMPLEX_8)
|
|
1679 void cshift1_8_c8 (gfc_array_c8 * const restrict,
|
|
1680 const gfc_array_c8 * const restrict,
|
|
1681 const gfc_array_i8 * const restrict,
|
|
1682 const GFC_INTEGER_8 * const restrict);
|
|
1683 internal_proto(cshift1_8_c8);
|
|
1684 #endif
|
|
1685
|
|
1686 #if defined (HAVE_GFC_INTEGER_8) && defined (HAVE_GFC_COMPLEX_10)
|
|
1687 void cshift1_8_c10 (gfc_array_c10 * const restrict,
|
|
1688 const gfc_array_c10 * const restrict,
|
|
1689 const gfc_array_i8 * const restrict,
|
|
1690 const GFC_INTEGER_8 * const restrict);
|
|
1691 internal_proto(cshift1_8_c10);
|
|
1692 #endif
|
|
1693
|
|
1694 #if defined (HAVE_GFC_INTEGER_8) && defined (HAVE_GFC_COMPLEX_16)
|
|
1695 void cshift1_8_c16 (gfc_array_c16 * const restrict,
|
|
1696 const gfc_array_c16 * const restrict,
|
|
1697 const gfc_array_i8 * const restrict,
|
|
1698 const GFC_INTEGER_8 * const restrict);
|
|
1699 internal_proto(cshift1_8_c16);
|
|
1700 #endif
|
|
1701
|
|
1702 #if defined (HAVE_GFC_INTEGER_16) && defined (HAVE_GFC_COMPLEX_4)
|
|
1703 void cshift1_16_c4 (gfc_array_c4 * const restrict,
|
|
1704 const gfc_array_c4 * const restrict,
|
|
1705 const gfc_array_i16 * const restrict,
|
|
1706 const GFC_INTEGER_16 * const restrict);
|
|
1707 internal_proto(cshift1_16_c4);
|
|
1708 #endif
|
|
1709
|
|
1710 #if defined (HAVE_GFC_INTEGER_16) && defined (HAVE_GFC_COMPLEX_8)
|
|
1711 void cshift1_16_c8 (gfc_array_c8 * const restrict,
|
|
1712 const gfc_array_c8 * const restrict,
|
|
1713 const gfc_array_i16 * const restrict,
|
|
1714 const GFC_INTEGER_16 * const restrict);
|
|
1715 internal_proto(cshift1_16_c8);
|
|
1716 #endif
|
|
1717
|
|
1718 #if defined (HAVE_GFC_INTEGER_16) && defined (HAVE_GFC_COMPLEX_10)
|
|
1719 void cshift1_16_c10 (gfc_array_c10 * const restrict,
|
|
1720 const gfc_array_c10 * const restrict,
|
|
1721 const gfc_array_i16 * const restrict,
|
|
1722 const GFC_INTEGER_16 * const restrict);
|
|
1723 internal_proto(cshift1_16_c10);
|
|
1724 #endif
|
|
1725
|
|
1726 #if defined (HAVE_GFC_INTEGER_16) && defined (HAVE_GFC_COMPLEX_16)
|
|
1727 void cshift1_16_c16 (gfc_array_c16 * const restrict,
|
|
1728 const gfc_array_c16 * const restrict,
|
|
1729 const gfc_array_i16 * const restrict,
|
|
1730 const GFC_INTEGER_16 * const restrict);
|
|
1731 internal_proto(cshift1_16_c16);
|
|
1732 #endif
|
|
1733
|
|
1734
|
|
1735 #endif /* LIBGFOR_H */
|