1 /* bld.c -- Implementation File (module.c template V1.0)
2 Copyright (C) 1995, 1996 Free Software Foundation, Inc.
3 Contributed by James Craig Burley (burley@gnu.ai.mit.edu).
5 This file is part of GNU Fortran.
7 GNU Fortran is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2, or (at your option)
12 GNU Fortran is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with GNU Fortran; see the file COPYING. If not, write to
19 the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
26 The primary "output" of the FFE includes ffebld objects, which
27 connect expressions, operators, and operands together, along with
28 connecting lists of expressions together for argument or dimension
33 Change names of some things for consistency.
48 /* Externals defined here. */
50 ffebldArity ffebld_arity_op_
[]
53 #define FFEBLD_OP(KWD,NAME,ARITY) ARITY,
57 struct _ffebld_pool_stack_ ffebld_pool_stack_
;
59 /* Simple definitions and enumerations. */
62 /* Internal typedefs. */
65 /* Private include files. */
68 /* Internal structure definitions. */
71 /* Static objects accessed by functions in this module. */
74 static struct _ffebld_ ffebld_blank_
78 {FFEINFO_basictypeNONE
, FFEINFO_kindtypeNONE
, 0, FFEINFO_kindNONE
,
79 FFEINFO_whereNONE
, FFETARGET_charactersizeNONE
},
83 #if FFETARGET_okCHARACTER1
84 static ffebldConstant ffebld_constant_character1_
;
86 #if FFETARGET_okCHARACTER2
87 static ffebldConstant ffebld_constant_character2_
;
89 #if FFETARGET_okCHARACTER3
90 static ffebldConstant ffebld_constant_character3_
;
92 #if FFETARGET_okCHARACTER4
93 static ffebldConstant ffebld_constant_character4_
;
95 #if FFETARGET_okCHARACTER5
96 static ffebldConstant ffebld_constant_character5_
;
98 #if FFETARGET_okCHARACTER6
99 static ffebldConstant ffebld_constant_character6_
;
101 #if FFETARGET_okCHARACTER7
102 static ffebldConstant ffebld_constant_character7_
;
104 #if FFETARGET_okCHARACTER8
105 static ffebldConstant ffebld_constant_character8_
;
107 #if FFETARGET_okCOMPLEX1
108 static ffebldConstant ffebld_constant_complex1_
;
110 #if FFETARGET_okCOMPLEX2
111 static ffebldConstant ffebld_constant_complex2_
;
113 #if FFETARGET_okCOMPLEX3
114 static ffebldConstant ffebld_constant_complex3_
;
116 #if FFETARGET_okCOMPLEX4
117 static ffebldConstant ffebld_constant_complex4_
;
119 #if FFETARGET_okCOMPLEX5
120 static ffebldConstant ffebld_constant_complex5_
;
122 #if FFETARGET_okCOMPLEX6
123 static ffebldConstant ffebld_constant_complex6_
;
125 #if FFETARGET_okCOMPLEX7
126 static ffebldConstant ffebld_constant_complex7_
;
128 #if FFETARGET_okCOMPLEX8
129 static ffebldConstant ffebld_constant_complex8_
;
131 #if FFETARGET_okINTEGER1
132 static ffebldConstant ffebld_constant_integer1_
;
134 #if FFETARGET_okINTEGER2
135 static ffebldConstant ffebld_constant_integer2_
;
137 #if FFETARGET_okINTEGER3
138 static ffebldConstant ffebld_constant_integer3_
;
140 #if FFETARGET_okINTEGER4
141 static ffebldConstant ffebld_constant_integer4_
;
143 #if FFETARGET_okINTEGER5
144 static ffebldConstant ffebld_constant_integer5_
;
146 #if FFETARGET_okINTEGER6
147 static ffebldConstant ffebld_constant_integer6_
;
149 #if FFETARGET_okINTEGER7
150 static ffebldConstant ffebld_constant_integer7_
;
152 #if FFETARGET_okINTEGER8
153 static ffebldConstant ffebld_constant_integer8_
;
155 #if FFETARGET_okLOGICAL1
156 static ffebldConstant ffebld_constant_logical1_
;
158 #if FFETARGET_okLOGICAL2
159 static ffebldConstant ffebld_constant_logical2_
;
161 #if FFETARGET_okLOGICAL3
162 static ffebldConstant ffebld_constant_logical3_
;
164 #if FFETARGET_okLOGICAL4
165 static ffebldConstant ffebld_constant_logical4_
;
167 #if FFETARGET_okLOGICAL5
168 static ffebldConstant ffebld_constant_logical5_
;
170 #if FFETARGET_okLOGICAL6
171 static ffebldConstant ffebld_constant_logical6_
;
173 #if FFETARGET_okLOGICAL7
174 static ffebldConstant ffebld_constant_logical7_
;
176 #if FFETARGET_okLOGICAL8
177 static ffebldConstant ffebld_constant_logical8_
;
179 #if FFETARGET_okREAL1
180 static ffebldConstant ffebld_constant_real1_
;
182 #if FFETARGET_okREAL2
183 static ffebldConstant ffebld_constant_real2_
;
185 #if FFETARGET_okREAL3
186 static ffebldConstant ffebld_constant_real3_
;
188 #if FFETARGET_okREAL4
189 static ffebldConstant ffebld_constant_real4_
;
191 #if FFETARGET_okREAL5
192 static ffebldConstant ffebld_constant_real5_
;
194 #if FFETARGET_okREAL6
195 static ffebldConstant ffebld_constant_real6_
;
197 #if FFETARGET_okREAL7
198 static ffebldConstant ffebld_constant_real7_
;
200 #if FFETARGET_okREAL8
201 static ffebldConstant ffebld_constant_real8_
;
203 static ffebldConstant ffebld_constant_hollerith_
;
204 static ffebldConstant ffebld_constant_typeless_
[FFEBLD_constTYPELESS_LAST
205 - FFEBLD_constTYPELESS_FIRST
+ 1];
207 static char *ffebld_op_string_
[]
210 #define FFEBLD_OP(KWD,NAME,ARITY) NAME,
211 #include "bld-op.def"
215 /* Static functions (internal). */
218 /* Internal macros. */
220 #define integerdefault_ CATX(integer,FFETARGET_ktINTEGERDEFAULT)
221 #define logicaldefault_ CATX(logical,FFETARGET_ktLOGICALDEFAULT)
222 #define realdefault_ CATX(real,FFETARGET_ktREALDEFAULT)
223 #define realdouble_ CATX(real,FFETARGET_ktREALDOUBLE)
224 #define realquad_ CATX(real,FFETARGET_ktREALQUAD)
226 /* ffebld_constant_cmp -- Compare two constants a la strcmp
228 ffebldConstant c1, c2;
229 if (ffebld_constant_cmp(c1,c2) == 0)
230 // they're equal, else they're not.
232 Returns -1 if c1 < c2, 0 if c1 == c2, +1 if c1 == c2. */
235 ffebld_constant_cmp (ffebldConstant c1
, ffebldConstant c2
)
240 assert (ffebld_constant_type (c1
) == ffebld_constant_type (c2
));
242 switch (ffebld_constant_type (c1
))
244 #if FFETARGET_okINTEGER1
245 case FFEBLD_constINTEGER1
:
246 return ffetarget_cmp_integer1 (ffebld_constant_integer1 (c1
),
247 ffebld_constant_integer1 (c2
));
250 #if FFETARGET_okINTEGER2
251 case FFEBLD_constINTEGER2
:
252 return ffetarget_cmp_integer2 (ffebld_constant_integer2 (c1
),
253 ffebld_constant_integer2 (c2
));
256 #if FFETARGET_okINTEGER3
257 case FFEBLD_constINTEGER3
:
258 return ffetarget_cmp_integer3 (ffebld_constant_integer3 (c1
),
259 ffebld_constant_integer3 (c2
));
262 #if FFETARGET_okINTEGER4
263 case FFEBLD_constINTEGER4
:
264 return ffetarget_cmp_integer4 (ffebld_constant_integer4 (c1
),
265 ffebld_constant_integer4 (c2
));
268 #if FFETARGET_okINTEGER5
269 case FFEBLD_constINTEGER5
:
270 return ffetarget_cmp_integer5 (ffebld_constant_integer5 (c1
),
271 ffebld_constant_integer5 (c2
));
274 #if FFETARGET_okINTEGER6
275 case FFEBLD_constINTEGER6
:
276 return ffetarget_cmp_integer6 (ffebld_constant_integer6 (c1
),
277 ffebld_constant_integer6 (c2
));
280 #if FFETARGET_okINTEGER7
281 case FFEBLD_constINTEGER7
:
282 return ffetarget_cmp_integer7 (ffebld_constant_integer7 (c1
),
283 ffebld_constant_integer7 (c2
));
286 #if FFETARGET_okINTEGER8
287 case FFEBLD_constINTEGER8
:
288 return ffetarget_cmp_integer8 (ffebld_constant_integer8 (c1
),
289 ffebld_constant_integer8 (c2
));
292 #if FFETARGET_okLOGICAL1
293 case FFEBLD_constLOGICAL1
:
294 return ffetarget_cmp_logical1 (ffebld_constant_logical1 (c1
),
295 ffebld_constant_logical1 (c2
));
298 #if FFETARGET_okLOGICAL2
299 case FFEBLD_constLOGICAL2
:
300 return ffetarget_cmp_logical2 (ffebld_constant_logical2 (c1
),
301 ffebld_constant_logical2 (c2
));
304 #if FFETARGET_okLOGICAL3
305 case FFEBLD_constLOGICAL3
:
306 return ffetarget_cmp_logical3 (ffebld_constant_logical3 (c1
),
307 ffebld_constant_logical3 (c2
));
310 #if FFETARGET_okLOGICAL4
311 case FFEBLD_constLOGICAL4
:
312 return ffetarget_cmp_logical4 (ffebld_constant_logical4 (c1
),
313 ffebld_constant_logical4 (c2
));
316 #if FFETARGET_okLOGICAL5
317 case FFEBLD_constLOGICAL5
:
318 return ffetarget_cmp_logical5 (ffebld_constant_logical5 (c1
),
319 ffebld_constant_logical5 (c2
));
322 #if FFETARGET_okLOGICAL6
323 case FFEBLD_constLOGICAL6
:
324 return ffetarget_cmp_logical6 (ffebld_constant_logical6 (c1
),
325 ffebld_constant_logical6 (c2
));
328 #if FFETARGET_okLOGICAL7
329 case FFEBLD_constLOGICAL7
:
330 return ffetarget_cmp_logical7 (ffebld_constant_logical7 (c1
),
331 ffebld_constant_logical7 (c2
));
334 #if FFETARGET_okLOGICAL8
335 case FFEBLD_constLOGICAL8
:
336 return ffetarget_cmp_logical8 (ffebld_constant_logical8 (c1
),
337 ffebld_constant_logical8 (c2
));
340 #if FFETARGET_okREAL1
341 case FFEBLD_constREAL1
:
342 return ffetarget_cmp_real1 (ffebld_constant_real1 (c1
),
343 ffebld_constant_real1 (c2
));
346 #if FFETARGET_okREAL2
347 case FFEBLD_constREAL2
:
348 return ffetarget_cmp_real2 (ffebld_constant_real2 (c1
),
349 ffebld_constant_real2 (c2
));
352 #if FFETARGET_okREAL3
353 case FFEBLD_constREAL3
:
354 return ffetarget_cmp_real3 (ffebld_constant_real3 (c1
),
355 ffebld_constant_real3 (c2
));
358 #if FFETARGET_okREAL4
359 case FFEBLD_constREAL4
:
360 return ffetarget_cmp_real4 (ffebld_constant_real4 (c1
),
361 ffebld_constant_real4 (c2
));
364 #if FFETARGET_okREAL5
365 case FFEBLD_constREAL5
:
366 return ffetarget_cmp_real5 (ffebld_constant_real5 (c1
),
367 ffebld_constant_real5 (c2
));
370 #if FFETARGET_okREAL6
371 case FFEBLD_constREAL6
:
372 return ffetarget_cmp_real6 (ffebld_constant_real6 (c1
),
373 ffebld_constant_real6 (c2
));
376 #if FFETARGET_okREAL7
377 case FFEBLD_constREAL7
:
378 return ffetarget_cmp_real7 (ffebld_constant_real7 (c1
),
379 ffebld_constant_real7 (c2
));
382 #if FFETARGET_okREAL8
383 case FFEBLD_constREAL8
:
384 return ffetarget_cmp_real8 (ffebld_constant_real8 (c1
),
385 ffebld_constant_real8 (c2
));
388 #if FFETARGET_okCHARACTER1
389 case FFEBLD_constCHARACTER1
:
390 return ffetarget_cmp_character1 (ffebld_constant_character1 (c1
),
391 ffebld_constant_character1 (c2
));
394 #if FFETARGET_okCHARACTER2
395 case FFEBLD_constCHARACTER2
:
396 return ffetarget_cmp_character2 (ffebld_constant_character2 (c1
),
397 ffebld_constant_character2 (c2
));
400 #if FFETARGET_okCHARACTER3
401 case FFEBLD_constCHARACTER3
:
402 return ffetarget_cmp_character3 (ffebld_constant_character3 (c1
),
403 ffebld_constant_character3 (c2
));
406 #if FFETARGET_okCHARACTER4
407 case FFEBLD_constCHARACTER4
:
408 return ffetarget_cmp_character4 (ffebld_constant_character4 (c1
),
409 ffebld_constant_character4 (c2
));
412 #if FFETARGET_okCHARACTER5
413 case FFEBLD_constCHARACTER5
:
414 return ffetarget_cmp_character5 (ffebld_constant_character5 (c1
),
415 ffebld_constant_character5 (c2
));
418 #if FFETARGET_okCHARACTER6
419 case FFEBLD_constCHARACTER6
:
420 return ffetarget_cmp_character6 (ffebld_constant_character6 (c1
),
421 ffebld_constant_character6 (c2
));
424 #if FFETARGET_okCHARACTER7
425 case FFEBLD_constCHARACTER7
:
426 return ffetarget_cmp_character7 (ffebld_constant_character7 (c1
),
427 ffebld_constant_character7 (c2
));
430 #if FFETARGET_okCHARACTER8
431 case FFEBLD_constCHARACTER8
:
432 return ffetarget_cmp_character8 (ffebld_constant_character8 (c1
),
433 ffebld_constant_character8 (c2
));
437 assert ("bad constant type" == NULL
);
442 /* ffebld_constant_dump -- Display summary of constant's contents
445 ffebld_constant_dump(c);
447 Displays the constant in summary form. */
450 ffebld_constant_dump (ffebldConstant c
)
452 switch (ffebld_constant_type (c
))
454 #if FFETARGET_okINTEGER1
455 case FFEBLD_constINTEGER1
:
456 ffebld_dump_prefix (dmpout
, FFEINFO_basictypeINTEGER
,
457 FFEINFO_kindtypeINTEGER1
);
458 ffebld_constantunion_dump (ffebld_constant_union (c
),
459 FFEINFO_basictypeINTEGER
, FFEINFO_kindtypeINTEGER1
);
463 #if FFETARGET_okINTEGER2
464 case FFEBLD_constINTEGER2
:
465 ffebld_dump_prefix (dmpout
, FFEINFO_basictypeINTEGER
,
466 FFEINFO_kindtypeINTEGER2
);
467 ffebld_constantunion_dump (ffebld_constant_union (c
),
468 FFEINFO_basictypeINTEGER
, FFEINFO_kindtypeINTEGER2
);
472 #if FFETARGET_okINTEGER3
473 case FFEBLD_constINTEGER3
:
474 ffebld_dump_prefix (dmpout
, FFEINFO_basictypeINTEGER
,
475 FFEINFO_kindtypeINTEGER3
);
476 ffebld_constantunion_dump (ffebld_constant_union (c
),
477 FFEINFO_basictypeINTEGER
, FFEINFO_kindtypeINTEGER3
);
481 #if FFETARGET_okINTEGER4
482 case FFEBLD_constINTEGER4
:
483 ffebld_dump_prefix (dmpout
, FFEINFO_basictypeINTEGER
,
484 FFEINFO_kindtypeINTEGER4
);
485 ffebld_constantunion_dump (ffebld_constant_union (c
),
486 FFEINFO_basictypeINTEGER
, FFEINFO_kindtypeINTEGER4
);
490 #if FFETARGET_okINTEGER5
491 case FFEBLD_constINTEGER5
:
492 ffebld_dump_prefix (dmpout
, FFEINFO_basictypeINTEGER
,
493 FFEINFO_kindtypeINTEGER5
);
494 ffebld_constantunion_dump (ffebld_constant_union (c
),
495 FFEINFO_basictypeINTEGER
, FFEINFO_kindtypeINTEGER5
);
499 #if FFETARGET_okINTEGER6
500 case FFEBLD_constINTEGER6
:
501 ffebld_dump_prefix (dmpout
, FFEINFO_basictypeINTEGER
,
502 FFEINFO_kindtypeINTEGER6
);
503 ffebld_constantunion_dump (ffebld_constant_union (c
),
504 FFEINFO_basictypeINTEGER
, FFEINFO_kindtypeINTEGER6
);
508 #if FFETARGET_okINTEGER7
509 case FFEBLD_constINTEGER7
:
510 ffebld_dump_prefix (dmpout
, FFEINFO_basictypeINTEGER
,
511 FFEINFO_kindtypeINTEGER7
);
512 ffebld_constantunion_dump (ffebld_constant_union (c
),
513 FFEINFO_basictypeINTEGER
, FFEINFO_kindtypeINTEGER7
);
517 #if FFETARGET_okINTEGER8
518 case FFEBLD_constINTEGER8
:
519 ffebld_dump_prefix (dmpout
, FFEINFO_basictypeINTEGER
,
520 FFEINFO_kindtypeINTEGER8
);
521 ffebld_constantunion_dump (ffebld_constant_union (c
),
522 FFEINFO_basictypeINTEGER
, FFEINFO_kindtypeINTEGER8
);
526 #if FFETARGET_okLOGICAL1
527 case FFEBLD_constLOGICAL1
:
528 ffebld_dump_prefix (dmpout
, FFEINFO_basictypeLOGICAL
,
529 FFEINFO_kindtypeLOGICAL1
);
530 ffebld_constantunion_dump (ffebld_constant_union (c
),
531 FFEINFO_basictypeLOGICAL
, FFEINFO_kindtypeLOGICAL1
);
535 #if FFETARGET_okLOGICAL2
536 case FFEBLD_constLOGICAL2
:
537 ffebld_dump_prefix (dmpout
, FFEINFO_basictypeLOGICAL
,
538 FFEINFO_kindtypeLOGICAL2
);
539 ffebld_constantunion_dump (ffebld_constant_union (c
),
540 FFEINFO_basictypeLOGICAL
, FFEINFO_kindtypeLOGICAL2
);
544 #if FFETARGET_okLOGICAL3
545 case FFEBLD_constLOGICAL3
:
546 ffebld_dump_prefix (dmpout
, FFEINFO_basictypeLOGICAL
,
547 FFEINFO_kindtypeLOGICAL3
);
548 ffebld_constantunion_dump (ffebld_constant_union (c
),
549 FFEINFO_basictypeLOGICAL
, FFEINFO_kindtypeLOGICAL3
);
553 #if FFETARGET_okLOGICAL4
554 case FFEBLD_constLOGICAL4
:
555 ffebld_dump_prefix (dmpout
, FFEINFO_basictypeLOGICAL
,
556 FFEINFO_kindtypeLOGICAL4
);
557 ffebld_constantunion_dump (ffebld_constant_union (c
),
558 FFEINFO_basictypeLOGICAL
, FFEINFO_kindtypeLOGICAL4
);
562 #if FFETARGET_okLOGICAL5
563 case FFEBLD_constLOGICAL5
:
564 ffebld_dump_prefix (dmpout
, FFEINFO_basictypeLOGICAL
,
565 FFEINFO_kindtypeLOGICAL5
);
566 ffebld_constantunion_dump (ffebld_constant_union (c
),
567 FFEINFO_basictypeLOGICAL
, FFEINFO_kindtypeLOGICAL5
);
571 #if FFETARGET_okLOGICAL6
572 case FFEBLD_constLOGICAL6
:
573 ffebld_dump_prefix (dmpout
, FFEINFO_basictypeLOGICAL
,
574 FFEINFO_kindtypeLOGICAL6
);
575 ffebld_constantunion_dump (ffebld_constant_union (c
),
576 FFEINFO_basictypeLOGICAL
, FFEINFO_kindtypeLOGICAL6
);
580 #if FFETARGET_okLOGICAL7
581 case FFEBLD_constLOGICAL7
:
582 ffebld_dump_prefix (dmpout
, FFEINFO_basictypeLOGICAL
,
583 FFEINFO_kindtypeLOGICAL7
);
584 ffebld_constantunion_dump (ffebld_constant_union (c
),
585 FFEINFO_basictypeLOGICAL
, FFEINFO_kindtypeLOGICAL7
);
589 #if FFETARGET_okLOGICAL8
590 case FFEBLD_constLOGICAL8
:
591 ffebld_dump_prefix (dmpout
, FFEINFO_basictypeLOGICAL
,
592 FFEINFO_kindtypeLOGICAL8
);
593 ffebld_constantunion_dump (ffebld_constant_union (c
),
594 FFEINFO_basictypeLOGICAL
, FFEINFO_kindtypeLOGICAL8
);
598 #if FFETARGET_okREAL1
599 case FFEBLD_constREAL1
:
600 ffebld_dump_prefix (dmpout
, FFEINFO_basictypeREAL
,
601 FFEINFO_kindtypeREAL1
);
602 ffebld_constantunion_dump (ffebld_constant_union (c
),
603 FFEINFO_basictypeREAL
, FFEINFO_kindtypeREAL1
);
607 #if FFETARGET_okREAL2
608 case FFEBLD_constREAL2
:
609 ffebld_dump_prefix (dmpout
, FFEINFO_basictypeREAL
,
610 FFEINFO_kindtypeREAL2
);
611 ffebld_constantunion_dump (ffebld_constant_union (c
),
612 FFEINFO_basictypeREAL
, FFEINFO_kindtypeREAL2
);
616 #if FFETARGET_okREAL3
617 case FFEBLD_constREAL3
:
618 ffebld_dump_prefix (dmpout
, FFEINFO_basictypeREAL
,
619 FFEINFO_kindtypeREAL3
);
620 ffebld_constantunion_dump (ffebld_constant_union (c
),
621 FFEINFO_basictypeREAL
, FFEINFO_kindtypeREAL3
);
625 #if FFETARGET_okREAL4
626 case FFEBLD_constREAL4
:
627 ffebld_dump_prefix (dmpout
, FFEINFO_basictypeREAL
,
628 FFEINFO_kindtypeREAL4
);
629 ffebld_constantunion_dump (ffebld_constant_union (c
),
630 FFEINFO_basictypeREAL
, FFEINFO_kindtypeREAL4
);
634 #if FFETARGET_okREAL5
635 case FFEBLD_constREAL5
:
636 ffebld_dump_prefix (dmpout
, FFEINFO_basictypeREAL
,
637 FFEINFO_kindtypeREAL5
);
638 ffebld_constantunion_dump (ffebld_constant_union (c
),
639 FFEINFO_basictypeREAL
, FFEINFO_kindtypeREAL5
);
643 #if FFETARGET_okREAL6
644 case FFEBLD_constREAL6
:
645 ffebld_dump_prefix (dmpout
, FFEINFO_basictypeREAL
,
646 FFEINFO_kindtypeREAL6
);
647 ffebld_constantunion_dump (ffebld_constant_union (c
),
648 FFEINFO_basictypeREAL
, FFEINFO_kindtypeREAL6
);
652 #if FFETARGET_okREAL7
653 case FFEBLD_constREAL7
:
654 ffebld_dump_prefix (dmpout
, FFEINFO_basictypeREAL
,
655 FFEINFO_kindtypeREAL7
);
656 ffebld_constantunion_dump (ffebld_constant_union (c
),
657 FFEINFO_basictypeREAL
, FFEINFO_kindtypeREAL7
);
661 #if FFETARGET_okREAL8
662 case FFEBLD_constREAL8
:
663 ffebld_dump_prefix (dmpout
, FFEINFO_basictypeREAL
,
664 FFEINFO_kindtypeREAL8
);
665 ffebld_constantunion_dump (ffebld_constant_union (c
),
666 FFEINFO_basictypeREAL
, FFEINFO_kindtypeREAL8
);
670 #if FFETARGET_okCOMPLEX1
671 case FFEBLD_constCOMPLEX1
:
672 ffebld_dump_prefix (dmpout
, FFEINFO_basictypeCOMPLEX
,
673 FFEINFO_kindtypeREAL1
);
674 ffebld_constantunion_dump (ffebld_constant_union (c
),
675 FFEINFO_basictypeCOMPLEX
, FFEINFO_kindtypeREAL1
);
679 #if FFETARGET_okCOMPLEX2
680 case FFEBLD_constCOMPLEX2
:
681 ffebld_dump_prefix (dmpout
, FFEINFO_basictypeCOMPLEX
,
682 FFEINFO_kindtypeREAL2
);
683 ffebld_constantunion_dump (ffebld_constant_union (c
),
684 FFEINFO_basictypeCOMPLEX
, FFEINFO_kindtypeREAL2
);
688 #if FFETARGET_okCOMPLEX3
689 case FFEBLD_constCOMPLEX3
:
690 ffebld_dump_prefix (dmpout
, FFEINFO_basictypeCOMPLEX
,
691 FFEINFO_kindtypeREAL3
);
692 ffebld_constantunion_dump (ffebld_constant_union (c
),
693 FFEINFO_basictypeCOMPLEX
, FFEINFO_kindtypeREAL3
);
697 #if FFETARGET_okCOMPLEX4
698 case FFEBLD_constCOMPLEX4
:
699 ffebld_dump_prefix (dmpout
, FFEINFO_basictypeCOMPLEX
,
700 FFEINFO_kindtypeREAL4
);
701 ffebld_constantunion_dump (ffebld_constant_union (c
),
702 FFEINFO_basictypeCOMPLEX
, FFEINFO_kindtypeREAL4
);
706 #if FFETARGET_okCOMPLEX5
707 case FFEBLD_constCOMPLEX5
:
708 ffebld_dump_prefix (dmpout
, FFEINFO_basictypeCOMPLEX
,
709 FFEINFO_kindtypeREAL5
);
710 ffebld_constantunion_dump (ffebld_constant_union (c
),
711 FFEINFO_basictypeCOMPLEX
, FFEINFO_kindtypeREAL5
);
715 #if FFETARGET_okCOMPLEX6
716 case FFEBLD_constCOMPLEX6
:
717 ffebld_dump_prefix (dmpout
, FFEINFO_basictypeCOMPLEX
,
718 FFEINFO_kindtypeREAL6
);
719 ffebld_constantunion_dump (ffebld_constant_union (c
),
720 FFEINFO_basictypeCOMPLEX
, FFEINFO_kindtypeREAL6
);
724 #if FFETARGET_okCOMPLEX7
725 case FFEBLD_constCOMPLEX7
:
726 ffebld_dump_prefix (dmpout
, FFEINFO_basictypeCOMPLEX
,
727 FFEINFO_kindtypeREAL7
);
728 ffebld_constantunion_dump (ffebld_constant_union (c
),
729 FFEINFO_basictypeCOMPLEX
, FFEINFO_kindtypeREAL7
);
733 #if FFETARGET_okCOMPLEX8
734 case FFEBLD_constCOMPLEX8
:
735 ffebld_dump_prefix (dmpout
, FFEINFO_basictypeCOMPLEX
,
736 FFEINFO_kindtypeREAL8
);
737 ffebld_constantunion_dump (ffebld_constant_union (c
),
738 FFEINFO_basictypeCOMPLEX
, FFEINFO_kindtypeREAL8
);
742 #if FFETARGET_okCHARACTER1
743 case FFEBLD_constCHARACTER1
:
744 ffebld_dump_prefix (dmpout
, FFEINFO_basictypeCHARACTER
,
745 FFEINFO_kindtypeCHARACTER1
);
746 ffebld_constantunion_dump (ffebld_constant_union (c
),
747 FFEINFO_basictypeCHARACTER
, FFEINFO_kindtypeCHARACTER1
);
751 #if FFETARGET_okCHARACTER2
752 case FFEBLD_constCHARACTER2
:
753 ffebld_dump_prefix (dmpout
, FFEINFO_basictypeCHARACTER
,
754 FFEINFO_kindtypeCHARACTER2
);
755 ffebld_constantunion_dump (ffebld_constant_union (c
),
756 FFEINFO_basictypeCHARACTER
, FFEINFO_kindtypeCHARACTER2
);
760 #if FFETARGET_okCHARACTER3
761 case FFEBLD_constCHARACTER3
:
762 ffebld_dump_prefix (dmpout
, FFEINFO_basictypeCHARACTER
,
763 FFEINFO_kindtypeCHARACTER3
);
764 ffebld_constantunion_dump (ffebld_constant_union (c
),
765 FFEINFO_basictypeCHARACTER
, FFEINFO_kindtypeCHARACTER3
);
769 #if FFETARGET_okCHARACTER4
770 case FFEBLD_constCHARACTER4
:
771 ffebld_dump_prefix (dmpout
, FFEINFO_basictypeCHARACTER
,
772 FFEINFO_kindtypeCHARACTER4
);
773 ffebld_constantunion_dump (ffebld_constant_union (c
),
774 FFEINFO_basictypeCHARACTER
, FFEINFO_kindtypeCHARACTER4
);
778 #if FFETARGET_okCHARACTER5
779 case FFEBLD_constCHARACTER5
:
780 ffebld_dump_prefix (dmpout
, FFEINFO_basictypeCHARACTER
,
781 FFEINFO_kindtypeCHARACTER5
);
782 ffebld_constantunion_dump (ffebld_constant_union (c
),
783 FFEINFO_basictypeCHARACTER
, FFEINFO_kindtypeCHARACTER5
);
787 #if FFETARGET_okCHARACTER6
788 case FFEBLD_constCHARACTER6
:
789 ffebld_dump_prefix (dmpout
, FFEINFO_basictypeCHARACTER
,
790 FFEINFO_kindtypeCHARACTER6
);
791 ffebld_constantunion_dump (ffebld_constant_union (c
),
792 FFEINFO_basictypeCHARACTER
, FFEINFO_kindtypeCHARACTER6
);
796 #if FFETARGET_okCHARACTER7
797 case FFEBLD_constCHARACTER7
:
798 ffebld_dump_prefix (dmpout
, FFEINFO_basictypeCHARACTER
,
799 FFEINFO_kindtypeCHARACTER7
);
800 ffebld_constantunion_dump (ffebld_constant_union (c
),
801 FFEINFO_basictypeCHARACTER
, FFEINFO_kindtypeCHARACTER7
);
805 #if FFETARGET_okCHARACTER8
806 case FFEBLD_constCHARACTER8
:
807 ffebld_dump_prefix (dmpout
, FFEINFO_basictypeCHARACTER
,
808 FFEINFO_kindtypeCHARACTER8
);
809 ffebld_constantunion_dump (ffebld_constant_union (c
),
810 FFEINFO_basictypeCHARACTER
, FFEINFO_kindtypeCHARACTER8
);
814 case FFEBLD_constHOLLERITH
:
815 fprintf (dmpout
, "H%" ffetargetHollerithSize_f
"u/",
816 ffebld_constant_hollerith (c
).length
);
817 ffetarget_print_hollerith (dmpout
, ffebld_constant_hollerith (c
));
820 case FFEBLD_constBINARY_MIL
:
821 fprintf (dmpout
, "BM/");
822 ffetarget_print_binarymil (dmpout
, ffebld_constant_typeless (c
));
825 case FFEBLD_constBINARY_VXT
:
826 fprintf (dmpout
, "BV/");
827 ffetarget_print_binaryvxt (dmpout
, ffebld_constant_typeless (c
));
830 case FFEBLD_constOCTAL_MIL
:
831 fprintf (dmpout
, "OM/");
832 ffetarget_print_octalmil (dmpout
, ffebld_constant_typeless (c
));
835 case FFEBLD_constOCTAL_VXT
:
836 fprintf (dmpout
, "OV/");
837 ffetarget_print_octalvxt (dmpout
, ffebld_constant_typeless (c
));
840 case FFEBLD_constHEX_X_MIL
:
841 fprintf (dmpout
, "XM/");
842 ffetarget_print_hexxmil (dmpout
, ffebld_constant_typeless (c
));
845 case FFEBLD_constHEX_X_VXT
:
846 fprintf (dmpout
, "XV/");
847 ffetarget_print_hexxvxt (dmpout
, ffebld_constant_typeless (c
));
850 case FFEBLD_constHEX_Z_MIL
:
851 fprintf (dmpout
, "ZM/");
852 ffetarget_print_hexzmil (dmpout
, ffebld_constant_typeless (c
));
855 case FFEBLD_constHEX_Z_VXT
:
856 fprintf (dmpout
, "ZV/");
857 ffetarget_print_hexzvxt (dmpout
, ffebld_constant_typeless (c
));
861 assert ("bad constant type" == NULL
);
862 fprintf (dmpout
, "?/?");
867 /* ffebld_constant_is_magical -- Determine if integer is "magical"
870 if (ffebld_constant_is_magical(c))
871 // it is 2**(n-1), where n is # bits in ffetargetIntegerDefault type
872 // (this test is important for 2's-complement machines only). */
875 ffebld_constant_is_magical (ffebldConstant c
)
877 switch (ffebld_constant_type (c
))
879 case FFEBLD_constINTEGERDEFAULT
:
880 return ffetarget_integerdefault_is_magical (ffebld_constant_integer1 (c
));
887 /* Determine if constant is zero. Used to ensure step count
888 for DO loops isn't zero, also to determine if values will
889 be binary zeros, so not entirely portable at this point. */
892 ffebld_constant_is_zero (ffebldConstant c
)
894 switch (ffebld_constant_type (c
))
896 #if FFETARGET_okINTEGER1
897 case FFEBLD_constINTEGER1
:
898 return ffebld_constant_integer1 (c
) == 0;
901 #if FFETARGET_okINTEGER2
902 case FFEBLD_constINTEGER2
:
903 return ffebld_constant_integer2 (c
) == 0;
906 #if FFETARGET_okINTEGER3
907 case FFEBLD_constINTEGER3
:
908 return ffebld_constant_integer3 (c
) == 0;
911 #if FFETARGET_okINTEGER4
912 case FFEBLD_constINTEGER4
:
913 return ffebld_constant_integer4 (c
) == 0;
916 #if FFETARGET_okINTEGER5
917 case FFEBLD_constINTEGER5
:
918 return ffebld_constant_integer5 (c
) == 0;
921 #if FFETARGET_okINTEGER6
922 case FFEBLD_constINTEGER6
:
923 return ffebld_constant_integer6 (c
) == 0;
926 #if FFETARGET_okINTEGER7
927 case FFEBLD_constINTEGER7
:
928 return ffebld_constant_integer7 (c
) == 0;
931 #if FFETARGET_okINTEGER8
932 case FFEBLD_constINTEGER8
:
933 return ffebld_constant_integer8 (c
) == 0;
936 #if FFETARGET_okLOGICAL1
937 case FFEBLD_constLOGICAL1
:
938 return ffebld_constant_logical1 (c
) == 0;
941 #if FFETARGET_okLOGICAL2
942 case FFEBLD_constLOGICAL2
:
943 return ffebld_constant_logical2 (c
) == 0;
946 #if FFETARGET_okLOGICAL3
947 case FFEBLD_constLOGICAL3
:
948 return ffebld_constant_logical3 (c
) == 0;
951 #if FFETARGET_okLOGICAL4
952 case FFEBLD_constLOGICAL4
:
953 return ffebld_constant_logical4 (c
) == 0;
956 #if FFETARGET_okLOGICAL5
957 case FFEBLD_constLOGICAL5
:
958 return ffebld_constant_logical5 (c
) == 0;
961 #if FFETARGET_okLOGICAL6
962 case FFEBLD_constLOGICAL6
:
963 return ffebld_constant_logical6 (c
) == 0;
966 #if FFETARGET_okLOGICAL7
967 case FFEBLD_constLOGICAL7
:
968 return ffebld_constant_logical7 (c
) == 0;
971 #if FFETARGET_okLOGICAL8
972 case FFEBLD_constLOGICAL8
:
973 return ffebld_constant_logical8 (c
) == 0;
976 #if FFETARGET_okREAL1
977 case FFEBLD_constREAL1
:
978 return ffetarget_iszero_real1 (ffebld_constant_real1 (c
));
981 #if FFETARGET_okREAL2
982 case FFEBLD_constREAL2
:
983 return ffetarget_iszero_real2 (ffebld_constant_real2 (c
));
986 #if FFETARGET_okREAL3
987 case FFEBLD_constREAL3
:
988 return ffetarget_iszero_real3 (ffebld_constant_real3 (c
));
991 #if FFETARGET_okREAL4
992 case FFEBLD_constREAL4
:
993 return ffetarget_iszero_real4 (ffebld_constant_real4 (c
));
996 #if FFETARGET_okREAL5
997 case FFEBLD_constREAL5
:
998 return ffetarget_iszero_real5 (ffebld_constant_real5 (c
));
1001 #if FFETARGET_okREAL6
1002 case FFEBLD_constREAL6
:
1003 return ffetarget_iszero_real6 (ffebld_constant_real6 (c
));
1006 #if FFETARGET_okREAL7
1007 case FFEBLD_constREAL7
:
1008 return ffetarget_iszero_real7 (ffebld_constant_real7 (c
));
1011 #if FFETARGET_okREAL8
1012 case FFEBLD_constREAL8
:
1013 return ffetarget_iszero_real8 (ffebld_constant_real8 (c
));
1016 #if FFETARGET_okCOMPLEX1
1017 case FFEBLD_constCOMPLEX1
:
1018 return ffetarget_iszero_real1 (ffebld_constant_complex1 (c
).real
)
1019 && ffetarget_iszero_real1 (ffebld_constant_complex1 (c
).imaginary
);
1022 #if FFETARGET_okCOMPLEX2
1023 case FFEBLD_constCOMPLEX2
:
1024 return ffetarget_iszero_real2 (ffebld_constant_complex2 (c
).real
)
1025 && ffetarget_iszero_real2 (ffebld_constant_complex2 (c
).imaginary
);
1028 #if FFETARGET_okCOMPLEX3
1029 case FFEBLD_constCOMPLEX3
:
1030 return ffetarget_iszero_real3 (ffebld_constant_complex3 (c
).real
)
1031 && ffetarget_iszero_real3 (ffebld_constant_complex3 (c
).imaginary
);
1034 #if FFETARGET_okCOMPLEX4
1035 case FFEBLD_constCOMPLEX4
:
1036 return ffetarget_iszero_real4 (ffebld_constant_complex4 (c
).real
)
1037 && ffetarget_iszero_real4 (ffebld_constant_complex4 (c
).imaginary
);
1040 #if FFETARGET_okCOMPLEX5
1041 case FFEBLD_constCOMPLEX5
:
1042 return ffetarget_iszero_real5 (ffebld_constant_complex5 (c
).real
)
1043 && ffetarget_iszero_real5 (ffebld_constant_complex5 (c
).imaginary
);
1046 #if FFETARGET_okCOMPLEX6
1047 case FFEBLD_constCOMPLEX6
:
1048 return ffetarget_iszero_real6 (ffebld_constant_complex6 (c
).real
)
1049 && ffetarget_iszero_real6 (ffebld_constant_complex6 (c
).imaginary
);
1052 #if FFETARGET_okCOMPLEX7
1053 case FFEBLD_constCOMPLEX7
:
1054 return ffetarget_iszero_real7 (ffebld_constant_complex7 (c
).real
)
1055 && ffetarget_iszero_real7 (ffebld_constant_complex7 (c
).imaginary
);
1058 #if FFETARGET_okCOMPLEX8
1059 case FFEBLD_constCOMPLEX8
:
1060 return ffetarget_iszero_real8 (ffebld_constant_complex8 (c
).real
)
1061 && ffetarget_iszero_real8 (ffebld_constant_complex8 (c
).imaginary
);
1064 #if FFETARGET_okCHARACTER1
1065 case FFEBLD_constCHARACTER1
:
1066 return ffetarget_iszero_character1 (ffebld_constant_character1 (c
));
1069 #if FFETARGET_okCHARACTER2 || FFETARGET_okCHARACTER3 /* ... */
1070 #error "no support for these!!"
1073 case FFEBLD_constHOLLERITH
:
1074 return ffetarget_iszero_hollerith (ffebld_constant_hollerith (c
));
1076 case FFEBLD_constBINARY_MIL
:
1077 case FFEBLD_constBINARY_VXT
:
1078 case FFEBLD_constOCTAL_MIL
:
1079 case FFEBLD_constOCTAL_VXT
:
1080 case FFEBLD_constHEX_X_MIL
:
1081 case FFEBLD_constHEX_X_VXT
:
1082 case FFEBLD_constHEX_Z_MIL
:
1083 case FFEBLD_constHEX_Z_VXT
:
1084 return ffetarget_iszero_typeless (ffebld_constant_typeless (c
));
1091 /* ffebld_constant_new_character1 -- Return character1 constant object from token
1095 #if FFETARGET_okCHARACTER1
1097 ffebld_constant_new_character1 (ffelexToken t
)
1099 ffetargetCharacter1 val
;
1101 ffetarget_character1 (&val
, t
, ffebld_constant_pool());
1102 return ffebld_constant_new_character1_val (val
);
1106 /* ffebld_constant_new_character1_val -- Return an character1 constant object
1110 #if FFETARGET_okCHARACTER1
1112 ffebld_constant_new_character1_val (ffetargetCharacter1 val
)
1118 ffetarget_verify_character1 (ffebld_constant_pool(), val
);
1120 for (c
= (ffebldConstant
) &ffebld_constant_character1_
;
1124 malloc_verify_kp (ffebld_constant_pool(),
1126 sizeof (*(c
->next
)));
1127 ffetarget_verify_character1 (ffebld_constant_pool(),
1128 ffebld_constant_character1 (c
->next
));
1129 cmp
= ffetarget_cmp_character1 (val
,
1130 ffebld_constant_character1 (c
->next
));
1137 nc
= malloc_new_kp (ffebld_constant_pool(),
1138 "FFEBLD_constCHARACTER1",
1141 nc
->consttype
= FFEBLD_constCHARACTER1
;
1142 nc
->u
.character1
= val
;
1143 #ifdef FFECOM_constantHOOK
1144 nc
->hook
= FFECOM_constantNULL
;
1152 /* ffebld_constant_new_complex1 -- Return complex1 constant object from token
1156 #if FFETARGET_okCOMPLEX1
1158 ffebld_constant_new_complex1 (ffebldConstant real
,
1159 ffebldConstant imaginary
)
1161 ffetargetComplex1 val
;
1163 val
.real
= ffebld_constant_real1 (real
);
1164 val
.imaginary
= ffebld_constant_real1 (imaginary
);
1165 return ffebld_constant_new_complex1_val (val
);
1169 /* ffebld_constant_new_complex1_val -- Return a complex1 constant object
1173 #if FFETARGET_okCOMPLEX1
1175 ffebld_constant_new_complex1_val (ffetargetComplex1 val
)
1181 for (c
= (ffebldConstant
) &ffebld_constant_complex1_
;
1185 cmp
= ffetarget_cmp_real1 (val
.real
, ffebld_constant_complex1 (c
->next
).real
);
1187 cmp
= ffetarget_cmp_real1 (val
.imaginary
,
1188 ffebld_constant_complex1 (c
->next
).imaginary
);
1195 nc
= malloc_new_kp (ffebld_constant_pool(),
1196 "FFEBLD_constCOMPLEX1",
1199 nc
->consttype
= FFEBLD_constCOMPLEX1
;
1200 nc
->u
.complex1
= val
;
1201 #ifdef FFECOM_constantHOOK
1202 nc
->hook
= FFECOM_constantNULL
;
1210 /* ffebld_constant_new_complex2 -- Return complex2 constant object from token
1214 #if FFETARGET_okCOMPLEX2
1216 ffebld_constant_new_complex2 (ffebldConstant real
,
1217 ffebldConstant imaginary
)
1219 ffetargetComplex2 val
;
1221 val
.real
= ffebld_constant_real2 (real
);
1222 val
.imaginary
= ffebld_constant_real2 (imaginary
);
1223 return ffebld_constant_new_complex2_val (val
);
1227 /* ffebld_constant_new_complex2_val -- Return a complex2 constant object
1231 #if FFETARGET_okCOMPLEX2
1233 ffebld_constant_new_complex2_val (ffetargetComplex2 val
)
1239 for (c
= (ffebldConstant
) &ffebld_constant_complex2_
;
1243 cmp
= ffetarget_cmp_real2 (val
.real
, ffebld_constant_complex2 (c
->next
).real
);
1245 cmp
= ffetarget_cmp_real2 (val
.imaginary
,
1246 ffebld_constant_complex2 (c
->next
).imaginary
);
1253 nc
= malloc_new_kp (ffebld_constant_pool(),
1254 "FFEBLD_constCOMPLEX2",
1257 nc
->consttype
= FFEBLD_constCOMPLEX2
;
1258 nc
->u
.complex2
= val
;
1259 #ifdef FFECOM_constantHOOK
1260 nc
->hook
= FFECOM_constantNULL
;
1268 /* ffebld_constant_new_hollerith -- Return hollerith constant object from token
1273 ffebld_constant_new_hollerith (ffelexToken t
)
1275 ffetargetHollerith val
;
1277 ffetarget_hollerith (&val
, t
, ffebld_constant_pool());
1278 return ffebld_constant_new_hollerith_val (val
);
1281 /* ffebld_constant_new_hollerith_val -- Return an hollerith constant object
1286 ffebld_constant_new_hollerith_val (ffetargetHollerith val
)
1292 for (c
= (ffebldConstant
) &ffebld_constant_hollerith_
;
1296 cmp
= ffetarget_cmp_hollerith (val
, ffebld_constant_hollerith (c
->next
));
1303 nc
= malloc_new_kp (ffebld_constant_pool(),
1304 "FFEBLD_constHOLLERITH",
1307 nc
->consttype
= FFEBLD_constHOLLERITH
;
1308 nc
->u
.hollerith
= val
;
1309 #ifdef FFECOM_constantHOOK
1310 nc
->hook
= FFECOM_constantNULL
;
1317 /* ffebld_constant_new_integer1 -- Return integer1 constant object from token
1321 Parses the token as a decimal integer constant, thus it must be an
1322 FFELEX_typeNUMBER. */
1324 #if FFETARGET_okINTEGER1
1326 ffebld_constant_new_integer1 (ffelexToken t
)
1328 ffetargetInteger1 val
;
1330 assert (ffelex_token_type (t
) == FFELEX_typeNUMBER
);
1332 ffetarget_integer1 (&val
, t
);
1333 return ffebld_constant_new_integer1_val (val
);
1337 /* ffebld_constant_new_integer1_val -- Return an integer1 constant object
1341 #if FFETARGET_okINTEGER1
1343 ffebld_constant_new_integer1_val (ffetargetInteger1 val
)
1349 for (c
= (ffebldConstant
) &ffebld_constant_integer1_
;
1353 cmp
= ffetarget_cmp_integer1 (val
, ffebld_constant_integer1 (c
->next
));
1360 nc
= malloc_new_kp (ffebld_constant_pool(),
1361 "FFEBLD_constINTEGER1",
1364 nc
->consttype
= FFEBLD_constINTEGER1
;
1365 nc
->u
.integer1
= val
;
1366 #ifdef FFECOM_constantHOOK
1367 nc
->hook
= FFECOM_constantNULL
;
1375 /* ffebld_constant_new_integer2_val -- Return an integer2 constant object
1379 #if FFETARGET_okINTEGER2
1381 ffebld_constant_new_integer2_val (ffetargetInteger2 val
)
1387 for (c
= (ffebldConstant
) &ffebld_constant_integer2_
;
1391 cmp
= ffetarget_cmp_integer2 (val
, ffebld_constant_integer2 (c
->next
));
1398 nc
= malloc_new_kp (ffebld_constant_pool(),
1399 "FFEBLD_constINTEGER2",
1402 nc
->consttype
= FFEBLD_constINTEGER2
;
1403 nc
->u
.integer2
= val
;
1404 #ifdef FFECOM_constantHOOK
1405 nc
->hook
= FFECOM_constantNULL
;
1413 /* ffebld_constant_new_integer3_val -- Return an integer3 constant object
1417 #if FFETARGET_okINTEGER3
1419 ffebld_constant_new_integer3_val (ffetargetInteger3 val
)
1425 for (c
= (ffebldConstant
) &ffebld_constant_integer3_
;
1429 cmp
= ffetarget_cmp_integer3 (val
, ffebld_constant_integer3 (c
->next
));
1436 nc
= malloc_new_kp (ffebld_constant_pool(),
1437 "FFEBLD_constINTEGER3",
1440 nc
->consttype
= FFEBLD_constINTEGER3
;
1441 nc
->u
.integer3
= val
;
1442 #ifdef FFECOM_constantHOOK
1443 nc
->hook
= FFECOM_constantNULL
;
1451 /* ffebld_constant_new_integer4_val -- Return an integer4 constant object
1455 #if FFETARGET_okINTEGER4
1457 ffebld_constant_new_integer4_val (ffetargetInteger4 val
)
1463 for (c
= (ffebldConstant
) &ffebld_constant_integer4_
;
1467 cmp
= ffetarget_cmp_integer4 (val
, ffebld_constant_integer4 (c
->next
));
1474 nc
= malloc_new_kp (ffebld_constant_pool(),
1475 "FFEBLD_constINTEGER4",
1478 nc
->consttype
= FFEBLD_constINTEGER4
;
1479 nc
->u
.integer4
= val
;
1480 #ifdef FFECOM_constantHOOK
1481 nc
->hook
= FFECOM_constantNULL
;
1489 /* ffebld_constant_new_integerbinary -- Return binary constant object from token
1493 Parses the token as a binary integer constant, thus it must be an
1494 FFELEX_typeNUMBER. */
1497 ffebld_constant_new_integerbinary (ffelexToken t
)
1499 ffetargetIntegerDefault val
;
1501 assert ((ffelex_token_type (t
) == FFELEX_typeNAME
)
1502 || (ffelex_token_type (t
) == FFELEX_typeNUMBER
));
1504 ffetarget_integerbinary (&val
, t
);
1505 return ffebld_constant_new_integerdefault_val (val
);
1508 /* ffebld_constant_new_integerhex -- Return hex constant object from token
1512 Parses the token as a hex integer constant, thus it must be an
1513 FFELEX_typeNUMBER. */
1516 ffebld_constant_new_integerhex (ffelexToken t
)
1518 ffetargetIntegerDefault val
;
1520 assert ((ffelex_token_type (t
) == FFELEX_typeNAME
)
1521 || (ffelex_token_type (t
) == FFELEX_typeNUMBER
));
1523 ffetarget_integerhex (&val
, t
);
1524 return ffebld_constant_new_integerdefault_val (val
);
1527 /* ffebld_constant_new_integeroctal -- Return octal constant object from token
1531 Parses the token as a octal integer constant, thus it must be an
1532 FFELEX_typeNUMBER. */
1535 ffebld_constant_new_integeroctal (ffelexToken t
)
1537 ffetargetIntegerDefault val
;
1539 assert ((ffelex_token_type (t
) == FFELEX_typeNAME
)
1540 || (ffelex_token_type (t
) == FFELEX_typeNUMBER
));
1542 ffetarget_integeroctal (&val
, t
);
1543 return ffebld_constant_new_integerdefault_val (val
);
1546 /* ffebld_constant_new_logical1 -- Return logical1 constant object from token
1550 Parses the token as a decimal logical constant, thus it must be an
1551 FFELEX_typeNUMBER. */
1553 #if FFETARGET_okLOGICAL1
1555 ffebld_constant_new_logical1 (bool truth
)
1557 ffetargetLogical1 val
;
1559 ffetarget_logical1 (&val
, truth
);
1560 return ffebld_constant_new_logical1_val (val
);
1564 /* ffebld_constant_new_logical1_val -- Return a logical1 constant object
1568 #if FFETARGET_okLOGICAL1
1570 ffebld_constant_new_logical1_val (ffetargetLogical1 val
)
1576 for (c
= (ffebldConstant
) &ffebld_constant_logical1_
;
1580 cmp
= ffetarget_cmp_logical1 (val
, ffebld_constant_logical1 (c
->next
));
1587 nc
= malloc_new_kp (ffebld_constant_pool(),
1588 "FFEBLD_constLOGICAL1",
1591 nc
->consttype
= FFEBLD_constLOGICAL1
;
1592 nc
->u
.logical1
= val
;
1593 #ifdef FFECOM_constantHOOK
1594 nc
->hook
= FFECOM_constantNULL
;
1602 /* ffebld_constant_new_logical2_val -- Return a logical2 constant object
1606 #if FFETARGET_okLOGICAL2
1608 ffebld_constant_new_logical2_val (ffetargetLogical2 val
)
1614 for (c
= (ffebldConstant
) &ffebld_constant_logical2_
;
1618 cmp
= ffetarget_cmp_logical2 (val
, ffebld_constant_logical2 (c
->next
));
1625 nc
= malloc_new_kp (ffebld_constant_pool(),
1626 "FFEBLD_constLOGICAL2",
1629 nc
->consttype
= FFEBLD_constLOGICAL2
;
1630 nc
->u
.logical2
= val
;
1631 #ifdef FFECOM_constantHOOK
1632 nc
->hook
= FFECOM_constantNULL
;
1640 /* ffebld_constant_new_logical3_val -- Return a logical3 constant object
1644 #if FFETARGET_okLOGICAL3
1646 ffebld_constant_new_logical3_val (ffetargetLogical3 val
)
1652 for (c
= (ffebldConstant
) &ffebld_constant_logical3_
;
1656 cmp
= ffetarget_cmp_logical3 (val
, ffebld_constant_logical3 (c
->next
));
1663 nc
= malloc_new_kp (ffebld_constant_pool(),
1664 "FFEBLD_constLOGICAL3",
1667 nc
->consttype
= FFEBLD_constLOGICAL3
;
1668 nc
->u
.logical3
= val
;
1669 #ifdef FFECOM_constantHOOK
1670 nc
->hook
= FFECOM_constantNULL
;
1678 /* ffebld_constant_new_logical4_val -- Return a logical4 constant object
1682 #if FFETARGET_okLOGICAL4
1684 ffebld_constant_new_logical4_val (ffetargetLogical4 val
)
1690 for (c
= (ffebldConstant
) &ffebld_constant_logical4_
;
1694 cmp
= ffetarget_cmp_logical4 (val
, ffebld_constant_logical4 (c
->next
));
1701 nc
= malloc_new_kp (ffebld_constant_pool(),
1702 "FFEBLD_constLOGICAL4",
1705 nc
->consttype
= FFEBLD_constLOGICAL4
;
1706 nc
->u
.logical4
= val
;
1707 #ifdef FFECOM_constantHOOK
1708 nc
->hook
= FFECOM_constantNULL
;
1716 /* ffebld_constant_new_real1 -- Return real1 constant object from token
1720 #if FFETARGET_okREAL1
1722 ffebld_constant_new_real1 (ffelexToken integer
, ffelexToken decimal
,
1723 ffelexToken fraction
, ffelexToken exponent
, ffelexToken exponent_sign
,
1724 ffelexToken exponent_digits
)
1728 ffetarget_real1 (&val
,
1729 integer
, decimal
, fraction
, exponent
, exponent_sign
, exponent_digits
);
1730 return ffebld_constant_new_real1_val (val
);
1734 /* ffebld_constant_new_real1_val -- Return an real1 constant object
1738 #if FFETARGET_okREAL1
1740 ffebld_constant_new_real1_val (ffetargetReal1 val
)
1746 for (c
= (ffebldConstant
) &ffebld_constant_real1_
;
1750 cmp
= ffetarget_cmp_real1 (val
, ffebld_constant_real1 (c
->next
));
1757 nc
= malloc_new_kp (ffebld_constant_pool(),
1758 "FFEBLD_constREAL1",
1761 nc
->consttype
= FFEBLD_constREAL1
;
1763 #ifdef FFECOM_constantHOOK
1764 nc
->hook
= FFECOM_constantNULL
;
1772 /* ffebld_constant_new_real2 -- Return real2 constant object from token
1776 #if FFETARGET_okREAL2
1778 ffebld_constant_new_real2 (ffelexToken integer
, ffelexToken decimal
,
1779 ffelexToken fraction
, ffelexToken exponent
, ffelexToken exponent_sign
,
1780 ffelexToken exponent_digits
)
1784 ffetarget_real2 (&val
,
1785 integer
, decimal
, fraction
, exponent
, exponent_sign
, exponent_digits
);
1786 return ffebld_constant_new_real2_val (val
);
1790 /* ffebld_constant_new_real2_val -- Return an real2 constant object
1794 #if FFETARGET_okREAL2
1796 ffebld_constant_new_real2_val (ffetargetReal2 val
)
1802 for (c
= (ffebldConstant
) &ffebld_constant_real2_
;
1806 cmp
= ffetarget_cmp_real2 (val
, ffebld_constant_real2 (c
->next
));
1813 nc
= malloc_new_kp (ffebld_constant_pool(),
1814 "FFEBLD_constREAL2",
1817 nc
->consttype
= FFEBLD_constREAL2
;
1819 #ifdef FFECOM_constantHOOK
1820 nc
->hook
= FFECOM_constantNULL
;
1828 /* ffebld_constant_new_typeless_bm -- Return typeless constant object from token
1832 Parses the token as a decimal integer constant, thus it must be an
1833 FFELEX_typeNUMBER. */
1836 ffebld_constant_new_typeless_bm (ffelexToken t
)
1838 ffetargetTypeless val
;
1840 ffetarget_binarymil (&val
, t
);
1841 return ffebld_constant_new_typeless_val (FFEBLD_constBINARY_MIL
, val
);
1844 /* ffebld_constant_new_typeless_bv -- Return typeless constant object from token
1848 Parses the token as a decimal integer constant, thus it must be an
1849 FFELEX_typeNUMBER. */
1852 ffebld_constant_new_typeless_bv (ffelexToken t
)
1854 ffetargetTypeless val
;
1856 ffetarget_binaryvxt (&val
, t
);
1857 return ffebld_constant_new_typeless_val (FFEBLD_constBINARY_VXT
, val
);
1860 /* ffebld_constant_new_typeless_hxm -- Return typeless constant object from token
1864 Parses the token as a decimal integer constant, thus it must be an
1865 FFELEX_typeNUMBER. */
1868 ffebld_constant_new_typeless_hxm (ffelexToken t
)
1870 ffetargetTypeless val
;
1872 ffetarget_hexxmil (&val
, t
);
1873 return ffebld_constant_new_typeless_val (FFEBLD_constHEX_X_MIL
, val
);
1876 /* ffebld_constant_new_typeless_hxv -- Return typeless constant object from token
1880 Parses the token as a decimal integer constant, thus it must be an
1881 FFELEX_typeNUMBER. */
1884 ffebld_constant_new_typeless_hxv (ffelexToken t
)
1886 ffetargetTypeless val
;
1888 ffetarget_hexxvxt (&val
, t
);
1889 return ffebld_constant_new_typeless_val (FFEBLD_constHEX_X_VXT
, val
);
1892 /* ffebld_constant_new_typeless_hzm -- Return typeless constant object from token
1896 Parses the token as a decimal integer constant, thus it must be an
1897 FFELEX_typeNUMBER. */
1900 ffebld_constant_new_typeless_hzm (ffelexToken t
)
1902 ffetargetTypeless val
;
1904 ffetarget_hexzmil (&val
, t
);
1905 return ffebld_constant_new_typeless_val (FFEBLD_constHEX_Z_MIL
, val
);
1908 /* ffebld_constant_new_typeless_hzv -- Return typeless constant object from token
1912 Parses the token as a decimal integer constant, thus it must be an
1913 FFELEX_typeNUMBER. */
1916 ffebld_constant_new_typeless_hzv (ffelexToken t
)
1918 ffetargetTypeless val
;
1920 ffetarget_hexzvxt (&val
, t
);
1921 return ffebld_constant_new_typeless_val (FFEBLD_constHEX_Z_VXT
, val
);
1924 /* ffebld_constant_new_typeless_om -- Return typeless constant object from token
1928 Parses the token as a decimal integer constant, thus it must be an
1929 FFELEX_typeNUMBER. */
1932 ffebld_constant_new_typeless_om (ffelexToken t
)
1934 ffetargetTypeless val
;
1936 ffetarget_octalmil (&val
, t
);
1937 return ffebld_constant_new_typeless_val (FFEBLD_constOCTAL_MIL
, val
);
1940 /* ffebld_constant_new_typeless_ov -- Return typeless constant object from token
1944 Parses the token as a decimal integer constant, thus it must be an
1945 FFELEX_typeNUMBER. */
1948 ffebld_constant_new_typeless_ov (ffelexToken t
)
1950 ffetargetTypeless val
;
1952 ffetarget_octalvxt (&val
, t
);
1953 return ffebld_constant_new_typeless_val (FFEBLD_constOCTAL_VXT
, val
);
1956 /* ffebld_constant_new_typeless_val -- Return a typeless constant object
1961 ffebld_constant_new_typeless_val (ffebldConst type
, ffetargetTypeless val
)
1967 for (c
= (ffebldConstant
) &ffebld_constant_typeless_
[type
1968 - FFEBLD_constTYPELESS_FIRST
];
1972 cmp
= ffetarget_cmp_typeless (val
, ffebld_constant_typeless (c
->next
));
1979 nc
= malloc_new_kp (ffebld_constant_pool(),
1980 "FFEBLD_constTYPELESS",
1983 nc
->consttype
= type
;
1984 nc
->u
.typeless
= val
;
1985 #ifdef FFECOM_constantHOOK
1986 nc
->hook
= FFECOM_constantNULL
;
1993 /* ffebld_constantarray_dump -- Display summary of array's contents
1995 ffebldConstantArray a;
1996 ffeinfoBasictype bt;
1998 ffetargetOffset size;
1999 ffebld_constant_dump(a,bt,kt,size,NULL);
2001 Displays the constant array in summary form. The fifth argument, if
2002 supplied, is an ffebit object that is consulted as to whether the
2003 constant at a particular offset is valid. */
2006 ffebld_constantarray_dump (ffebldConstantArray array
, ffeinfoBasictype bt
,
2007 ffeinfoKindtype kt
, ffetargetOffset size
, ffebit bits
)
2012 ffebld_dump_prefix (dmpout
, bt
, kt
);
2014 fprintf (dmpout
, "\\(");
2018 for (i
= 0; i
< size
; ++i
)
2020 ffebld_constantunion_dump (ffebld_constantarray_get (array
, bt
, kt
, i
), bt
,
2023 fputc (',', dmpout
);
2030 ffetargetOffset offset
= 0;
2034 ffebit_test (bits
, offset
, &value
, &length
);
2035 if (value
&& (length
!= 0))
2038 fprintf (dmpout
, "[%" ffetargetOffset_f
"d]:", offset
);
2041 "[%" ffetargetOffset_f
"u..%" ffetargetOffset_f
"d]:",
2042 offset
, offset
+ (ffetargetOffset
) length
- 1);
2043 for (j
= 0; j
< length
; ++j
, ++offset
)
2045 ffebld_constantunion_dump (ffebld_constantarray_get (array
, bt
, kt
,
2047 if (j
!= length
- 1)
2048 fputc (',', dmpout
);
2050 fprintf (dmpout
, ";");
2055 while (length
!= 0);
2057 fprintf (dmpout
, "\\)");
2061 /* ffebld_constantarray_get -- Get a value from an array of constants
2066 ffebld_constantarray_get (ffebldConstantArray array
, ffeinfoBasictype bt
,
2067 ffeinfoKindtype kt
, ffetargetOffset offset
)
2069 ffebldConstantUnion u
;
2073 case FFEINFO_basictypeINTEGER
:
2076 #if FFETARGET_okINTEGER1
2077 case FFEINFO_kindtypeINTEGER1
:
2078 u
.integer1
= *(array
.integer1
+ offset
);
2082 #if FFETARGET_okINTEGER2
2083 case FFEINFO_kindtypeINTEGER2
:
2084 u
.integer2
= *(array
.integer2
+ offset
);
2088 #if FFETARGET_okINTEGER3
2089 case FFEINFO_kindtypeINTEGER3
:
2090 u
.integer3
= *(array
.integer3
+ offset
);
2094 #if FFETARGET_okINTEGER4
2095 case FFEINFO_kindtypeINTEGER4
:
2096 u
.integer4
= *(array
.integer4
+ offset
);
2100 #if FFETARGET_okINTEGER5
2101 case FFEINFO_kindtypeINTEGER5
:
2102 u
.integer5
= *(array
.integer5
+ offset
);
2106 #if FFETARGET_okINTEGER6
2107 case FFEINFO_kindtypeINTEGER6
:
2108 u
.integer6
= *(array
.integer6
+ offset
);
2112 #if FFETARGET_okINTEGER7
2113 case FFEINFO_kindtypeINTEGER7
:
2114 u
.integer7
= *(array
.integer7
+ offset
);
2118 #if FFETARGET_okINTEGER8
2119 case FFEINFO_kindtypeINTEGER8
:
2120 u
.integer8
= *(array
.integer8
+ offset
);
2125 assert ("bad INTEGER kindtype" == NULL
);
2130 case FFEINFO_basictypeLOGICAL
:
2133 #if FFETARGET_okLOGICAL1
2134 case FFEINFO_kindtypeLOGICAL1
:
2135 u
.logical1
= *(array
.logical1
+ offset
);
2139 #if FFETARGET_okLOGICAL2
2140 case FFEINFO_kindtypeLOGICAL2
:
2141 u
.logical2
= *(array
.logical2
+ offset
);
2145 #if FFETARGET_okLOGICAL3
2146 case FFEINFO_kindtypeLOGICAL3
:
2147 u
.logical3
= *(array
.logical3
+ offset
);
2151 #if FFETARGET_okLOGICAL4
2152 case FFEINFO_kindtypeLOGICAL4
:
2153 u
.logical4
= *(array
.logical4
+ offset
);
2157 #if FFETARGET_okLOGICAL5
2158 case FFEINFO_kindtypeLOGICAL5
:
2159 u
.logical5
= *(array
.logical5
+ offset
);
2163 #if FFETARGET_okLOGICAL6
2164 case FFEINFO_kindtypeLOGICAL6
:
2165 u
.logical6
= *(array
.logical6
+ offset
);
2169 #if FFETARGET_okLOGICAL7
2170 case FFEINFO_kindtypeLOGICAL7
:
2171 u
.logical7
= *(array
.logical7
+ offset
);
2175 #if FFETARGET_okLOGICAL8
2176 case FFEINFO_kindtypeLOGICAL8
:
2177 u
.logical8
= *(array
.logical8
+ offset
);
2182 assert ("bad LOGICAL kindtype" == NULL
);
2187 case FFEINFO_basictypeREAL
:
2190 #if FFETARGET_okREAL1
2191 case FFEINFO_kindtypeREAL1
:
2192 u
.real1
= *(array
.real1
+ offset
);
2196 #if FFETARGET_okREAL2
2197 case FFEINFO_kindtypeREAL2
:
2198 u
.real2
= *(array
.real2
+ offset
);
2202 #if FFETARGET_okREAL3
2203 case FFEINFO_kindtypeREAL3
:
2204 u
.real3
= *(array
.real3
+ offset
);
2208 #if FFETARGET_okREAL4
2209 case FFEINFO_kindtypeREAL4
:
2210 u
.real4
= *(array
.real4
+ offset
);
2214 #if FFETARGET_okREAL5
2215 case FFEINFO_kindtypeREAL5
:
2216 u
.real5
= *(array
.real5
+ offset
);
2220 #if FFETARGET_okREAL6
2221 case FFEINFO_kindtypeREAL6
:
2222 u
.real6
= *(array
.real6
+ offset
);
2226 #if FFETARGET_okREAL7
2227 case FFEINFO_kindtypeREAL7
:
2228 u
.real7
= *(array
.real7
+ offset
);
2232 #if FFETARGET_okREAL8
2233 case FFEINFO_kindtypeREAL8
:
2234 u
.real8
= *(array
.real8
+ offset
);
2239 assert ("bad REAL kindtype" == NULL
);
2244 case FFEINFO_basictypeCOMPLEX
:
2247 #if FFETARGET_okCOMPLEX1
2248 case FFEINFO_kindtypeREAL1
:
2249 u
.complex1
= *(array
.complex1
+ offset
);
2253 #if FFETARGET_okCOMPLEX2
2254 case FFEINFO_kindtypeREAL2
:
2255 u
.complex2
= *(array
.complex2
+ offset
);
2259 #if FFETARGET_okCOMPLEX3
2260 case FFEINFO_kindtypeREAL3
:
2261 u
.complex3
= *(array
.complex3
+ offset
);
2265 #if FFETARGET_okCOMPLEX4
2266 case FFEINFO_kindtypeREAL4
:
2267 u
.complex4
= *(array
.complex4
+ offset
);
2271 #if FFETARGET_okCOMPLEX5
2272 case FFEINFO_kindtypeREAL5
:
2273 u
.complex5
= *(array
.complex5
+ offset
);
2277 #if FFETARGET_okCOMPLEX6
2278 case FFEINFO_kindtypeREAL6
:
2279 u
.complex6
= *(array
.complex6
+ offset
);
2283 #if FFETARGET_okCOMPLEX7
2284 case FFEINFO_kindtypeREAL7
:
2285 u
.complex7
= *(array
.complex7
+ offset
);
2289 #if FFETARGET_okCOMPLEX8
2290 case FFEINFO_kindtypeREAL8
:
2291 u
.complex8
= *(array
.complex8
+ offset
);
2296 assert ("bad COMPLEX kindtype" == NULL
);
2301 case FFEINFO_basictypeCHARACTER
:
2304 #if FFETARGET_okCHARACTER1
2305 case FFEINFO_kindtypeCHARACTER1
:
2306 u
.character1
.length
= 1;
2307 u
.character1
.text
= array
.character1
+ offset
;
2311 #if FFETARGET_okCHARACTER2
2312 case FFEINFO_kindtypeCHARACTER2
:
2313 u
.character2
.length
= 1;
2314 u
.character2
.text
= array
.character2
+ offset
;
2318 #if FFETARGET_okCHARACTER3
2319 case FFEINFO_kindtypeCHARACTER3
:
2320 u
.character3
.length
= 1;
2321 u
.character3
.text
= array
.character3
+ offset
;
2325 #if FFETARGET_okCHARACTER4
2326 case FFEINFO_kindtypeCHARACTER4
:
2327 u
.character4
.length
= 1;
2328 u
.character4
.text
= array
.character4
+ offset
;
2332 #if FFETARGET_okCHARACTER5
2333 case FFEINFO_kindtypeCHARACTER5
:
2334 u
.character5
.length
= 1;
2335 u
.character5
.text
= array
.character5
+ offset
;
2339 #if FFETARGET_okCHARACTER6
2340 case FFEINFO_kindtypeCHARACTER6
:
2341 u
.character6
.length
= 1;
2342 u
.character6
.text
= array
.character6
+ offset
;
2346 #if FFETARGET_okCHARACTER7
2347 case FFEINFO_kindtypeCHARACTER7
:
2348 u
.character7
.length
= 1;
2349 u
.character7
.text
= array
.character7
+ offset
;
2353 #if FFETARGET_okCHARACTER8
2354 case FFEINFO_kindtypeCHARACTER8
:
2355 u
.character8
.length
= 1;
2356 u
.character8
.text
= array
.character8
+ offset
;
2361 assert ("bad CHARACTER kindtype" == NULL
);
2367 assert ("bad basictype" == NULL
);
2374 /* ffebld_constantarray_new -- Make an array of constants
2379 ffebld_constantarray_new (ffeinfoBasictype bt
,
2380 ffeinfoKindtype kt
, ffetargetOffset size
)
2382 ffebldConstantArray ptr
;
2386 case FFEINFO_basictypeINTEGER
:
2389 #if FFETARGET_okINTEGER1
2390 case FFEINFO_kindtypeINTEGER1
:
2391 ptr
.integer1
= malloc_new_zkp (ffebld_constant_pool(),
2392 "ffebldConstantArray",
2393 size
*= sizeof (ffetargetInteger1
),
2398 #if FFETARGET_okINTEGER2
2399 case FFEINFO_kindtypeINTEGER2
:
2400 ptr
.integer2
= malloc_new_zkp (ffebld_constant_pool(),
2401 "ffebldConstantArray",
2402 size
*= sizeof (ffetargetInteger2
),
2407 #if FFETARGET_okINTEGER3
2408 case FFEINFO_kindtypeINTEGER3
:
2409 ptr
.integer3
= malloc_new_zkp (ffebld_constant_pool(),
2410 "ffebldConstantArray",
2411 size
*= sizeof (ffetargetInteger3
),
2416 #if FFETARGET_okINTEGER4
2417 case FFEINFO_kindtypeINTEGER4
:
2418 ptr
.integer4
= malloc_new_zkp (ffebld_constant_pool(),
2419 "ffebldConstantArray",
2420 size
*= sizeof (ffetargetInteger4
),
2425 #if FFETARGET_okINTEGER5
2426 case FFEINFO_kindtypeINTEGER5
:
2427 ptr
.integer5
= malloc_new_zkp (ffebld_constant_pool(),
2428 "ffebldConstantArray",
2429 size
*= sizeof (ffetargetInteger5
),
2434 #if FFETARGET_okINTEGER6
2435 case FFEINFO_kindtypeINTEGER6
:
2436 ptr
.integer6
= malloc_new_zkp (ffebld_constant_pool(),
2437 "ffebldConstantArray",
2438 size
*= sizeof (ffetargetInteger6
),
2443 #if FFETARGET_okINTEGER7
2444 case FFEINFO_kindtypeINTEGER7
:
2445 ptr
.integer7
= malloc_new_zkp (ffebld_constant_pool(),
2446 "ffebldConstantArray",
2447 size
*= sizeof (ffetargetInteger7
),
2452 #if FFETARGET_okINTEGER8
2453 case FFEINFO_kindtypeINTEGER8
:
2454 ptr
.integer8
= malloc_new_zkp (ffebld_constant_pool(),
2455 "ffebldConstantArray",
2456 size
*= sizeof (ffetargetInteger8
),
2462 assert ("bad INTEGER kindtype" == NULL
);
2467 case FFEINFO_basictypeLOGICAL
:
2470 #if FFETARGET_okLOGICAL1
2471 case FFEINFO_kindtypeLOGICAL1
:
2472 ptr
.logical1
= malloc_new_zkp (ffebld_constant_pool(),
2473 "ffebldConstantArray",
2474 size
*= sizeof (ffetargetLogical1
),
2479 #if FFETARGET_okLOGICAL2
2480 case FFEINFO_kindtypeLOGICAL2
:
2481 ptr
.logical2
= malloc_new_zkp (ffebld_constant_pool(),
2482 "ffebldConstantArray",
2483 size
*= sizeof (ffetargetLogical2
),
2488 #if FFETARGET_okLOGICAL3
2489 case FFEINFO_kindtypeLOGICAL3
:
2490 ptr
.logical3
= malloc_new_zkp (ffebld_constant_pool(),
2491 "ffebldConstantArray",
2492 size
*= sizeof (ffetargetLogical3
),
2497 #if FFETARGET_okLOGICAL4
2498 case FFEINFO_kindtypeLOGICAL4
:
2499 ptr
.logical4
= malloc_new_zkp (ffebld_constant_pool(),
2500 "ffebldConstantArray",
2501 size
*= sizeof (ffetargetLogical4
),
2506 #if FFETARGET_okLOGICAL5
2507 case FFEINFO_kindtypeLOGICAL5
:
2508 ptr
.logical5
= malloc_new_zkp (ffebld_constant_pool(),
2509 "ffebldConstantArray",
2510 size
*= sizeof (ffetargetLogical5
),
2515 #if FFETARGET_okLOGICAL6
2516 case FFEINFO_kindtypeLOGICAL6
:
2517 ptr
.logical6
= malloc_new_zkp (ffebld_constant_pool(),
2518 "ffebldConstantArray",
2519 size
*= sizeof (ffetargetLogical6
),
2524 #if FFETARGET_okLOGICAL7
2525 case FFEINFO_kindtypeLOGICAL7
:
2526 ptr
.logical7
= malloc_new_zkp (ffebld_constant_pool(),
2527 "ffebldConstantArray",
2528 size
*= sizeof (ffetargetLogical7
),
2533 #if FFETARGET_okLOGICAL8
2534 case FFEINFO_kindtypeLOGICAL8
:
2535 ptr
.logical8
= malloc_new_zkp (ffebld_constant_pool(),
2536 "ffebldConstantArray",
2537 size
*= sizeof (ffetargetLogical8
),
2543 assert ("bad LOGICAL kindtype" == NULL
);
2548 case FFEINFO_basictypeREAL
:
2551 #if FFETARGET_okREAL1
2552 case FFEINFO_kindtypeREAL1
:
2553 ptr
.real1
= malloc_new_zkp (ffebld_constant_pool(),
2554 "ffebldConstantArray",
2555 size
*= sizeof (ffetargetReal1
),
2560 #if FFETARGET_okREAL2
2561 case FFEINFO_kindtypeREAL2
:
2562 ptr
.real2
= malloc_new_zkp (ffebld_constant_pool(),
2563 "ffebldConstantArray",
2564 size
*= sizeof (ffetargetReal2
),
2569 #if FFETARGET_okREAL3
2570 case FFEINFO_kindtypeREAL3
:
2571 ptr
.real3
= malloc_new_zkp (ffebld_constant_pool(),
2572 "ffebldConstantArray",
2573 size
*= sizeof (ffetargetReal3
),
2578 #if FFETARGET_okREAL4
2579 case FFEINFO_kindtypeREAL4
:
2580 ptr
.real4
= malloc_new_zkp (ffebld_constant_pool(),
2581 "ffebldConstantArray",
2582 size
*= sizeof (ffetargetReal4
),
2587 #if FFETARGET_okREAL5
2588 case FFEINFO_kindtypeREAL5
:
2589 ptr
.real5
= malloc_new_zkp (ffebld_constant_pool(),
2590 "ffebldConstantArray",
2591 size
*= sizeof (ffetargetReal5
),
2596 #if FFETARGET_okREAL6
2597 case FFEINFO_kindtypeREAL6
:
2598 ptr
.real6
= malloc_new_zkp (ffebld_constant_pool(),
2599 "ffebldConstantArray",
2600 size
*= sizeof (ffetargetReal6
),
2605 #if FFETARGET_okREAL7
2606 case FFEINFO_kindtypeREAL7
:
2607 ptr
.real7
= malloc_new_zkp (ffebld_constant_pool(),
2608 "ffebldConstantArray",
2609 size
*= sizeof (ffetargetReal7
),
2614 #if FFETARGET_okREAL8
2615 case FFEINFO_kindtypeREAL8
:
2616 ptr
.real8
= malloc_new_zkp (ffebld_constant_pool(),
2617 "ffebldConstantArray",
2618 size
*= sizeof (ffetargetReal8
),
2624 assert ("bad REAL kindtype" == NULL
);
2629 case FFEINFO_basictypeCOMPLEX
:
2632 #if FFETARGET_okCOMPLEX1
2633 case FFEINFO_kindtypeREAL1
:
2634 ptr
.complex1
= malloc_new_zkp (ffebld_constant_pool(),
2635 "ffebldConstantArray",
2636 size
*= sizeof (ffetargetComplex1
),
2641 #if FFETARGET_okCOMPLEX2
2642 case FFEINFO_kindtypeREAL2
:
2643 ptr
.complex2
= malloc_new_zkp (ffebld_constant_pool(),
2644 "ffebldConstantArray",
2645 size
*= sizeof (ffetargetComplex2
),
2650 #if FFETARGET_okCOMPLEX3
2651 case FFEINFO_kindtypeREAL3
:
2652 ptr
.complex3
= malloc_new_zkp (ffebld_constant_pool(),
2653 "ffebldConstantArray",
2654 size
*= sizeof (ffetargetComplex3
),
2659 #if FFETARGET_okCOMPLEX4
2660 case FFEINFO_kindtypeREAL4
:
2661 ptr
.complex4
= malloc_new_zkp (ffebld_constant_pool(),
2662 "ffebldConstantArray",
2663 size
*= sizeof (ffetargetComplex4
),
2668 #if FFETARGET_okCOMPLEX5
2669 case FFEINFO_kindtypeREAL5
:
2670 ptr
.complex5
= malloc_new_zkp (ffebld_constant_pool(),
2671 "ffebldConstantArray",
2672 size
*= sizeof (ffetargetComplex5
),
2677 #if FFETARGET_okCOMPLEX6
2678 case FFEINFO_kindtypeREAL6
:
2679 ptr
.complex6
= malloc_new_zkp (ffebld_constant_pool(),
2680 "ffebldConstantArray",
2681 size
*= sizeof (ffetargetComplex6
),
2686 #if FFETARGET_okCOMPLEX7
2687 case FFEINFO_kindtypeREAL7
:
2688 ptr
.complex7
= malloc_new_zkp (ffebld_constant_pool(),
2689 "ffebldConstantArray",
2690 size
*= sizeof (ffetargetComplex7
),
2695 #if FFETARGET_okCOMPLEX8
2696 case FFEINFO_kindtypeREAL8
:
2697 ptr
.complex8
= malloc_new_zkp (ffebld_constant_pool(),
2698 "ffebldConstantArray",
2699 size
*= sizeof (ffetargetComplex8
),
2705 assert ("bad COMPLEX kindtype" == NULL
);
2710 case FFEINFO_basictypeCHARACTER
:
2713 #if FFETARGET_okCHARACTER1
2714 case FFEINFO_kindtypeCHARACTER1
:
2715 ptr
.character1
= malloc_new_zkp (ffebld_constant_pool(),
2716 "ffebldConstantArray",
2718 *= sizeof (ffetargetCharacterUnit1
),
2723 #if FFETARGET_okCHARACTER2
2724 case FFEINFO_kindtypeCHARACTER2
:
2725 ptr
.character2
= malloc_new_zkp (ffebld_constant_pool(),
2726 "ffebldConstantArray",
2728 *= sizeof (ffetargetCharacterUnit2
),
2733 #if FFETARGET_okCHARACTER3
2734 case FFEINFO_kindtypeCHARACTER3
:
2735 ptr
.character3
= malloc_new_zkp (ffebld_constant_pool(),
2736 "ffebldConstantArray",
2738 *= sizeof (ffetargetCharacterUnit3
),
2743 #if FFETARGET_okCHARACTER4
2744 case FFEINFO_kindtypeCHARACTER4
:
2745 ptr
.character4
= malloc_new_zkp (ffebld_constant_pool(),
2746 "ffebldConstantArray",
2748 *= sizeof (ffetargetCharacterUnit4
),
2753 #if FFETARGET_okCHARACTER5
2754 case FFEINFO_kindtypeCHARACTER5
:
2755 ptr
.character5
= malloc_new_zkp (ffebld_constant_pool(),
2756 "ffebldConstantArray",
2758 *= sizeof (ffetargetCharacterUnit5
),
2763 #if FFETARGET_okCHARACTER6
2764 case FFEINFO_kindtypeCHARACTER6
:
2765 ptr
.character6
= malloc_new_zkp (ffebld_constant_pool(),
2766 "ffebldConstantArray",
2768 *= sizeof (ffetargetCharacterUnit6
),
2773 #if FFETARGET_okCHARACTER7
2774 case FFEINFO_kindtypeCHARACTER7
:
2775 ptr
.character7
= malloc_new_zkp (ffebld_constant_pool(),
2776 "ffebldConstantArray",
2778 *= sizeof (ffetargetCharacterUnit7
),
2783 #if FFETARGET_okCHARACTER8
2784 case FFEINFO_kindtypeCHARACTER8
:
2785 ptr
.character8
= malloc_new_zkp (ffebld_constant_pool(),
2786 "ffebldConstantArray",
2788 *= sizeof (ffetargetCharacterUnit8
),
2794 assert ("bad CHARACTER kindtype" == NULL
);
2800 assert ("bad basictype" == NULL
);
2807 /* ffebld_constantarray_preparray -- Prepare for copy between arrays
2811 Like _prepare, but the source is an array instead of a single-value
2815 ffebld_constantarray_preparray (void **aptr
, void **cptr
, size_t *size
,
2816 ffebldConstantArray array
, ffeinfoBasictype abt
, ffeinfoKindtype akt
,
2817 ffetargetOffset offset
, ffebldConstantArray source_array
,
2818 ffeinfoBasictype cbt
, ffeinfoKindtype ckt
)
2822 case FFEINFO_basictypeINTEGER
:
2825 #if FFETARGET_okINTEGER1
2826 case FFEINFO_kindtypeINTEGER1
:
2827 *aptr
= array
.integer1
+ offset
;
2831 #if FFETARGET_okINTEGER2
2832 case FFEINFO_kindtypeINTEGER2
:
2833 *aptr
= array
.integer2
+ offset
;
2837 #if FFETARGET_okINTEGER3
2838 case FFEINFO_kindtypeINTEGER3
:
2839 *aptr
= array
.integer3
+ offset
;
2843 #if FFETARGET_okINTEGER4
2844 case FFEINFO_kindtypeINTEGER4
:
2845 *aptr
= array
.integer4
+ offset
;
2849 #if FFETARGET_okINTEGER5
2850 case FFEINFO_kindtypeINTEGER5
:
2851 *aptr
= array
.integer5
+ offset
;
2855 #if FFETARGET_okINTEGER6
2856 case FFEINFO_kindtypeINTEGER6
:
2857 *aptr
= array
.integer6
+ offset
;
2861 #if FFETARGET_okINTEGER7
2862 case FFEINFO_kindtypeINTEGER7
:
2863 *aptr
= array
.integer7
+ offset
;
2867 #if FFETARGET_okINTEGER8
2868 case FFEINFO_kindtypeINTEGER8
:
2869 *aptr
= array
.integer8
+ offset
;
2874 assert ("bad INTEGER akindtype" == NULL
);
2879 case FFEINFO_basictypeLOGICAL
:
2882 #if FFETARGET_okLOGICAL1
2883 case FFEINFO_kindtypeLOGICAL1
:
2884 *aptr
= array
.logical1
+ offset
;
2888 #if FFETARGET_okLOGICAL2
2889 case FFEINFO_kindtypeLOGICAL2
:
2890 *aptr
= array
.logical2
+ offset
;
2894 #if FFETARGET_okLOGICAL3
2895 case FFEINFO_kindtypeLOGICAL3
:
2896 *aptr
= array
.logical3
+ offset
;
2900 #if FFETARGET_okLOGICAL4
2901 case FFEINFO_kindtypeLOGICAL4
:
2902 *aptr
= array
.logical4
+ offset
;
2906 #if FFETARGET_okLOGICAL5
2907 case FFEINFO_kindtypeLOGICAL5
:
2908 *aptr
= array
.logical5
+ offset
;
2912 #if FFETARGET_okLOGICAL6
2913 case FFEINFO_kindtypeLOGICAL6
:
2914 *aptr
= array
.logical6
+ offset
;
2918 #if FFETARGET_okLOGICAL7
2919 case FFEINFO_kindtypeLOGICAL7
:
2920 *aptr
= array
.logical7
+ offset
;
2924 #if FFETARGET_okLOGICAL8
2925 case FFEINFO_kindtypeLOGICAL8
:
2926 *aptr
= array
.logical8
+ offset
;
2931 assert ("bad LOGICAL akindtype" == NULL
);
2936 case FFEINFO_basictypeREAL
:
2939 #if FFETARGET_okREAL1
2940 case FFEINFO_kindtypeREAL1
:
2941 *aptr
= array
.real1
+ offset
;
2945 #if FFETARGET_okREAL2
2946 case FFEINFO_kindtypeREAL2
:
2947 *aptr
= array
.real2
+ offset
;
2951 #if FFETARGET_okREAL3
2952 case FFEINFO_kindtypeREAL3
:
2953 *aptr
= array
.real3
+ offset
;
2957 #if FFETARGET_okREAL4
2958 case FFEINFO_kindtypeREAL4
:
2959 *aptr
= array
.real4
+ offset
;
2963 #if FFETARGET_okREAL5
2964 case FFEINFO_kindtypeREAL5
:
2965 *aptr
= array
.real5
+ offset
;
2969 #if FFETARGET_okREAL6
2970 case FFEINFO_kindtypeREAL6
:
2971 *aptr
= array
.real6
+ offset
;
2975 #if FFETARGET_okREAL7
2976 case FFEINFO_kindtypeREAL7
:
2977 *aptr
= array
.real7
+ offset
;
2981 #if FFETARGET_okREAL8
2982 case FFEINFO_kindtypeREAL8
:
2983 *aptr
= array
.real8
+ offset
;
2988 assert ("bad REAL akindtype" == NULL
);
2993 case FFEINFO_basictypeCOMPLEX
:
2996 #if FFETARGET_okCOMPLEX1
2997 case FFEINFO_kindtypeREAL1
:
2998 *aptr
= array
.complex1
+ offset
;
3002 #if FFETARGET_okCOMPLEX2
3003 case FFEINFO_kindtypeREAL2
:
3004 *aptr
= array
.complex2
+ offset
;
3008 #if FFETARGET_okCOMPLEX3
3009 case FFEINFO_kindtypeREAL3
:
3010 *aptr
= array
.complex3
+ offset
;
3014 #if FFETARGET_okCOMPLEX4
3015 case FFEINFO_kindtypeREAL4
:
3016 *aptr
= array
.complex4
+ offset
;
3020 #if FFETARGET_okCOMPLEX5
3021 case FFEINFO_kindtypeREAL5
:
3022 *aptr
= array
.complex5
+ offset
;
3026 #if FFETARGET_okCOMPLEX6
3027 case FFEINFO_kindtypeREAL6
:
3028 *aptr
= array
.complex6
+ offset
;
3032 #if FFETARGET_okCOMPLEX7
3033 case FFEINFO_kindtypeREAL7
:
3034 *aptr
= array
.complex7
+ offset
;
3038 #if FFETARGET_okCOMPLEX8
3039 case FFEINFO_kindtypeREAL8
:
3040 *aptr
= array
.complex8
+ offset
;
3045 assert ("bad COMPLEX akindtype" == NULL
);
3050 case FFEINFO_basictypeCHARACTER
:
3053 #if FFETARGET_okCHARACTER1
3054 case FFEINFO_kindtypeCHARACTER1
:
3055 *aptr
= array
.character1
+ offset
;
3059 #if FFETARGET_okCHARACTER2
3060 case FFEINFO_kindtypeCHARACTER2
:
3061 *aptr
= array
.character2
+ offset
;
3065 #if FFETARGET_okCHARACTER3
3066 case FFEINFO_kindtypeCHARACTER3
:
3067 *aptr
= array
.character3
+ offset
;
3071 #if FFETARGET_okCHARACTER4
3072 case FFEINFO_kindtypeCHARACTER4
:
3073 *aptr
= array
.character4
+ offset
;
3077 #if FFETARGET_okCHARACTER5
3078 case FFEINFO_kindtypeCHARACTER5
:
3079 *aptr
= array
.character5
+ offset
;
3083 #if FFETARGET_okCHARACTER6
3084 case FFEINFO_kindtypeCHARACTER6
:
3085 *aptr
= array
.character6
+ offset
;
3089 #if FFETARGET_okCHARACTER7
3090 case FFEINFO_kindtypeCHARACTER7
:
3091 *aptr
= array
.character7
+ offset
;
3095 #if FFETARGET_okCHARACTER8
3096 case FFEINFO_kindtypeCHARACTER8
:
3097 *aptr
= array
.character8
+ offset
;
3102 assert ("bad CHARACTER akindtype" == NULL
);
3108 assert ("bad abasictype" == NULL
);
3114 case FFEINFO_basictypeINTEGER
:
3117 #if FFETARGET_okINTEGER1
3118 case FFEINFO_kindtypeINTEGER1
:
3119 *cptr
= source_array
.integer1
;
3120 *size
= sizeof (*source_array
.integer1
);
3124 #if FFETARGET_okINTEGER2
3125 case FFEINFO_kindtypeINTEGER2
:
3126 *cptr
= source_array
.integer2
;
3127 *size
= sizeof (*source_array
.integer2
);
3131 #if FFETARGET_okINTEGER3
3132 case FFEINFO_kindtypeINTEGER3
:
3133 *cptr
= source_array
.integer3
;
3134 *size
= sizeof (*source_array
.integer3
);
3138 #if FFETARGET_okINTEGER4
3139 case FFEINFO_kindtypeINTEGER4
:
3140 *cptr
= source_array
.integer4
;
3141 *size
= sizeof (*source_array
.integer4
);
3145 #if FFETARGET_okINTEGER5
3146 case FFEINFO_kindtypeINTEGER5
:
3147 *cptr
= source_array
.integer5
;
3148 *size
= sizeof (*source_array
.integer5
);
3152 #if FFETARGET_okINTEGER6
3153 case FFEINFO_kindtypeINTEGER6
:
3154 *cptr
= source_array
.integer6
;
3155 *size
= sizeof (*source_array
.integer6
);
3159 #if FFETARGET_okINTEGER7
3160 case FFEINFO_kindtypeINTEGER7
:
3161 *cptr
= source_array
.integer7
;
3162 *size
= sizeof (*source_array
.integer7
);
3166 #if FFETARGET_okINTEGER8
3167 case FFEINFO_kindtypeINTEGER8
:
3168 *cptr
= source_array
.integer8
;
3169 *size
= sizeof (*source_array
.integer8
);
3174 assert ("bad INTEGER ckindtype" == NULL
);
3179 case FFEINFO_basictypeLOGICAL
:
3182 #if FFETARGET_okLOGICAL1
3183 case FFEINFO_kindtypeLOGICAL1
:
3184 *cptr
= source_array
.logical1
;
3185 *size
= sizeof (*source_array
.logical1
);
3189 #if FFETARGET_okLOGICAL2
3190 case FFEINFO_kindtypeLOGICAL2
:
3191 *cptr
= source_array
.logical2
;
3192 *size
= sizeof (*source_array
.logical2
);
3196 #if FFETARGET_okLOGICAL3
3197 case FFEINFO_kindtypeLOGICAL3
:
3198 *cptr
= source_array
.logical3
;
3199 *size
= sizeof (*source_array
.logical3
);
3203 #if FFETARGET_okLOGICAL4
3204 case FFEINFO_kindtypeLOGICAL4
:
3205 *cptr
= source_array
.logical4
;
3206 *size
= sizeof (*source_array
.logical4
);
3210 #if FFETARGET_okLOGICAL5
3211 case FFEINFO_kindtypeLOGICAL5
:
3212 *cptr
= source_array
.logical5
;
3213 *size
= sizeof (*source_array
.logical5
);
3217 #if FFETARGET_okLOGICAL6
3218 case FFEINFO_kindtypeLOGICAL6
:
3219 *cptr
= source_array
.logical6
;
3220 *size
= sizeof (*source_array
.logical6
);
3224 #if FFETARGET_okLOGICAL7
3225 case FFEINFO_kindtypeLOGICAL7
:
3226 *cptr
= source_array
.logical7
;
3227 *size
= sizeof (*source_array
.logical7
);
3231 #if FFETARGET_okLOGICAL8
3232 case FFEINFO_kindtypeLOGICAL8
:
3233 *cptr
= source_array
.logical8
;
3234 *size
= sizeof (*source_array
.logical8
);
3239 assert ("bad LOGICAL ckindtype" == NULL
);
3244 case FFEINFO_basictypeREAL
:
3247 #if FFETARGET_okREAL1
3248 case FFEINFO_kindtypeREAL1
:
3249 *cptr
= source_array
.real1
;
3250 *size
= sizeof (*source_array
.real1
);
3254 #if FFETARGET_okREAL2
3255 case FFEINFO_kindtypeREAL2
:
3256 *cptr
= source_array
.real2
;
3257 *size
= sizeof (*source_array
.real2
);
3261 #if FFETARGET_okREAL3
3262 case FFEINFO_kindtypeREAL3
:
3263 *cptr
= source_array
.real3
;
3264 *size
= sizeof (*source_array
.real3
);
3268 #if FFETARGET_okREAL4
3269 case FFEINFO_kindtypeREAL4
:
3270 *cptr
= source_array
.real4
;
3271 *size
= sizeof (*source_array
.real4
);
3275 #if FFETARGET_okREAL5
3276 case FFEINFO_kindtypeREAL5
:
3277 *cptr
= source_array
.real5
;
3278 *size
= sizeof (*source_array
.real5
);
3282 #if FFETARGET_okREAL6
3283 case FFEINFO_kindtypeREAL6
:
3284 *cptr
= source_array
.real6
;
3285 *size
= sizeof (*source_array
.real6
);
3289 #if FFETARGET_okREAL7
3290 case FFEINFO_kindtypeREAL7
:
3291 *cptr
= source_array
.real7
;
3292 *size
= sizeof (*source_array
.real7
);
3296 #if FFETARGET_okREAL8
3297 case FFEINFO_kindtypeREAL8
:
3298 *cptr
= source_array
.real8
;
3299 *size
= sizeof (*source_array
.real8
);
3304 assert ("bad REAL ckindtype" == NULL
);
3309 case FFEINFO_basictypeCOMPLEX
:
3312 #if FFETARGET_okCOMPLEX1
3313 case FFEINFO_kindtypeREAL1
:
3314 *cptr
= source_array
.complex1
;
3315 *size
= sizeof (*source_array
.complex1
);
3319 #if FFETARGET_okCOMPLEX2
3320 case FFEINFO_kindtypeREAL2
:
3321 *cptr
= source_array
.complex2
;
3322 *size
= sizeof (*source_array
.complex2
);
3326 #if FFETARGET_okCOMPLEX3
3327 case FFEINFO_kindtypeREAL3
:
3328 *cptr
= source_array
.complex3
;
3329 *size
= sizeof (*source_array
.complex3
);
3333 #if FFETARGET_okCOMPLEX4
3334 case FFEINFO_kindtypeREAL4
:
3335 *cptr
= source_array
.complex4
;
3336 *size
= sizeof (*source_array
.complex4
);
3340 #if FFETARGET_okCOMPLEX5
3341 case FFEINFO_kindtypeREAL5
:
3342 *cptr
= source_array
.complex5
;
3343 *size
= sizeof (*source_array
.complex5
);
3347 #if FFETARGET_okCOMPLEX6
3348 case FFEINFO_kindtypeREAL6
:
3349 *cptr
= source_array
.complex6
;
3350 *size
= sizeof (*source_array
.complex6
);
3354 #if FFETARGET_okCOMPLEX7
3355 case FFEINFO_kindtypeREAL7
:
3356 *cptr
= source_array
.complex7
;
3357 *size
= sizeof (*source_array
.complex7
);
3361 #if FFETARGET_okCOMPLEX8
3362 case FFEINFO_kindtypeREAL8
:
3363 *cptr
= source_array
.complex8
;
3364 *size
= sizeof (*source_array
.complex8
);
3369 assert ("bad COMPLEX ckindtype" == NULL
);
3374 case FFEINFO_basictypeCHARACTER
:
3377 #if FFETARGET_okCHARACTER1
3378 case FFEINFO_kindtypeCHARACTER1
:
3379 *cptr
= source_array
.character1
;
3380 *size
= sizeof (*source_array
.character1
);
3384 #if FFETARGET_okCHARACTER2
3385 case FFEINFO_kindtypeCHARACTER2
:
3386 *cptr
= source_array
.character2
;
3387 *size
= sizeof (*source_array
.character2
);
3391 #if FFETARGET_okCHARACTER3
3392 case FFEINFO_kindtypeCHARACTER3
:
3393 *cptr
= source_array
.character3
;
3394 *size
= sizeof (*source_array
.character3
);
3398 #if FFETARGET_okCHARACTER4
3399 case FFEINFO_kindtypeCHARACTER4
:
3400 *cptr
= source_array
.character4
;
3401 *size
= sizeof (*source_array
.character4
);
3405 #if FFETARGET_okCHARACTER5
3406 case FFEINFO_kindtypeCHARACTER5
:
3407 *cptr
= source_array
.character5
;
3408 *size
= sizeof (*source_array
.character5
);
3412 #if FFETARGET_okCHARACTER6
3413 case FFEINFO_kindtypeCHARACTER6
:
3414 *cptr
= source_array
.character6
;
3415 *size
= sizeof (*source_array
.character6
);
3419 #if FFETARGET_okCHARACTER7
3420 case FFEINFO_kindtypeCHARACTER7
:
3421 *cptr
= source_array
.character7
;
3422 *size
= sizeof (*source_array
.character7
);
3426 #if FFETARGET_okCHARACTER8
3427 case FFEINFO_kindtypeCHARACTER8
:
3428 *cptr
= source_array
.character8
;
3429 *size
= sizeof (*source_array
.character8
);
3434 assert ("bad CHARACTER ckindtype" == NULL
);
3440 assert ("bad cbasictype" == NULL
);
3445 /* ffebld_constantarray_prepare -- Prepare for copy between value and array
3449 Like _put, but just returns the pointers to the beginnings of the
3450 array and the constant and returns the size (the amount of info to
3451 copy). The idea is that the caller can use memcpy to accomplish the
3452 same thing as _put (though slower), or the caller can use a different
3453 function that swaps bytes, words, etc for a different target machine.
3454 Also, the type of the array may be different from the type of the
3455 constant; the array type is used to determine the meaning (scale) of
3456 the offset field (to calculate the array pointer), the constant type is
3457 used to determine the constant pointer and the size (amount of info to
3461 ffebld_constantarray_prepare (void **aptr
, void **cptr
, size_t *size
,
3462 ffebldConstantArray array
, ffeinfoBasictype abt
, ffeinfoKindtype akt
,
3463 ffetargetOffset offset
, ffebldConstantUnion
*constant
,
3464 ffeinfoBasictype cbt
, ffeinfoKindtype ckt
)
3468 case FFEINFO_basictypeINTEGER
:
3471 #if FFETARGET_okINTEGER1
3472 case FFEINFO_kindtypeINTEGER1
:
3473 *aptr
= array
.integer1
+ offset
;
3477 #if FFETARGET_okINTEGER2
3478 case FFEINFO_kindtypeINTEGER2
:
3479 *aptr
= array
.integer2
+ offset
;
3483 #if FFETARGET_okINTEGER3
3484 case FFEINFO_kindtypeINTEGER3
:
3485 *aptr
= array
.integer3
+ offset
;
3489 #if FFETARGET_okINTEGER4
3490 case FFEINFO_kindtypeINTEGER4
:
3491 *aptr
= array
.integer4
+ offset
;
3495 #if FFETARGET_okINTEGER5
3496 case FFEINFO_kindtypeINTEGER5
:
3497 *aptr
= array
.integer5
+ offset
;
3501 #if FFETARGET_okINTEGER6
3502 case FFEINFO_kindtypeINTEGER6
:
3503 *aptr
= array
.integer6
+ offset
;
3507 #if FFETARGET_okINTEGER7
3508 case FFEINFO_kindtypeINTEGER7
:
3509 *aptr
= array
.integer7
+ offset
;
3513 #if FFETARGET_okINTEGER8
3514 case FFEINFO_kindtypeINTEGER8
:
3515 *aptr
= array
.integer8
+ offset
;
3520 assert ("bad INTEGER akindtype" == NULL
);
3525 case FFEINFO_basictypeLOGICAL
:
3528 #if FFETARGET_okLOGICAL1
3529 case FFEINFO_kindtypeLOGICAL1
:
3530 *aptr
= array
.logical1
+ offset
;
3534 #if FFETARGET_okLOGICAL2
3535 case FFEINFO_kindtypeLOGICAL2
:
3536 *aptr
= array
.logical2
+ offset
;
3540 #if FFETARGET_okLOGICAL3
3541 case FFEINFO_kindtypeLOGICAL3
:
3542 *aptr
= array
.logical3
+ offset
;
3546 #if FFETARGET_okLOGICAL4
3547 case FFEINFO_kindtypeLOGICAL4
:
3548 *aptr
= array
.logical4
+ offset
;
3552 #if FFETARGET_okLOGICAL5
3553 case FFEINFO_kindtypeLOGICAL5
:
3554 *aptr
= array
.logical5
+ offset
;
3558 #if FFETARGET_okLOGICAL6
3559 case FFEINFO_kindtypeLOGICAL6
:
3560 *aptr
= array
.logical6
+ offset
;
3564 #if FFETARGET_okLOGICAL7
3565 case FFEINFO_kindtypeLOGICAL7
:
3566 *aptr
= array
.logical7
+ offset
;
3570 #if FFETARGET_okLOGICAL8
3571 case FFEINFO_kindtypeLOGICAL8
:
3572 *aptr
= array
.logical8
+ offset
;
3577 assert ("bad LOGICAL akindtype" == NULL
);
3582 case FFEINFO_basictypeREAL
:
3585 #if FFETARGET_okREAL1
3586 case FFEINFO_kindtypeREAL1
:
3587 *aptr
= array
.real1
+ offset
;
3591 #if FFETARGET_okREAL2
3592 case FFEINFO_kindtypeREAL2
:
3593 *aptr
= array
.real2
+ offset
;
3597 #if FFETARGET_okREAL3
3598 case FFEINFO_kindtypeREAL3
:
3599 *aptr
= array
.real3
+ offset
;
3603 #if FFETARGET_okREAL4
3604 case FFEINFO_kindtypeREAL4
:
3605 *aptr
= array
.real4
+ offset
;
3609 #if FFETARGET_okREAL5
3610 case FFEINFO_kindtypeREAL5
:
3611 *aptr
= array
.real5
+ offset
;
3615 #if FFETARGET_okREAL6
3616 case FFEINFO_kindtypeREAL6
:
3617 *aptr
= array
.real6
+ offset
;
3621 #if FFETARGET_okREAL7
3622 case FFEINFO_kindtypeREAL7
:
3623 *aptr
= array
.real7
+ offset
;
3627 #if FFETARGET_okREAL8
3628 case FFEINFO_kindtypeREAL8
:
3629 *aptr
= array
.real8
+ offset
;
3634 assert ("bad REAL akindtype" == NULL
);
3639 case FFEINFO_basictypeCOMPLEX
:
3642 #if FFETARGET_okCOMPLEX1
3643 case FFEINFO_kindtypeREAL1
:
3644 *aptr
= array
.complex1
+ offset
;
3648 #if FFETARGET_okCOMPLEX2
3649 case FFEINFO_kindtypeREAL2
:
3650 *aptr
= array
.complex2
+ offset
;
3654 #if FFETARGET_okCOMPLEX3
3655 case FFEINFO_kindtypeREAL3
:
3656 *aptr
= array
.complex3
+ offset
;
3660 #if FFETARGET_okCOMPLEX4
3661 case FFEINFO_kindtypeREAL4
:
3662 *aptr
= array
.complex4
+ offset
;
3666 #if FFETARGET_okCOMPLEX5
3667 case FFEINFO_kindtypeREAL5
:
3668 *aptr
= array
.complex5
+ offset
;
3672 #if FFETARGET_okCOMPLEX6
3673 case FFEINFO_kindtypeREAL6
:
3674 *aptr
= array
.complex6
+ offset
;
3678 #if FFETARGET_okCOMPLEX7
3679 case FFEINFO_kindtypeREAL7
:
3680 *aptr
= array
.complex7
+ offset
;
3684 #if FFETARGET_okCOMPLEX8
3685 case FFEINFO_kindtypeREAL8
:
3686 *aptr
= array
.complex8
+ offset
;
3691 assert ("bad COMPLEX akindtype" == NULL
);
3696 case FFEINFO_basictypeCHARACTER
:
3699 #if FFETARGET_okCHARACTER1
3700 case FFEINFO_kindtypeCHARACTER1
:
3701 *aptr
= array
.character1
+ offset
;
3705 #if FFETARGET_okCHARACTER2
3706 case FFEINFO_kindtypeCHARACTER2
:
3707 *aptr
= array
.character2
+ offset
;
3711 #if FFETARGET_okCHARACTER3
3712 case FFEINFO_kindtypeCHARACTER3
:
3713 *aptr
= array
.character3
+ offset
;
3717 #if FFETARGET_okCHARACTER4
3718 case FFEINFO_kindtypeCHARACTER4
:
3719 *aptr
= array
.character4
+ offset
;
3723 #if FFETARGET_okCHARACTER5
3724 case FFEINFO_kindtypeCHARACTER5
:
3725 *aptr
= array
.character5
+ offset
;
3729 #if FFETARGET_okCHARACTER6
3730 case FFEINFO_kindtypeCHARACTER6
:
3731 *aptr
= array
.character6
+ offset
;
3735 #if FFETARGET_okCHARACTER7
3736 case FFEINFO_kindtypeCHARACTER7
:
3737 *aptr
= array
.character7
+ offset
;
3741 #if FFETARGET_okCHARACTER8
3742 case FFEINFO_kindtypeCHARACTER8
:
3743 *aptr
= array
.character8
+ offset
;
3748 assert ("bad CHARACTER akindtype" == NULL
);
3754 assert ("bad abasictype" == NULL
);
3760 case FFEINFO_basictypeINTEGER
:
3763 #if FFETARGET_okINTEGER1
3764 case FFEINFO_kindtypeINTEGER1
:
3765 *cptr
= &constant
->integer1
;
3766 *size
= sizeof (constant
->integer1
);
3770 #if FFETARGET_okINTEGER2
3771 case FFEINFO_kindtypeINTEGER2
:
3772 *cptr
= &constant
->integer2
;
3773 *size
= sizeof (constant
->integer2
);
3777 #if FFETARGET_okINTEGER3
3778 case FFEINFO_kindtypeINTEGER3
:
3779 *cptr
= &constant
->integer3
;
3780 *size
= sizeof (constant
->integer3
);
3784 #if FFETARGET_okINTEGER4
3785 case FFEINFO_kindtypeINTEGER4
:
3786 *cptr
= &constant
->integer4
;
3787 *size
= sizeof (constant
->integer4
);
3791 #if FFETARGET_okINTEGER5
3792 case FFEINFO_kindtypeINTEGER5
:
3793 *cptr
= &constant
->integer5
;
3794 *size
= sizeof (constant
->integer5
);
3798 #if FFETARGET_okINTEGER6
3799 case FFEINFO_kindtypeINTEGER6
:
3800 *cptr
= &constant
->integer6
;
3801 *size
= sizeof (constant
->integer6
);
3805 #if FFETARGET_okINTEGER7
3806 case FFEINFO_kindtypeINTEGER7
:
3807 *cptr
= &constant
->integer7
;
3808 *size
= sizeof (constant
->integer7
);
3812 #if FFETARGET_okINTEGER8
3813 case FFEINFO_kindtypeINTEGER8
:
3814 *cptr
= &constant
->integer8
;
3815 *size
= sizeof (constant
->integer8
);
3820 assert ("bad INTEGER ckindtype" == NULL
);
3825 case FFEINFO_basictypeLOGICAL
:
3828 #if FFETARGET_okLOGICAL1
3829 case FFEINFO_kindtypeLOGICAL1
:
3830 *cptr
= &constant
->logical1
;
3831 *size
= sizeof (constant
->logical1
);
3835 #if FFETARGET_okLOGICAL2
3836 case FFEINFO_kindtypeLOGICAL2
:
3837 *cptr
= &constant
->logical2
;
3838 *size
= sizeof (constant
->logical2
);
3842 #if FFETARGET_okLOGICAL3
3843 case FFEINFO_kindtypeLOGICAL3
:
3844 *cptr
= &constant
->logical3
;
3845 *size
= sizeof (constant
->logical3
);
3849 #if FFETARGET_okLOGICAL4
3850 case FFEINFO_kindtypeLOGICAL4
:
3851 *cptr
= &constant
->logical4
;
3852 *size
= sizeof (constant
->logical4
);
3856 #if FFETARGET_okLOGICAL5
3857 case FFEINFO_kindtypeLOGICAL5
:
3858 *cptr
= &constant
->logical5
;
3859 *size
= sizeof (constant
->logical5
);
3863 #if FFETARGET_okLOGICAL6
3864 case FFEINFO_kindtypeLOGICAL6
:
3865 *cptr
= &constant
->logical6
;
3866 *size
= sizeof (constant
->logical6
);
3870 #if FFETARGET_okLOGICAL7
3871 case FFEINFO_kindtypeLOGICAL7
:
3872 *cptr
= &constant
->logical7
;
3873 *size
= sizeof (constant
->logical7
);
3877 #if FFETARGET_okLOGICAL8
3878 case FFEINFO_kindtypeLOGICAL8
:
3879 *cptr
= &constant
->logical8
;
3880 *size
= sizeof (constant
->logical8
);
3885 assert ("bad LOGICAL ckindtype" == NULL
);
3890 case FFEINFO_basictypeREAL
:
3893 #if FFETARGET_okREAL1
3894 case FFEINFO_kindtypeREAL1
:
3895 *cptr
= &constant
->real1
;
3896 *size
= sizeof (constant
->real1
);
3900 #if FFETARGET_okREAL2
3901 case FFEINFO_kindtypeREAL2
:
3902 *cptr
= &constant
->real2
;
3903 *size
= sizeof (constant
->real2
);
3907 #if FFETARGET_okREAL3
3908 case FFEINFO_kindtypeREAL3
:
3909 *cptr
= &constant
->real3
;
3910 *size
= sizeof (constant
->real3
);
3914 #if FFETARGET_okREAL4
3915 case FFEINFO_kindtypeREAL4
:
3916 *cptr
= &constant
->real4
;
3917 *size
= sizeof (constant
->real4
);
3921 #if FFETARGET_okREAL5
3922 case FFEINFO_kindtypeREAL5
:
3923 *cptr
= &constant
->real5
;
3924 *size
= sizeof (constant
->real5
);
3928 #if FFETARGET_okREAL6
3929 case FFEINFO_kindtypeREAL6
:
3930 *cptr
= &constant
->real6
;
3931 *size
= sizeof (constant
->real6
);
3935 #if FFETARGET_okREAL7
3936 case FFEINFO_kindtypeREAL7
:
3937 *cptr
= &constant
->real7
;
3938 *size
= sizeof (constant
->real7
);
3942 #if FFETARGET_okREAL8
3943 case FFEINFO_kindtypeREAL8
:
3944 *cptr
= &constant
->real8
;
3945 *size
= sizeof (constant
->real8
);
3950 assert ("bad REAL ckindtype" == NULL
);
3955 case FFEINFO_basictypeCOMPLEX
:
3958 #if FFETARGET_okCOMPLEX1
3959 case FFEINFO_kindtypeREAL1
:
3960 *cptr
= &constant
->complex1
;
3961 *size
= sizeof (constant
->complex1
);
3965 #if FFETARGET_okCOMPLEX2
3966 case FFEINFO_kindtypeREAL2
:
3967 *cptr
= &constant
->complex2
;
3968 *size
= sizeof (constant
->complex2
);
3972 #if FFETARGET_okCOMPLEX3
3973 case FFEINFO_kindtypeREAL3
:
3974 *cptr
= &constant
->complex3
;
3975 *size
= sizeof (constant
->complex3
);
3979 #if FFETARGET_okCOMPLEX4
3980 case FFEINFO_kindtypeREAL4
:
3981 *cptr
= &constant
->complex4
;
3982 *size
= sizeof (constant
->complex4
);
3986 #if FFETARGET_okCOMPLEX5
3987 case FFEINFO_kindtypeREAL5
:
3988 *cptr
= &constant
->complex5
;
3989 *size
= sizeof (constant
->complex5
);
3993 #if FFETARGET_okCOMPLEX6
3994 case FFEINFO_kindtypeREAL6
:
3995 *cptr
= &constant
->complex6
;
3996 *size
= sizeof (constant
->complex6
);
4000 #if FFETARGET_okCOMPLEX7
4001 case FFEINFO_kindtypeREAL7
:
4002 *cptr
= &constant
->complex7
;
4003 *size
= sizeof (constant
->complex7
);
4007 #if FFETARGET_okCOMPLEX8
4008 case FFEINFO_kindtypeREAL8
:
4009 *cptr
= &constant
->complex8
;
4010 *size
= sizeof (constant
->complex8
);
4015 assert ("bad COMPLEX ckindtype" == NULL
);
4020 case FFEINFO_basictypeCHARACTER
:
4023 #if FFETARGET_okCHARACTER1
4024 case FFEINFO_kindtypeCHARACTER1
:
4025 *cptr
= ffetarget_text_character1 (constant
->character1
);
4026 *size
= ffetarget_length_character1 (constant
->character1
);
4030 #if FFETARGET_okCHARACTER2
4031 case FFEINFO_kindtypeCHARACTER2
:
4032 *cptr
= ffetarget_text_character2 (constant
->character2
);
4033 *size
= ffetarget_length_character2 (constant
->character2
);
4037 #if FFETARGET_okCHARACTER3
4038 case FFEINFO_kindtypeCHARACTER3
:
4039 *cptr
= ffetarget_text_character3 (constant
->character3
);
4040 *size
= ffetarget_length_character3 (constant
->character3
);
4044 #if FFETARGET_okCHARACTER4
4045 case FFEINFO_kindtypeCHARACTER4
:
4046 *cptr
= ffetarget_text_character4 (constant
->character4
);
4047 *size
= ffetarget_length_character4 (constant
->character4
);
4051 #if FFETARGET_okCHARACTER5
4052 case FFEINFO_kindtypeCHARACTER5
:
4053 *cptr
= ffetarget_text_character5 (constant
->character5
);
4054 *size
= ffetarget_length_character5 (constant
->character5
);
4058 #if FFETARGET_okCHARACTER6
4059 case FFEINFO_kindtypeCHARACTER6
:
4060 *cptr
= ffetarget_text_character6 (constant
->character6
);
4061 *size
= ffetarget_length_character6 (constant
->character6
);
4065 #if FFETARGET_okCHARACTER7
4066 case FFEINFO_kindtypeCHARACTER7
:
4067 *cptr
= ffetarget_text_character7 (constant
->character7
);
4068 *size
= ffetarget_length_character7 (constant
->character7
);
4072 #if FFETARGET_okCHARACTER8
4073 case FFEINFO_kindtypeCHARACTER8
:
4074 *cptr
= ffetarget_text_character8 (constant
->character8
);
4075 *size
= ffetarget_length_character8 (constant
->character8
);
4080 assert ("bad CHARACTER ckindtype" == NULL
);
4086 assert ("bad cbasictype" == NULL
);
4091 /* ffebld_constantarray_put -- Put a value into an array of constants
4096 ffebld_constantarray_put (ffebldConstantArray array
, ffeinfoBasictype bt
,
4097 ffeinfoKindtype kt
, ffetargetOffset offset
, ffebldConstantUnion constant
)
4101 case FFEINFO_basictypeINTEGER
:
4104 #if FFETARGET_okINTEGER1
4105 case FFEINFO_kindtypeINTEGER1
:
4106 *(array
.integer1
+ offset
) = constant
.integer1
;
4110 #if FFETARGET_okINTEGER2
4111 case FFEINFO_kindtypeINTEGER2
:
4112 *(array
.integer2
+ offset
) = constant
.integer2
;
4116 #if FFETARGET_okINTEGER3
4117 case FFEINFO_kindtypeINTEGER3
:
4118 *(array
.integer3
+ offset
) = constant
.integer3
;
4122 #if FFETARGET_okINTEGER4
4123 case FFEINFO_kindtypeINTEGER4
:
4124 *(array
.integer4
+ offset
) = constant
.integer4
;
4128 #if FFETARGET_okINTEGER5
4129 case FFEINFO_kindtypeINTEGER5
:
4130 *(array
.integer5
+ offset
) = constant
.integer5
;
4134 #if FFETARGET_okINTEGER6
4135 case FFEINFO_kindtypeINTEGER6
:
4136 *(array
.integer6
+ offset
) = constant
.integer6
;
4140 #if FFETARGET_okINTEGER7
4141 case FFEINFO_kindtypeINTEGER7
:
4142 *(array
.integer7
+ offset
) = constant
.integer7
;
4146 #if FFETARGET_okINTEGER8
4147 case FFEINFO_kindtypeINTEGER8
:
4148 *(array
.integer8
+ offset
) = constant
.integer8
;
4153 assert ("bad INTEGER kindtype" == NULL
);
4158 case FFEINFO_basictypeLOGICAL
:
4161 #if FFETARGET_okLOGICAL1
4162 case FFEINFO_kindtypeLOGICAL1
:
4163 *(array
.logical1
+ offset
) = constant
.logical1
;
4167 #if FFETARGET_okLOGICAL2
4168 case FFEINFO_kindtypeLOGICAL2
:
4169 *(array
.logical2
+ offset
) = constant
.logical2
;
4173 #if FFETARGET_okLOGICAL3
4174 case FFEINFO_kindtypeLOGICAL3
:
4175 *(array
.logical3
+ offset
) = constant
.logical3
;
4179 #if FFETARGET_okLOGICAL4
4180 case FFEINFO_kindtypeLOGICAL4
:
4181 *(array
.logical4
+ offset
) = constant
.logical4
;
4185 #if FFETARGET_okLOGICAL5
4186 case FFEINFO_kindtypeLOGICAL5
:
4187 *(array
.logical5
+ offset
) = constant
.logical5
;
4191 #if FFETARGET_okLOGICAL6
4192 case FFEINFO_kindtypeLOGICAL6
:
4193 *(array
.logical6
+ offset
) = constant
.logical6
;
4197 #if FFETARGET_okLOGICAL7
4198 case FFEINFO_kindtypeLOGICAL7
:
4199 *(array
.logical7
+ offset
) = constant
.logical7
;
4203 #if FFETARGET_okLOGICAL8
4204 case FFEINFO_kindtypeLOGICAL8
:
4205 *(array
.logical8
+ offset
) = constant
.logical8
;
4210 assert ("bad LOGICAL kindtype" == NULL
);
4215 case FFEINFO_basictypeREAL
:
4218 #if FFETARGET_okREAL1
4219 case FFEINFO_kindtypeREAL1
:
4220 *(array
.real1
+ offset
) = constant
.real1
;
4224 #if FFETARGET_okREAL2
4225 case FFEINFO_kindtypeREAL2
:
4226 *(array
.real2
+ offset
) = constant
.real2
;
4230 #if FFETARGET_okREAL3
4231 case FFEINFO_kindtypeREAL3
:
4232 *(array
.real3
+ offset
) = constant
.real3
;
4236 #if FFETARGET_okREAL4
4237 case FFEINFO_kindtypeREAL4
:
4238 *(array
.real4
+ offset
) = constant
.real4
;
4242 #if FFETARGET_okREAL5
4243 case FFEINFO_kindtypeREAL5
:
4244 *(array
.real5
+ offset
) = constant
.real5
;
4248 #if FFETARGET_okREAL6
4249 case FFEINFO_kindtypeREAL6
:
4250 *(array
.real6
+ offset
) = constant
.real6
;
4254 #if FFETARGET_okREAL7
4255 case FFEINFO_kindtypeREAL7
:
4256 *(array
.real7
+ offset
) = constant
.real7
;
4260 #if FFETARGET_okREAL8
4261 case FFEINFO_kindtypeREAL8
:
4262 *(array
.real8
+ offset
) = constant
.real8
;
4267 assert ("bad REAL kindtype" == NULL
);
4272 case FFEINFO_basictypeCOMPLEX
:
4275 #if FFETARGET_okCOMPLEX1
4276 case FFEINFO_kindtypeREAL1
:
4277 *(array
.complex1
+ offset
) = constant
.complex1
;
4281 #if FFETARGET_okCOMPLEX2
4282 case FFEINFO_kindtypeREAL2
:
4283 *(array
.complex2
+ offset
) = constant
.complex2
;
4287 #if FFETARGET_okCOMPLEX3
4288 case FFEINFO_kindtypeREAL3
:
4289 *(array
.complex3
+ offset
) = constant
.complex3
;
4293 #if FFETARGET_okCOMPLEX4
4294 case FFEINFO_kindtypeREAL4
:
4295 *(array
.complex4
+ offset
) = constant
.complex4
;
4299 #if FFETARGET_okCOMPLEX5
4300 case FFEINFO_kindtypeREAL5
:
4301 *(array
.complex5
+ offset
) = constant
.complex5
;
4305 #if FFETARGET_okCOMPLEX6
4306 case FFEINFO_kindtypeREAL6
:
4307 *(array
.complex6
+ offset
) = constant
.complex6
;
4311 #if FFETARGET_okCOMPLEX7
4312 case FFEINFO_kindtypeREAL7
:
4313 *(array
.complex7
+ offset
) = constant
.complex7
;
4317 #if FFETARGET_okCOMPLEX8
4318 case FFEINFO_kindtypeREAL8
:
4319 *(array
.complex8
+ offset
) = constant
.complex8
;
4324 assert ("bad COMPLEX kindtype" == NULL
);
4329 case FFEINFO_basictypeCHARACTER
:
4332 #if FFETARGET_okCHARACTER1
4333 case FFEINFO_kindtypeCHARACTER1
:
4334 memcpy (array
.character1
+ offset
,
4335 ffetarget_text_character1 (constant
.character1
),
4336 ffetarget_length_character1 (constant
.character1
));
4340 #if FFETARGET_okCHARACTER2
4341 case FFEINFO_kindtypeCHARACTER2
:
4342 memcpy (array
.character2
+ offset
,
4343 ffetarget_text_character2 (constant
.character2
),
4344 ffetarget_length_character2 (constant
.character2
));
4348 #if FFETARGET_okCHARACTER3
4349 case FFEINFO_kindtypeCHARACTER3
:
4350 memcpy (array
.character3
+ offset
,
4351 ffetarget_text_character3 (constant
.character3
),
4352 ffetarget_length_character3 (constant
.character3
));
4356 #if FFETARGET_okCHARACTER4
4357 case FFEINFO_kindtypeCHARACTER4
:
4358 memcpy (array
.character4
+ offset
,
4359 ffetarget_text_character4 (constant
.character4
),
4360 ffetarget_length_character4 (constant
.character4
));
4364 #if FFETARGET_okCHARACTER5
4365 case FFEINFO_kindtypeCHARACTER5
:
4366 memcpy (array
.character5
+ offset
,
4367 ffetarget_text_character5 (constant
.character5
),
4368 ffetarget_length_character5 (constant
.character5
));
4372 #if FFETARGET_okCHARACTER6
4373 case FFEINFO_kindtypeCHARACTER6
:
4374 memcpy (array
.character6
+ offset
,
4375 ffetarget_text_character6 (constant
.character6
),
4376 ffetarget_length_character6 (constant
.character6
));
4380 #if FFETARGET_okCHARACTER7
4381 case FFEINFO_kindtypeCHARACTER7
:
4382 memcpy (array
.character7
+ offset
,
4383 ffetarget_text_character7 (constant
.character7
),
4384 ffetarget_length_character7 (constant
.character7
));
4388 #if FFETARGET_okCHARACTER8
4389 case FFEINFO_kindtypeCHARACTER8
:
4390 memcpy (array
.character8
+ offset
,
4391 ffetarget_text_character8 (constant
.character8
),
4392 ffetarget_length_character8 (constant
.character8
));
4397 assert ("bad CHARACTER kindtype" == NULL
);
4403 assert ("bad basictype" == NULL
);
4408 /* ffebld_constantunion_dump -- Dump a constant
4413 ffebld_constantunion_dump (ffebldConstantUnion u
, ffeinfoBasictype bt
,
4418 case FFEINFO_basictypeINTEGER
:
4421 #if FFETARGET_okINTEGER1
4422 case FFEINFO_kindtypeINTEGER1
:
4423 ffetarget_print_integer1 (dmpout
, u
.integer1
);
4427 #if FFETARGET_okINTEGER2
4428 case FFEINFO_kindtypeINTEGER2
:
4429 ffetarget_print_integer2 (dmpout
, u
.integer2
);
4433 #if FFETARGET_okINTEGER3
4434 case FFEINFO_kindtypeINTEGER3
:
4435 ffetarget_print_integer3 (dmpout
, u
.integer3
);
4439 #if FFETARGET_okINTEGER4
4440 case FFEINFO_kindtypeINTEGER4
:
4441 ffetarget_print_integer4 (dmpout
, u
.integer4
);
4445 #if FFETARGET_okINTEGER5
4446 case FFEINFO_kindtypeINTEGER5
:
4447 ffetarget_print_integer5 (dmpout
, u
.integer5
);
4451 #if FFETARGET_okINTEGER6
4452 case FFEINFO_kindtypeINTEGER6
:
4453 ffetarget_print_integer6 (dmpout
, u
.integer6
);
4457 #if FFETARGET_okINTEGER7
4458 case FFEINFO_kindtypeINTEGER7
:
4459 ffetarget_print_integer7 (dmpout
, u
.integer7
);
4463 #if FFETARGET_okINTEGER8
4464 case FFEINFO_kindtypeINTEGER8
:
4465 ffetarget_print_integer8 (dmpout
, u
.integer8
);
4470 assert ("bad INTEGER kindtype" == NULL
);
4475 case FFEINFO_basictypeLOGICAL
:
4478 #if FFETARGET_okLOGICAL1
4479 case FFEINFO_kindtypeLOGICAL1
:
4480 ffetarget_print_logical1 (dmpout
, u
.logical1
);
4484 #if FFETARGET_okLOGICAL2
4485 case FFEINFO_kindtypeLOGICAL2
:
4486 ffetarget_print_logical2 (dmpout
, u
.logical2
);
4490 #if FFETARGET_okLOGICAL3
4491 case FFEINFO_kindtypeLOGICAL3
:
4492 ffetarget_print_logical3 (dmpout
, u
.logical3
);
4496 #if FFETARGET_okLOGICAL4
4497 case FFEINFO_kindtypeLOGICAL4
:
4498 ffetarget_print_logical4 (dmpout
, u
.logical4
);
4502 #if FFETARGET_okLOGICAL5
4503 case FFEINFO_kindtypeLOGICAL5
:
4504 ffetarget_print_logical5 (dmpout
, u
.logical5
);
4508 #if FFETARGET_okLOGICAL6
4509 case FFEINFO_kindtypeLOGICAL6
:
4510 ffetarget_print_logical6 (dmpout
, u
.logical6
);
4514 #if FFETARGET_okLOGICAL7
4515 case FFEINFO_kindtypeLOGICAL7
:
4516 ffetarget_print_logical7 (dmpout
, u
.logical7
);
4520 #if FFETARGET_okLOGICAL8
4521 case FFEINFO_kindtypeLOGICAL8
:
4522 ffetarget_print_logical8 (dmpout
, u
.logical8
);
4527 assert ("bad LOGICAL kindtype" == NULL
);
4532 case FFEINFO_basictypeREAL
:
4535 #if FFETARGET_okREAL1
4536 case FFEINFO_kindtypeREAL1
:
4537 ffetarget_print_real1 (dmpout
, u
.real1
);
4541 #if FFETARGET_okREAL2
4542 case FFEINFO_kindtypeREAL2
:
4543 ffetarget_print_real2 (dmpout
, u
.real2
);
4547 #if FFETARGET_okREAL3
4548 case FFEINFO_kindtypeREAL3
:
4549 ffetarget_print_real3 (dmpout
, u
.real3
);
4553 #if FFETARGET_okREAL4
4554 case FFEINFO_kindtypeREAL4
:
4555 ffetarget_print_real4 (dmpout
, u
.real4
);
4559 #if FFETARGET_okREAL5
4560 case FFEINFO_kindtypeREAL5
:
4561 ffetarget_print_real5 (dmpout
, u
.real5
);
4565 #if FFETARGET_okREAL6
4566 case FFEINFO_kindtypeREAL6
:
4567 ffetarget_print_real6 (dmpout
, u
.real6
);
4571 #if FFETARGET_okREAL7
4572 case FFEINFO_kindtypeREAL7
:
4573 ffetarget_print_real7 (dmpout
, u
.real7
);
4577 #if FFETARGET_okREAL8
4578 case FFEINFO_kindtypeREAL8
:
4579 ffetarget_print_real8 (dmpout
, u
.real8
);
4584 assert ("bad REAL kindtype" == NULL
);
4589 case FFEINFO_basictypeCOMPLEX
:
4592 #if FFETARGET_okCOMPLEX1
4593 case FFEINFO_kindtypeREAL1
:
4594 fprintf (dmpout
, "(");
4595 ffetarget_print_real1 (dmpout
, u
.complex1
.real
);
4596 fprintf (dmpout
, ",");
4597 ffetarget_print_real1 (dmpout
, u
.complex1
.imaginary
);
4598 fprintf (dmpout
, ")");
4602 #if FFETARGET_okCOMPLEX2
4603 case FFEINFO_kindtypeREAL2
:
4604 fprintf (dmpout
, "(");
4605 ffetarget_print_real2 (dmpout
, u
.complex2
.real
);
4606 fprintf (dmpout
, ",");
4607 ffetarget_print_real2 (dmpout
, u
.complex2
.imaginary
);
4608 fprintf (dmpout
, ")");
4612 #if FFETARGET_okCOMPLEX3
4613 case FFEINFO_kindtypeREAL3
:
4614 fprintf (dmpout
, "(");
4615 ffetarget_print_real3 (dmpout
, u
.complex3
.real
);
4616 fprintf (dmpout
, ",");
4617 ffetarget_print_real3 (dmpout
, u
.complex3
.imaginary
);
4618 fprintf (dmpout
, ")");
4622 #if FFETARGET_okCOMPLEX4
4623 case FFEINFO_kindtypeREAL4
:
4624 fprintf (dmpout
, "(");
4625 ffetarget_print_real4 (dmpout
, u
.complex4
.real
);
4626 fprintf (dmpout
, ",");
4627 ffetarget_print_real4 (dmpout
, u
.complex4
.imaginary
);
4628 fprintf (dmpout
, ")");
4632 #if FFETARGET_okCOMPLEX5
4633 case FFEINFO_kindtypeREAL5
:
4634 fprintf (dmpout
, "(");
4635 ffetarget_print_real5 (dmpout
, u
.complex5
.real
);
4636 fprintf (dmpout
, ",");
4637 ffetarget_print_real5 (dmpout
, u
.complex5
.imaginary
);
4638 fprintf (dmpout
, ")");
4642 #if FFETARGET_okCOMPLEX6
4643 case FFEINFO_kindtypeREAL6
:
4644 fprintf (dmpout
, "(");
4645 ffetarget_print_real6 (dmpout
, u
.complex6
.real
);
4646 fprintf (dmpout
, ",");
4647 ffetarget_print_real6 (dmpout
, u
.complex6
.imaginary
);
4648 fprintf (dmpout
, ")");
4652 #if FFETARGET_okCOMPLEX7
4653 case FFEINFO_kindtypeREAL7
:
4654 fprintf (dmpout
, "(");
4655 ffetarget_print_real7 (dmpout
, u
.complex7
.real
);
4656 fprintf (dmpout
, ",");
4657 ffetarget_print_real7 (dmpout
, u
.complex7
.imaginary
);
4658 fprintf (dmpout
, ")");
4662 #if FFETARGET_okCOMPLEX8
4663 case FFEINFO_kindtypeREAL8
:
4664 fprintf (dmpout
, "(");
4665 ffetarget_print_real8 (dmpout
, u
.complex8
.real
);
4666 fprintf (dmpout
, ",");
4667 ffetarget_print_real8 (dmpout
, u
.complex8
.imaginary
);
4668 fprintf (dmpout
, ")");
4673 assert ("bad COMPLEX kindtype" == NULL
);
4678 case FFEINFO_basictypeCHARACTER
:
4681 #if FFETARGET_okCHARACTER1
4682 case FFEINFO_kindtypeCHARACTER1
:
4683 ffetarget_print_character1 (dmpout
, u
.character1
);
4687 #if FFETARGET_okCHARACTER2
4688 case FFEINFO_kindtypeCHARACTER2
:
4689 ffetarget_print_character2 (dmpout
, u
.character2
);
4693 #if FFETARGET_okCHARACTER3
4694 case FFEINFO_kindtypeCHARACTER3
:
4695 ffetarget_print_character3 (dmpout
, u
.character3
);
4699 #if FFETARGET_okCHARACTER4
4700 case FFEINFO_kindtypeCHARACTER4
:
4701 ffetarget_print_character4 (dmpout
, u
.character4
);
4705 #if FFETARGET_okCHARACTER5
4706 case FFEINFO_kindtypeCHARACTER5
:
4707 ffetarget_print_character5 (dmpout
, u
.character5
);
4711 #if FFETARGET_okCHARACTER6
4712 case FFEINFO_kindtypeCHARACTER6
:
4713 ffetarget_print_character6 (dmpout
, u
.character6
);
4717 #if FFETARGET_okCHARACTER7
4718 case FFEINFO_kindtypeCHARACTER7
:
4719 ffetarget_print_character7 (dmpout
, u
.character7
);
4723 #if FFETARGET_okCHARACTER8
4724 case FFEINFO_kindtypeCHARACTER8
:
4725 ffetarget_print_character8 (dmpout
, u
.character8
);
4730 assert ("bad CHARACTER kindtype" == NULL
);
4736 assert ("bad basictype" == NULL
);
4741 /* ffebld_dump -- Dump expression tree in concise form
4747 ffebld_dump (ffebld b
)
4754 fprintf (dmpout
, "(null)");
4758 switch (ffebld_op (b
))
4761 fputs ("[", dmpout
);
4764 ffebld_dump (ffebld_head (b
));
4765 if ((b
= ffebld_trail (b
)) != NULL
)
4766 fputs (",", dmpout
);
4768 fputs ("]", dmpout
);
4772 case FFEBLD_opBOUNDS
:
4773 case FFEBLD_opREPEAT
:
4774 case FFEBLD_opLABTER
:
4775 case FFEBLD_opLABTOK
:
4776 case FFEBLD_opIMPDO
:
4777 fputs (ffebld_op_string (ffebld_op (b
)), dmpout
);
4781 if (ffeinfo_size (ffebld_info (b
)) != FFETARGET_charactersizeNONE
)
4782 fprintf (dmpout
, "%s%d%s%s*%" ffetargetCharacterSize_f
"u",
4783 ffebld_op_string (ffebld_op (b
)),
4784 (int) ffeinfo_rank (ffebld_info (b
)),
4785 ffeinfo_basictype_string (ffeinfo_basictype (ffebld_info (b
))),
4786 ffeinfo_kindtype_string (ffeinfo_kindtype (ffebld_info (b
))),
4787 ffeinfo_size (ffebld_info (b
)));
4789 fprintf (dmpout
, "%s%d%s%s", ffebld_op_string (ffebld_op (b
)),
4790 (int) ffeinfo_rank (ffebld_info (b
)),
4791 ffeinfo_basictype_string (ffeinfo_basictype (ffebld_info (b
))),
4792 ffeinfo_kindtype_string (ffeinfo_kindtype (ffebld_info (b
))));
4793 if ((k
= ffeinfo_kind (ffebld_info (b
))) != FFEINFO_kindNONE
)
4794 fprintf (dmpout
, "/%s", ffeinfo_kind_string (k
));
4795 if ((w
= ffeinfo_where (ffebld_info (b
))) != FFEINFO_whereNONE
)
4796 fprintf (dmpout
, "@%s", ffeinfo_where_string (w
));
4800 switch (ffebld_arity (b
))
4803 fputs ("(", dmpout
);
4804 ffebld_dump (ffebld_left (b
));
4805 fputs (",", dmpout
);
4806 ffebld_dump (ffebld_right (b
));
4807 fputs (")", dmpout
);
4811 fputs ("(", dmpout
);
4812 ffebld_dump (ffebld_left (b
));
4813 fputs (")", dmpout
);
4817 switch (ffebld_op (b
))
4819 case FFEBLD_opCONTER
:
4820 fprintf (dmpout
, "<");
4821 ffebld_constant_dump (b
->u
.conter
.expr
);
4822 fprintf (dmpout
, ">");
4825 case FFEBLD_opACCTER
:
4826 fprintf (dmpout
, "<");
4827 ffebld_constantarray_dump (b
->u
.accter
.array
,
4828 ffeinfo_basictype (ffebld_info (b
)),
4829 ffeinfo_kindtype (ffebld_info (b
)),
4830 ffebit_size (b
->u
.accter
.bits
), b
->u
.accter
.bits
);
4831 fprintf (dmpout
, ">");
4834 case FFEBLD_opARRTER
:
4835 fprintf (dmpout
, "<");
4836 ffebld_constantarray_dump (b
->u
.arrter
.array
,
4837 ffeinfo_basictype (ffebld_info (b
)),
4838 ffeinfo_kindtype (ffebld_info (b
)),
4839 b
->u
.arrter
.size
, NULL
);
4840 fprintf (dmpout
, ">");
4843 case FFEBLD_opLABTER
:
4844 if (b
->u
.labter
== NULL
)
4845 fprintf (dmpout
, "<>");
4847 fprintf (dmpout
, "<%" ffelabValue_f
"u>", ffelab_value (b
->u
.labter
));
4850 case FFEBLD_opLABTOK
:
4851 fprintf (dmpout
, "<%s>", ffelex_token_text (b
->u
.labtok
));
4854 case FFEBLD_opSYMTER
:
4855 fprintf (dmpout
, "<");
4856 ffesymbol_dump (b
->u
.symter
.symbol
);
4857 if ((b
->u
.symter
.generic
!= FFEINTRIN_genNONE
)
4858 || (b
->u
.symter
.specific
!= FFEINTRIN_specNONE
))
4859 fprintf (dmpout
, "{%s:%s:%s}",
4860 ffeintrin_name_generic (b
->u
.symter
.generic
),
4861 ffeintrin_name_specific (b
->u
.symter
.specific
),
4862 ffeintrin_name_implementation (b
->u
.symter
.implementation
));
4863 if (b
->u
.symter
.do_iter
)
4864 fprintf (dmpout
, "{/do-iter}");
4865 fprintf (dmpout
, ">");
4874 /* ffebld_dump_prefix -- Dump the prefix for a constant of a given type
4876 ffebld_dump_prefix(dmpout,FFEINFO_basictypeINTEGER,
4877 FFEINFO_kindtypeINTEGER1); */
4880 ffebld_dump_prefix (FILE *out
, ffeinfoBasictype bt
, ffeinfoKindtype kt
)
4884 case FFEINFO_basictypeINTEGER
:
4887 #if FFETARGET_okINTEGER1
4888 case FFEINFO_kindtypeINTEGER1
:
4889 fprintf (out
, "I" STRX (FFETARGET_kindINTEGER1
) "/");
4893 #if FFETARGET_okINTEGER2
4894 case FFEINFO_kindtypeINTEGER2
:
4895 fprintf (out
, "I" STRX (FFETARGET_kindINTEGER2
) "/");
4899 #if FFETARGET_okINTEGER3
4900 case FFEINFO_kindtypeINTEGER3
:
4901 fprintf (out
, "I" STRX (FFETARGET_kindINTEGER3
) "/");
4905 #if FFETARGET_okINTEGER4
4906 case FFEINFO_kindtypeINTEGER4
:
4907 fprintf (out
, "I" STRX (FFETARGET_kindINTEGER4
) "/");
4911 #if FFETARGET_okINTEGER5
4912 case FFEINFO_kindtypeINTEGER5
:
4913 fprintf (out
, "I" STRX (FFETARGET_kindINTEGER5
) "/");
4917 #if FFETARGET_okINTEGER6
4918 case FFEINFO_kindtypeINTEGER6
:
4919 fprintf (out
, "I" STRX (FFETARGET_kindINTEGER6
) "/");
4923 #if FFETARGET_okINTEGER7
4924 case FFEINFO_kindtypeINTEGER7
:
4925 fprintf (out
, "I" STRX (FFETARGET_kindINTEGER7
) "/");
4929 #if FFETARGET_okINTEGER8
4930 case FFEINFO_kindtypeINTEGER8
:
4931 fprintf (out
, "I" STRX (FFETARGET_kindINTEGER8
) "/");
4936 assert ("bad INTEGER kindtype" == NULL
);
4941 case FFEINFO_basictypeLOGICAL
:
4944 #if FFETARGET_okLOGICAL1
4945 case FFEINFO_kindtypeLOGICAL1
:
4946 fprintf (out
, "L" STRX (FFETARGET_kindLOGICAL1
) "/");
4950 #if FFETARGET_okLOGICAL2
4951 case FFEINFO_kindtypeLOGICAL2
:
4952 fprintf (out
, "L" STRX (FFETARGET_kindLOGICAL2
) "/");
4956 #if FFETARGET_okLOGICAL3
4957 case FFEINFO_kindtypeLOGICAL3
:
4958 fprintf (out
, "L" STRX (FFETARGET_kindLOGICAL3
) "/");
4962 #if FFETARGET_okLOGICAL4
4963 case FFEINFO_kindtypeLOGICAL4
:
4964 fprintf (out
, "L" STRX (FFETARGET_kindLOGICAL4
) "/");
4968 #if FFETARGET_okLOGICAL5
4969 case FFEINFO_kindtypeLOGICAL5
:
4970 fprintf (out
, "L" STRX (FFETARGET_kindLOGICAL5
) "/");
4974 #if FFETARGET_okLOGICAL6
4975 case FFEINFO_kindtypeLOGICAL6
:
4976 fprintf (out
, "L" STRX (FFETARGET_kindLOGICAL6
) "/");
4980 #if FFETARGET_okLOGICAL7
4981 case FFEINFO_kindtypeLOGICAL7
:
4982 fprintf (out
, "L" STRX (FFETARGET_kindLOGICAL7
) "/");
4986 #if FFETARGET_okLOGICAL8
4987 case FFEINFO_kindtypeLOGICAL8
:
4988 fprintf (out
, "L" STRX (FFETARGET_kindLOGICAL8
) "/");
4993 assert ("bad LOGICAL kindtype" == NULL
);
4998 case FFEINFO_basictypeREAL
:
5001 #if FFETARGET_okREAL1
5002 case FFEINFO_kindtypeREAL1
:
5003 fprintf (out
, "R" STRX (FFETARGET_kindREAL1
) "/");
5007 #if FFETARGET_okREAL2
5008 case FFEINFO_kindtypeREAL2
:
5009 fprintf (out
, "R" STRX (FFETARGET_kindREAL2
) "/");
5013 #if FFETARGET_okREAL3
5014 case FFEINFO_kindtypeREAL3
:
5015 fprintf (out
, "R" STRX (FFETARGET_kindREAL3
) "/");
5019 #if FFETARGET_okREAL4
5020 case FFEINFO_kindtypeREAL4
:
5021 fprintf (out
, "R" STRX (FFETARGET_kindREAL4
) "/");
5025 #if FFETARGET_okREAL5
5026 case FFEINFO_kindtypeREAL5
:
5027 fprintf (out
, "R" STRX (FFETARGET_kindREAL5
) "/");
5031 #if FFETARGET_okREAL6
5032 case FFEINFO_kindtypeREAL6
:
5033 fprintf (out
, "R" STRX (FFETARGET_kindREAL6
) "/");
5037 #if FFETARGET_okREAL7
5038 case FFEINFO_kindtypeREAL7
:
5039 fprintf (out
, "R" STRX (FFETARGET_kindREAL7
) "/");
5043 #if FFETARGET_okREAL8
5044 case FFEINFO_kindtypeREAL8
:
5045 fprintf (out
, "R" STRX (FFETARGET_kindREAL8
) "/");
5050 assert ("bad REAL kindtype" == NULL
);
5055 case FFEINFO_basictypeCOMPLEX
:
5058 #if FFETARGET_okCOMPLEX1
5059 case FFEINFO_kindtypeREAL1
:
5060 fprintf (out
, "C" STRX (FFETARGET_kindCOMPLEX1
) "/");
5064 #if FFETARGET_okCOMPLEX2
5065 case FFEINFO_kindtypeREAL2
:
5066 fprintf (out
, "C" STRX (FFETARGET_kindCOMPLEX2
) "/");
5070 #if FFETARGET_okCOMPLEX3
5071 case FFEINFO_kindtypeREAL3
:
5072 fprintf (out
, "C" STRX (FFETARGET_kindCOMPLEX3
) "/");
5076 #if FFETARGET_okCOMPLEX4
5077 case FFEINFO_kindtypeREAL4
:
5078 fprintf (out
, "C" STRX (FFETARGET_kindCOMPLEX4
) "/");
5082 #if FFETARGET_okCOMPLEX5
5083 case FFEINFO_kindtypeREAL5
:
5084 fprintf (out
, "C" STRX (FFETARGET_kindCOMPLEX5
) "/");
5088 #if FFETARGET_okCOMPLEX6
5089 case FFEINFO_kindtypeREAL6
:
5090 fprintf (out
, "C" STRX (FFETARGET_kindCOMPLEX6
) "/");
5094 #if FFETARGET_okCOMPLEX7
5095 case FFEINFO_kindtypeREAL7
:
5096 fprintf (out
, "C" STRX (FFETARGET_kindCOMPLEX7
) "/");
5100 #if FFETARGET_okCOMPLEX8
5101 case FFEINFO_kindtypeREAL8
:
5102 fprintf (out
, "C" STRX (FFETARGET_kindCOMPLEX8
) "/");
5107 assert ("bad COMPLEX kindtype" == NULL
);
5112 case FFEINFO_basictypeCHARACTER
:
5115 #if FFETARGET_okCHARACTER1
5116 case FFEINFO_kindtypeCHARACTER1
:
5117 fprintf (out
, "A" STRX (FFETARGET_kindCHARACTER1
) "/");
5121 #if FFETARGET_okCHARACTER2
5122 case FFEINFO_kindtypeCHARACTER2
:
5123 fprintf (out
, "A" STRX (FFETARGET_kindCHARACTER2
) "/");
5127 #if FFETARGET_okCHARACTER3
5128 case FFEINFO_kindtypeCHARACTER3
:
5129 fprintf (out
, "A" STRX (FFETARGET_kindCHARACTER3
) "/");
5133 #if FFETARGET_okCHARACTER4
5134 case FFEINFO_kindtypeCHARACTER4
:
5135 fprintf (out
, "A" STRX (FFETARGET_kindCHARACTER4
) "/");
5139 #if FFETARGET_okCHARACTER5
5140 case FFEINFO_kindtypeCHARACTER5
:
5141 fprintf (out
, "A" STRX (FFETARGET_kindCHARACTER5
) "/");
5145 #if FFETARGET_okCHARACTER6
5146 case FFEINFO_kindtypeCHARACTER6
:
5147 fprintf (out
, "A" STRX (FFETARGET_kindCHARACTER6
) "/");
5151 #if FFETARGET_okCHARACTER7
5152 case FFEINFO_kindtypeCHARACTER7
:
5153 fprintf (out
, "A" STRX (FFETARGET_kindCHARACTER7
) "/");
5157 #if FFETARGET_okCHARACTER8
5158 case FFEINFO_kindtypeCHARACTER8
:
5159 fprintf (out
, "A" STRX (FFETARGET_kindCHARACTER8
) "/");
5164 assert ("bad CHARACTER kindtype" == NULL
);
5170 assert ("bad basictype" == NULL
);
5171 fprintf (out
, "?/?");
5176 /* ffebld_init_0 -- Initialize the module
5183 assert (FFEBLD_op
== ARRAY_SIZE (ffebld_op_string_
));
5184 assert (FFEBLD_op
== ARRAY_SIZE (ffebld_arity_op_
));
5187 /* ffebld_init_1 -- Initialize the module for a file
5194 #if FFEBLD_whereconstCURRENT_ == FFEBLD_whereconstFILE_
5197 #if FFETARGET_okCHARACTER1
5198 ffebld_constant_character1_
= NULL
;
5200 #if FFETARGET_okCHARACTER2
5201 ffebld_constant_character2_
= NULL
;
5203 #if FFETARGET_okCHARACTER3
5204 ffebld_constant_character3_
= NULL
;
5206 #if FFETARGET_okCHARACTER4
5207 ffebld_constant_character4_
= NULL
;
5209 #if FFETARGET_okCHARACTER5
5210 ffebld_constant_character5_
= NULL
;
5212 #if FFETARGET_okCHARACTER6
5213 ffebld_constant_character6_
= NULL
;
5215 #if FFETARGET_okCHARACTER7
5216 ffebld_constant_character7_
= NULL
;
5218 #if FFETARGET_okCHARACTER8
5219 ffebld_constant_character8_
= NULL
;
5221 #if FFETARGET_okCOMPLEX1
5222 ffebld_constant_complex1_
= NULL
;
5224 #if FFETARGET_okCOMPLEX2
5225 ffebld_constant_complex2_
= NULL
;
5227 #if FFETARGET_okCOMPLEX3
5228 ffebld_constant_complex3_
= NULL
;
5230 #if FFETARGET_okCOMPLEX4
5231 ffebld_constant_complex4_
= NULL
;
5233 #if FFETARGET_okCOMPLEX5
5234 ffebld_constant_complex5_
= NULL
;
5236 #if FFETARGET_okCOMPLEX6
5237 ffebld_constant_complex6_
= NULL
;
5239 #if FFETARGET_okCOMPLEX7
5240 ffebld_constant_complex7_
= NULL
;
5242 #if FFETARGET_okCOMPLEX8
5243 ffebld_constant_complex8_
= NULL
;
5245 #if FFETARGET_okINTEGER1
5246 ffebld_constant_integer1_
= NULL
;
5248 #if FFETARGET_okINTEGER2
5249 ffebld_constant_integer2_
= NULL
;
5251 #if FFETARGET_okINTEGER3
5252 ffebld_constant_integer3_
= NULL
;
5254 #if FFETARGET_okINTEGER4
5255 ffebld_constant_integer4_
= NULL
;
5257 #if FFETARGET_okINTEGER5
5258 ffebld_constant_integer5_
= NULL
;
5260 #if FFETARGET_okINTEGER6
5261 ffebld_constant_integer6_
= NULL
;
5263 #if FFETARGET_okINTEGER7
5264 ffebld_constant_integer7_
= NULL
;
5266 #if FFETARGET_okINTEGER8
5267 ffebld_constant_integer8_
= NULL
;
5269 #if FFETARGET_okLOGICAL1
5270 ffebld_constant_logical1_
= NULL
;
5272 #if FFETARGET_okLOGICAL2
5273 ffebld_constant_logical2_
= NULL
;
5275 #if FFETARGET_okLOGICAL3
5276 ffebld_constant_logical3_
= NULL
;
5278 #if FFETARGET_okLOGICAL4
5279 ffebld_constant_logical4_
= NULL
;
5281 #if FFETARGET_okLOGICAL5
5282 ffebld_constant_logical5_
= NULL
;
5284 #if FFETARGET_okLOGICAL6
5285 ffebld_constant_logical6_
= NULL
;
5287 #if FFETARGET_okLOGICAL7
5288 ffebld_constant_logical7_
= NULL
;
5290 #if FFETARGET_okLOGICAL8
5291 ffebld_constant_logical8_
= NULL
;
5293 #if FFETARGET_okREAL1
5294 ffebld_constant_real1_
= NULL
;
5296 #if FFETARGET_okREAL2
5297 ffebld_constant_real2_
= NULL
;
5299 #if FFETARGET_okREAL3
5300 ffebld_constant_real3_
= NULL
;
5302 #if FFETARGET_okREAL4
5303 ffebld_constant_real4_
= NULL
;
5305 #if FFETARGET_okREAL5
5306 ffebld_constant_real5_
= NULL
;
5308 #if FFETARGET_okREAL6
5309 ffebld_constant_real6_
= NULL
;
5311 #if FFETARGET_okREAL7
5312 ffebld_constant_real7_
= NULL
;
5314 #if FFETARGET_okREAL8
5315 ffebld_constant_real8_
= NULL
;
5317 ffebld_constant_hollerith_
= NULL
;
5318 for (i
= FFEBLD_constTYPELESS_FIRST
; i
<= FFEBLD_constTYPELESS_LAST
; ++i
)
5319 ffebld_constant_typeless_
[i
- FFEBLD_constTYPELESS_FIRST
] = NULL
;
5323 /* ffebld_init_2 -- Initialize the module
5330 #if FFEBLD_whereconstCURRENT_ == FFEBLD_whereconstPROGUNIT_
5334 ffebld_pool_stack_
.next
= NULL
;
5335 ffebld_pool_stack_
.pool
= ffe_pool_program_unit ();
5336 #if FFEBLD_whereconstCURRENT_ == FFEBLD_whereconstPROGUNIT_
5337 #if FFETARGET_okCHARACTER1
5338 ffebld_constant_character1_
= NULL
;
5340 #if FFETARGET_okCHARACTER2
5341 ffebld_constant_character2_
= NULL
;
5343 #if FFETARGET_okCHARACTER3
5344 ffebld_constant_character3_
= NULL
;
5346 #if FFETARGET_okCHARACTER4
5347 ffebld_constant_character4_
= NULL
;
5349 #if FFETARGET_okCHARACTER5
5350 ffebld_constant_character5_
= NULL
;
5352 #if FFETARGET_okCHARACTER6
5353 ffebld_constant_character6_
= NULL
;
5355 #if FFETARGET_okCHARACTER7
5356 ffebld_constant_character7_
= NULL
;
5358 #if FFETARGET_okCHARACTER8
5359 ffebld_constant_character8_
= NULL
;
5361 #if FFETARGET_okCOMPLEX1
5362 ffebld_constant_complex1_
= NULL
;
5364 #if FFETARGET_okCOMPLEX2
5365 ffebld_constant_complex2_
= NULL
;
5367 #if FFETARGET_okCOMPLEX3
5368 ffebld_constant_complex3_
= NULL
;
5370 #if FFETARGET_okCOMPLEX4
5371 ffebld_constant_complex4_
= NULL
;
5373 #if FFETARGET_okCOMPLEX5
5374 ffebld_constant_complex5_
= NULL
;
5376 #if FFETARGET_okCOMPLEX6
5377 ffebld_constant_complex6_
= NULL
;
5379 #if FFETARGET_okCOMPLEX7
5380 ffebld_constant_complex7_
= NULL
;
5382 #if FFETARGET_okCOMPLEX8
5383 ffebld_constant_complex8_
= NULL
;
5385 #if FFETARGET_okINTEGER1
5386 ffebld_constant_integer1_
= NULL
;
5388 #if FFETARGET_okINTEGER2
5389 ffebld_constant_integer2_
= NULL
;
5391 #if FFETARGET_okINTEGER3
5392 ffebld_constant_integer3_
= NULL
;
5394 #if FFETARGET_okINTEGER4
5395 ffebld_constant_integer4_
= NULL
;
5397 #if FFETARGET_okINTEGER5
5398 ffebld_constant_integer5_
= NULL
;
5400 #if FFETARGET_okINTEGER6
5401 ffebld_constant_integer6_
= NULL
;
5403 #if FFETARGET_okINTEGER7
5404 ffebld_constant_integer7_
= NULL
;
5406 #if FFETARGET_okINTEGER8
5407 ffebld_constant_integer8_
= NULL
;
5409 #if FFETARGET_okLOGICAL1
5410 ffebld_constant_logical1_
= NULL
;
5412 #if FFETARGET_okLOGICAL2
5413 ffebld_constant_logical2_
= NULL
;
5415 #if FFETARGET_okLOGICAL3
5416 ffebld_constant_logical3_
= NULL
;
5418 #if FFETARGET_okLOGICAL4
5419 ffebld_constant_logical4_
= NULL
;
5421 #if FFETARGET_okLOGICAL5
5422 ffebld_constant_logical5_
= NULL
;
5424 #if FFETARGET_okLOGICAL6
5425 ffebld_constant_logical6_
= NULL
;
5427 #if FFETARGET_okLOGICAL7
5428 ffebld_constant_logical7_
= NULL
;
5430 #if FFETARGET_okLOGICAL8
5431 ffebld_constant_logical8_
= NULL
;
5433 #if FFETARGET_okREAL1
5434 ffebld_constant_real1_
= NULL
;
5436 #if FFETARGET_okREAL2
5437 ffebld_constant_real2_
= NULL
;
5439 #if FFETARGET_okREAL3
5440 ffebld_constant_real3_
= NULL
;
5442 #if FFETARGET_okREAL4
5443 ffebld_constant_real4_
= NULL
;
5445 #if FFETARGET_okREAL5
5446 ffebld_constant_real5_
= NULL
;
5448 #if FFETARGET_okREAL6
5449 ffebld_constant_real6_
= NULL
;
5451 #if FFETARGET_okREAL7
5452 ffebld_constant_real7_
= NULL
;
5454 #if FFETARGET_okREAL8
5455 ffebld_constant_real8_
= NULL
;
5457 ffebld_constant_hollerith_
= NULL
;
5458 for (i
= FFEBLD_constTYPELESS_FIRST
; i
<= FFEBLD_constTYPELESS_LAST
; ++i
)
5459 ffebld_constant_typeless_
[i
- FFEBLD_constTYPELESS_FIRST
] = NULL
;
5463 /* ffebld_list_length -- Return # of opITEMs in list
5465 ffebld list; // Must be NULL or opITEM
5466 ffebldListLength length;
5467 length = ffebld_list_length(list);
5469 Returns 0 if list is NULL, 1 if it's ffebld_trail is NULL, and so on. */
5472 ffebld_list_length (ffebld list
)
5474 ffebldListLength length
;
5476 for (length
= 0; list
!= NULL
; ++length
, list
= ffebld_trail (list
))
5482 /* ffebld_new_accter -- Create an ffebld object that is an array
5485 ffebldConstantArray a;
5487 x = ffebld_new_accter(a,b); */
5490 ffebld_new_accter (ffebldConstantArray a
, ffebit b
)
5498 x
->op
= FFEBLD_opACCTER
;
5499 x
->u
.accter
.array
= a
;
5500 x
->u
.accter
.bits
= b
;
5504 /* ffebld_new_arrter -- Create an ffebld object that is an array
5507 ffebldConstantArray a;
5508 ffetargetOffset size;
5509 x = ffebld_new_arrter(a,size); */
5512 ffebld_new_arrter (ffebldConstantArray a
, ffetargetOffset size
)
5520 x
->op
= FFEBLD_opARRTER
;
5521 x
->u
.arrter
.array
= a
;
5522 x
->u
.arrter
.size
= size
;
5526 /* ffebld_new_conter_with_orig -- Create an ffebld object that is a constant
5530 x = ffebld_new_conter_with_orig(c,NULL); */
5533 ffebld_new_conter_with_orig (ffebldConstant c
, ffebld o
)
5541 x
->op
= FFEBLD_opCONTER
;
5542 x
->u
.conter
.expr
= c
;
5543 x
->u
.conter
.orig
= o
;
5547 /* ffebld_new_item -- Create an ffebld item object
5550 x = ffebld_new_item(y,z); */
5553 ffebld_new_item (ffebld head
, ffebld trail
)
5561 x
->op
= FFEBLD_opITEM
;
5562 x
->u
.item
.head
= head
;
5563 x
->u
.item
.trail
= trail
;
5567 /* ffebld_new_labter -- Create an ffebld object that is a label
5571 x = ffebld_new_labter(c); */
5574 ffebld_new_labter (ffelab l
)
5582 x
->op
= FFEBLD_opLABTER
;
5587 /* ffebld_new_labtok -- Create object that is a label's NUMBER token
5591 x = ffebld_new_labter(c);
5593 Like the other ffebld_new_ functions, the
5594 supplied argument is stored exactly as is: ffelex_token_use is NOT
5595 called, so the token is "consumed", if one is indeed supplied (it may
5599 ffebld_new_labtok (ffelexToken t
)
5607 x
->op
= FFEBLD_opLABTOK
;
5612 /* ffebld_new_none -- Create an ffebld object with no arguments
5615 x = ffebld_new_none(FFEBLD_opWHATEVER); */
5618 ffebld_new_none (ffebldOp o
)
5630 /* ffebld_new_one -- Create an ffebld object with one argument
5633 x = ffebld_new_one(FFEBLD_opWHATEVER,y); */
5636 ffebld_new_one (ffebldOp o
, ffebld left
)
5645 x
->u
.nonter
.left
= left
;
5649 /* ffebld_new_symter -- Create an ffebld object that is a symbol
5653 ffeintrinGen gen; // Generic intrinsic id, if any
5654 ffeintrinSpec spec; // Specific intrinsic id, if any
5655 ffeintrinImp imp; // Implementation intrinsic id, if any
5656 x = ffebld_new_symter (s, gen, spec, imp); */
5659 ffebld_new_symter (ffesymbol s
, ffeintrinGen gen
, ffeintrinSpec spec
,
5668 x
->op
= FFEBLD_opSYMTER
;
5669 x
->u
.symter
.symbol
= s
;
5670 x
->u
.symter
.generic
= gen
;
5671 x
->u
.symter
.specific
= spec
;
5672 x
->u
.symter
.implementation
= imp
;
5673 x
->u
.symter
.do_iter
= FALSE
;
5677 /* ffebld_new_two -- Create an ffebld object with two arguments
5680 x = ffebld_new_two(FFEBLD_opWHATEVER,y,z); */
5683 ffebld_new_two (ffebldOp o
, ffebld left
, ffebld right
)
5692 x
->u
.nonter
.left
= left
;
5693 x
->u
.nonter
.right
= right
;
5697 /* ffebld_pool_pop -- Pop ffebld's pool stack
5699 ffebld_pool_pop(); */
5704 ffebldPoolstack_ ps
;
5706 assert (ffebld_pool_stack_
.next
!= NULL
);
5707 ps
= ffebld_pool_stack_
.next
;
5708 ffebld_pool_stack_
.next
= ps
->next
;
5709 ffebld_pool_stack_
.pool
= ps
->pool
;
5710 malloc_kill_ks (malloc_pool_image (), ps
, sizeof (*ps
));
5713 /* ffebld_pool_push -- Push ffebld's pool stack
5715 ffebld_pool_push(); */
5718 ffebld_pool_push (mallocPool pool
)
5720 ffebldPoolstack_ ps
;
5722 ps
= malloc_new_ks (malloc_pool_image (), "Pool stack", sizeof (*ps
));
5723 ps
->next
= ffebld_pool_stack_
.next
;
5724 ps
->pool
= ffebld_pool_stack_
.pool
;
5725 ffebld_pool_stack_
.next
= ps
;
5726 ffebld_pool_stack_
.pool
= pool
;
5729 /* ffebld_op_string -- Return short string describing op
5732 ffebld_op_string(o);
5734 Returns a short string (uppercase) containing the name of the op. */
5737 ffebld_op_string (ffebldOp o
)
5739 if (o
>= ARRAY_SIZE (ffebld_op_string_
))
5741 return ffebld_op_string_
[o
];
5744 /* ffebld_size_max -- Return maximum possible size of CHARACTER-type expr
5746 ffetargetCharacterSize sz;
5748 sz = ffebld_size_max (b);
5750 Like ffebld_size_known, but if that would return NONE and the expression
5751 is opSUBSTR, opCONVERT, opPAREN, or opCONCATENATE, returns ffebld_size_max
5752 of the subexpression(s). */
5754 ffetargetCharacterSize
5755 ffebld_size_max (ffebld b
)
5757 ffetargetCharacterSize sz
;
5759 recurse
: /* :::::::::::::::::::: */
5761 sz
= ffebld_size_known (b
);
5763 if (sz
!= FFETARGET_charactersizeNONE
)
5766 switch (ffebld_op (b
))
5768 case FFEBLD_opSUBSTR
:
5769 case FFEBLD_opCONVERT
:
5770 case FFEBLD_opPAREN
:
5771 b
= ffebld_left (b
);
5772 goto recurse
; /* :::::::::::::::::::: */
5774 case FFEBLD_opCONCATENATE
:
5775 sz
= ffebld_size_max (ffebld_left (b
))
5776 + ffebld_size_max (ffebld_right (b
));