PIPS
run-time.c
Go to the documentation of this file.
1 /*
2 
3  $Id: run-time.c 23065 2016-03-02 09:05:50Z coelho $
4 
5  Copyright 1989-2016 MINES ParisTech
6 
7  This file is part of PIPS.
8 
9  PIPS is free software: you can redistribute it and/or modify it
10  under the terms of the GNU General Public License as published by
11  the Free Software Foundation, either version 3 of the License, or
12  any later version.
13 
14  PIPS is distributed in the hope that it will be useful, but WITHOUT ANY
15  WARRANTY; without even the implied warranty of MERCHANTABILITY or
16  FITNESS FOR A PARTICULAR PURPOSE.
17 
18  See the GNU General Public License for more details.
19 
20  You should have received a copy of the GNU General Public License
21  along with PIPS. If not, see <http://www.gnu.org/licenses/>.
22 
23 */
24 #ifdef HAVE_CONFIG_H
25  #include "pips_config.h"
26 #endif
27 /* Runtime Support Functions Management
28  *
29  * Fabien Coelho, May and June 1993
30  */
31 
32 #include "defines-local.h"
33 
34 #include "effects-generic.h"
35 #include "effects-simple.h"
36 #include "effects-convex.h"
37 
38 /* entity MakeRunTimeSupportSubroutine(local_name, number_of_arguments)
39  *
40  * modify 27/09/93, in order not to attempt to redeclare an already declared
41  * subroutine.
42  */
43 entity
45  string local_name,
46  _UNUSED_ int number_of_arguments)
47 {
49  if (entity_undefined_p(res))
51  return res;
52 }
53 
54 /* entity MakeRunTimeSupportFunction
55  * (local_name, number_of_arguments, return_type)
56  *
57  * this function can be used even if the function is already declared
58  * ??? an integer shouldn't always be returned
59  */
60 entity
62  string local_name,
63  _UNUSED_ int number_of_arguments,
64  tag return_type)
65 {
67  (return_type==is_basic_int ? /* ??? rough */
70  return f;
71 }
72 
75 {
76  pips_assert("variable", entity_variable_p(v));
77 
80 }
81 
82 /* string pvm_what_options(b)
83  *
84  * the pvm what option is given back as a string, fellowing the basic given.
85  */
87 basic b;
88 {
89  switch (basic_tag(b))
90  {
91  case is_basic_int:
92  switch (basic_int(b))
93  {
94  case 2: return(PVM_INTEGER2);
95  case 4: return(PVM_INTEGER4);
96  default:
97  pips_internal_error("unexpected integer*%d", basic_int(b));
98  }
99  case is_basic_float:
100  switch (basic_float(b))
101  {
102  case 4: return(PVM_REAL4);
103  case 8: return(PVM_REAL8);
104  default:
105  pips_internal_error("unexpected real*%d", basic_float(b));
106  }
107  case is_basic_logical:
108  switch (basic_logical(b))
109  {
110  case 2: return(PVM_INTEGER2);
111  case 4: return(PVM_INTEGER4);
112  default:
113  pips_internal_error("unexpected logical*%d", basic_logical(b));
114  }
115  case is_basic_overloaded:
116  pips_internal_error("overloaded not welcomed");
117  case is_basic_complex:
118  switch (basic_complex(b))
119  {
120  case 8: return(PVM_COMPLEX8);
121  case 16: return(PVM_COMPLEX16);
122  default:
123  pips_internal_error("unexpected complex*%d", basic_complex(b));
124  }
125  case is_basic_string:
126  return(PVM_STRING);
127  default:
128  pips_internal_error("unexpected basic tag");
129  }
130  return("ERROR");
131 }
132 
133 
134 /****************************************************** STATEMENTS GENERATION */
135 
136 /* Sends
137  */
139 entity f;
140 reference r;
141 {
142  return
146  NIL)));
147 }
148 
149 /* Computes
150  */
152 reference ref;
153 {
154  if (get_bool_property("HPFC_EXPAND_COMPUTE_COMPUTER"))
155  {
156  list linds = reference_indices(ref),
157  largs = make_list_of_constant(0, 7-gen_length(linds));
158  int narray = load_hpf_number(reference_variable(ref));
159 
160  largs = gen_nconc(CONS(EXPRESSION, int_to_expression(narray),
161  NIL),
162  gen_nconc(lUpdateExpr(node_module, linds), largs));
163 
165  largs);
166  }
167  else
170  NIL));
171 }
172 
174 reference ref;
175 {
176  if (get_bool_property("HPFC_EXPAND_COMPUTE_OWNER"))
177  {
178  list linds = reference_indices(ref),
179  largs = make_list_of_constant(0, 7-gen_length(linds));
180  int narray = load_hpf_number(reference_variable(ref));
181 
182  largs = gen_nconc(CONS(EXPRESSION, int_to_expression(narray), NIL),
183  gen_nconc(lUpdateExpr(node_module, linds), largs));
184 
186  largs);
187  }
188  else
191  NIL));
192 }
193 
194 /* new index computation formula, derived from the new declarations
195  * made for the given dimension.
196  */
197 expression
199  entity array,
200  int dim,
201  expression expr)
202 {
203  if (get_bool_property("HPFC_EXPAND_COMPUTE_LOCAL_INDEX"))
204  {
205  tag newdecl = new_declaration_tag(array, dim);
206  dimension the_dim = entity_ith_dimension(array, dim);
207 
208  switch(newdecl)
209  {
210  case is_hpf_newdecl_none:
211  return(expr);
213  {
214  int dl = HpfcExpressionToInt(dimension_lower(the_dim));
215  expression shift = int_to_expression(1 - dl);
216 
218  expr, shift));
219  }
220  case is_hpf_newdecl_beta:
221  {
223  entity template = align_template(a);
224  distribute d = load_hpf_distribution(template);
226  int tempdim = alignment_templatedim(al), procdim;
227  dimension template_dim = FindIthDimension(template,tempdim);
230  tempdim,
231  &procdim);
232  expression
234  rate = alignment_rate(al),
235  prod, t1, the_mod, t2;
236  int
237  iabsrate = abs(HpfcExpressionToInt(rate)),
238  ishift = (HpfcExpressionToInt(alignment_constant(al)) -
239  HpfcExpressionToInt(dimension_lower(template_dim)));
240 
241 
242  prod =
243  ((HpfcExpressionToInt(rate)==1)?
244  (expr):
245  ((iabsrate==1)?
247  expr)):
249  rate,
250  expr))));
251 
252  t1 = ((ishift==0)?
253  (prod):
254  ((ishift>0)?
256  int_to_expression(ishift))):
258  int_to_expression(abs(ishift))))));
259 
261  t1,
262  parameter);
263 
264  t2 = ((iabsrate==1)?
265  (the_mod):
267  the_mod,
268  int_to_expression(iabsrate)));
269 
271  t2,
272  int_to_expression(1)));
273  }
275  {
276  expression
277  expr1 =
279  expr2 = int_to_expression(dim);
280 
282  expr1, expr2, expr));
283  }
285  {
286  expression
288  expr2 = int_to_expression(dim);
289 
291  expr1, expr2, expr));
292  }
293  default:
294  pips_internal_error("unexpected new declaration tag");
295  }
296 
297  }
298  else
299  {
300  expression
302  expr2 = int_to_expression(dim);
303 
305  expr1, expr2, expr));
306  }
307 
308  return(expression_undefined); /* just to avoid a gcc warning */
309 }
310 
311 /*****************************************************************************/
312 
313 /* statement hpfc_make_call_statement(e, l)
314  * generate a call statement to function e, with expression list l
315  * as an argument.
316  */
317 statement
319 {
320  pips_assert("defined", !entity_undefined_p(e));
322  make_call(e, l)));
323 }
324 
325 /************************************************************** SUBSTITUTION */
326 
327 static entity
331 
332 static void rwt(call c)
333 {
334  if (call_function(c)==sub_call_o)
336 }
337 static void srwt(statement s)
338 {
342  }
343 }
344 static void
346 {
347  sub_call_o = o;
348  sub_call_n = n;
349 
354  NULL);
355 
358 }
359 
360 /* this is for the main.
361  * also subs CALL RETURN -> CALL HPFC {HOST|NONE} END...
362  */
363 void
365 {
366  entity
367  rete = entity_intrinsic("RETURN"),
371 
372  substitute_return(rete, hhe, *phs);
373  substitute_return(rete, hne, *pns);
374 
375 
379  }
380 
382  CONS(STATEMENT, (*phs),
383  CONS(STATEMENT, ret,
384  NIL))));
385 
387  CONS(STATEMENT, (*pns),
389  NIL))));
390 }
391 
392 /* call to the runtime support function HPFC_CMPNEIGHBOUR(d)
393  */
395 {
398  NIL));
399 }
400 
401 /* find or create an entity for the packing function...
402  */
403 static entity make_packing_function(ndim, kind, base, nargs)
404 int ndim;
405 bool kind;
406 basic base;
407 int nargs;
408 {
409  char buffer[100], *buf = buffer;
410  sprintf(buf, "%s %s %d",
411  pvm_what_options(base), (kind ? "PACK" : "UNPACK"), ndim);
412  buf += strlen(buf);
413 
414  return MakeRunTimeSupportSubroutine(buffer, nargs);
415 }
416 
417 /* statement st_generate_packing_and_passing(array, content, bsend)
418  *
419  * dimension bounds are refered to as parameters, since we do not
420  * know yet what is the lower and upper of each dimension...
421  */
423 entity array;
424 list content;
425 bool bsend;
426 {
427  int len = gen_length(content);
428  list larg = NIL;
429 
430  pips_assert("valid number of dimensions",
431  len==NumberOfDimension(array) && (len<=4) && (len>=1));
432 
434 
435  MAP(RANGE, r,
436  {
437  larg = gen_nconc(larg,
441  NIL))));
442  },
443  content);
444 
446  larg);
447 
448  /* larg content:
449  *
450  * array, dim [lower, upper]*len, range [lower, upper, increment]*len
451  */
452 
454  (make_packing_function(len, bsend, entity_basic(array), 1+5*len),
455  larg);
456 
457 }
458 
459 /* returns the entity to which e is attached,
460  * that is first a common, then a function...
461  */
463 {
464  storage s = entity_storage(e);
465  bool in_common = entity_in_common_p(e),
466  in_ram = storage_ram_p(s);
467  ram r = (in_ram ? storage_ram(s) : ram_undefined);
468 
469  pips_assert("not in rom", !storage_rom_p(s));
470 
471  return(in_ram ?
472  (in_common ? ram_section(r) : ram_function(r)):
475 }
476 
477 /* returns the name of the entity e belongs too (common, function...)
478  */
480 {
482 }
483 
484 /* returns a name for the bound of the declaration
485  * of array array, side side and dimension dim.
486  */
487 string
489  entity array,
490  string side,
491  int dim)
492 {
494  entity_local_name(array), " ",
495  side, int2a(dim), NULL));
496 }
497 
498 entity
500  entity module,
501  entity array,
502  bool upper,
503  int dim)
504 {
505  entity result;
506  string name = bound_parameter_name(array, upper? UPPER: LOWER, dim);
507 
509  is_basic_int);
510 
511  free(name);
512  return result;
513 }
514 
515 expression
516 hpfc_array_bound(entity array, bool upper, int dim)
517 {
518  /*
519  return entity_to_expression
520  (argument_bound_entity(node_module, array, upper, dim));
521  */
523  upper?UPPER:LOWER, dim));
524 }
525 
526 static list /* of expressions */
528 {
529  int i = -1, ndim = NumberOfDimension(array);
530  list result = NIL;
531 
532  for (i=ndim ; i>=1 ; i--)
533  result = CONS(EXPRESSION, hpfc_array_bound(array, upper, i), result);
534 
535  return result;
536 }
537 
538 list /* of expressions */
540 {
541  list /* of expression */ lb = array_bounds_list(array, false),
542  lu = array_bounds_list(array, true),
543  l = lb, lnb, lnu;
544 
545  if (!l) return NIL;
546 
547  /* interleave both lists (just for fun:-)
548  */
549  for(lnb=CDR(lb), lnu=CDR(lu); lb;
550  CDR(lb)=lu, CDR(lu)=lnb,
551  lb=lnb, lnb=lnb?CDR(lnb):NIL, lu=lnu, lnu=lnu?CDR(lnu):NIL);
552 
553  return l;
554 }
555 
556 /************************************************* HPFC ENTITIES MANAGEMENT */
557 
558 /* this file stores the table that describes run time functions and
559  * variables that may be called or referenced by the generated code.
560  * the information needed (name, arity, type...) is stored in a static
561  * table here. The table is scanned to create the corresponding entities
562  * for once. Then the entities are quickly returned on demand thru the
563  * hpfc_name_to_entity function. It was inspired to me by some static
564  * table here around in PIPS, that deal with intrinsics for instance.
565  */
566 
567 /* local defines
568  */
569 
570 #define is_end 0
571 #define is_sub 1
572 #define is_fun 2
573 #define is_var 3
574 #define is_int 4
575 #define is_ifn 5 /* intrinsic like function */
576 #define is_iof 6 /* I/O like function */
577 
578 #define no_basic is_basic_overloaded
579 #define no_entity entity_undefined
580 
581 typedef struct
582 {
583  char name[30];
584  int arity;
585  int what; /* function or subroutine or variable or ...*/
586  tag basic;/* basic tag if necessary */
589 
590 static bool RTSTable_initialized_p = false;
591 
593 {
594  { SND_TO_C, 2, is_sub, no_basic, no_entity },
595  { SND_TO_H, 2, is_sub, no_basic, no_entity },
596  { SND_TO_A, 2, is_sub, no_basic, no_entity },
598  { SND_TO_O, 2, is_sub, no_basic, no_entity },
604  { RCV_FR_S, 2, is_sub, no_basic, no_entity },
605  { RCV_FR_H, 2, is_sub, no_basic, no_entity },
606  { RCV_FR_C, 2, is_sub, no_basic, no_entity },
609 /* { CMP_COMPUTER, 1, is_sub, no_basic, no_entity },*/
611 /* { CMP_OWNERS, 1, is_sub, no_basic, no_entity }, */
614  { CMP_LID, 8, is_fun, no_basic, no_entity },
615  { TWIN_P, 2, is_fun, no_basic, no_entity },
623  { IDIVIDE, 2, is_fun, no_basic, no_entity },
626  { HOST_END, 0, is_sub, no_basic, no_entity },
627  { NODE_END, 0, is_sub, no_basic, no_entity },
630  { SYNCHRO, 0, is_sub, no_basic, no_entity },
631  { SND_TO_N, 0, is_sub, no_basic, no_entity },
632  { RCV_FR_N, 0, is_sub, no_basic, no_entity },
633 
634 /* HOST/NODE MESSAGES
635  */
642 
643 /* PVM 3 stuff
644  */
646  { PVM_SEND, 3, is_sub, no_basic, no_entity },
647  { PVM_RECV, 3, is_sub, no_basic, no_entity },
648  { PVM_CAST, 4, is_sub, no_basic, no_entity },
649  { PVM_PACK, 5, is_sub, no_basic, no_entity },
651 
652 /* Variables: the overloaded ones *must* be kept overloaded, otherwise
653  * they may be added in the declarations, while there are
654  * in the included commons...
655  */
656  { MYPOS, 2, is_var, no_basic, no_entity },
657  { MYLID, 0, is_var, no_basic, no_entity },
658  { MSTATUS, 1, is_var, no_basic, no_entity },
660  { INFO, 0, is_var, is_basic_int, no_entity },
662  { NBTASKS, 0, is_var, no_basic, no_entity },
665  { NODETIDS, 1, is_var, no_basic, no_entity },
669  { HOST_TID, 0, is_var, no_basic, no_entity },
672 
673 /* common /hpfc_buffers/
674  */
682  /* { BUFFER_ENCODING, 0, is_var, no_basic, no_entity }, */
683 
684  /* typed buffers
685  */
694 
695  /* typed buffer sizes
696  */
705 
706  /* typed pack/unpack hpfc functions, for buffer management.
707  */
716 
725 
726 /* special FCD target calls.
727  */
734 
735 /* special FCD calls needed for translation...
736  */
743 
744 /* End
745  */
746  { "", 0, is_end, -1, NULL },
747 };
748 
749 /* to be seen from outside of this file
750  */
752 {
754  int i=0;
755  list l=NIL;
756 
757  if (RTSTable_initialized_p) return;
758  RTSTable_initialized_p = true;
759 
760  for(current=RTSTable;
761  current->what!=is_end;
762  current++)
763  {
764  pips_debug(6, "initializing %s, %d\n", current->name, current->arity);
765 
766  switch(current->what)
767  {
768  case is_fun:
769  current->object = MakeRunTimeSupportFunction(current->name,
770  current->arity,
771  current->basic);
772  break;
773  case is_sub:
775  current->arity);
776  break;
777  case is_ifn:
778  /* they are declared as variables to avoid redefinitions
779  * ??? this fools pips typing (functions/variables and so)
780  * just okay for the pretty printer...
781  */
782  case is_iof:
783  case is_var:
784  current->object =
786  HPFC_PACKAGE, /* why not */
787  current->basic);
788  /* dimensions are updated
789  */
790  l = NIL;
791  for(i=1; i<=current->arity; i++)
792  l = CONS(DIMENSION,
795  NIL),
796  l);
798  (type_variable(entity_type(current->object))) = l;
799  break;
800  default:
801  pips_internal_error("unexpected what field in Descriptor");
802  }
803  }
804 }
805 
807 {
809 
810  for(current=RTSTable; current->what!=is_end; current++)
811  if (!strcmp(current->name, name))
812  return current;
813 
814  return (RunTimeSupportDescriptor *) NULL;
815 }
816 
817 entity hpfc_name_to_entity(const char *name)
818 {
820 
821  if (entry) return entry->object;
822 
823  pips_internal_error("%s not found", name);
824 
825  return entity_undefined; /* just to avoid a gcc warning */
826 }
827 
829 entity e;
830 {
832 
833  return entry ? entry->what==is_ifn : false;
834 }
835 
837 entity e;
838 {
840 
841  return entry ? entry->what==is_iof : false;
842 }
843 
844 /* that is all
845  */
call make_call(entity a1, list a2)
Definition: ri.c:269
language make_language_fortran(void)
Definition: ri.c:1250
statement copy_statement(statement p)
STATEMENT.
Definition: ri.c:2186
dimension make_dimension(expression a1, expression a2, list a3)
Definition: ri.c:565
instruction make_instruction(enum instruction_utype tag, void *val)
Definition: ri.c:1166
static reference ref
Current stmt (an integer)
Definition: adg_read_paf.c:163
bdt base
Current expression.
Definition: bdt_read_paf.c:100
entity node_module
Definition: compiler.c:47
expression MakeCharacterConstantExpression(string s)
END_EOLE.
Definition: constant.c:573
#define ret(why, what)
true if not a remapping for old.
Definition: dynamic.c:986
const char * local_name(const char *s)
Does not take care of block scopes and returns a pointer.
Definition: entity_names.c:221
bool get_bool_property(const string)
FC 2015-07-20: yuk, moved out to prevent an include cycle dependency include "properties....
#define UPPER(c)
Definition: genSML.c:37
void free(void *)
statement make_block_statement(list)
Make a block statement from a list of statement.
Definition: statement.c:616
statement instruction_to_statement(instruction)
Build a statement from a give instruction.
Definition: statement.c:597
void gen_multi_recurse(void *o,...)
Multi recursion visitor function.
Definition: genClib.c:3428
bool gen_false(__attribute__((unused)) gen_chunk *unused)
Return false and ignore the argument.
Definition: genClib.c:2796
void gen_null(__attribute__((unused)) void *unused)
Ignore the argument.
Definition: genClib.c:2752
bool gen_true(__attribute__((unused)) gen_chunk *unused)
Return true and ignore the argument.
Definition: genClib.c:2780
#define NIL
The empty list (nil in Lisp)
Definition: newgen_list.h:47
size_t gen_length(const list l)
Definition: list.c:150
#define CONS(_t_, _i_, _l_)
List element cell constructor (insert an element at the beginning of a list)
Definition: newgen_list.h:150
list gen_nconc(list cp1, list cp2)
physically concatenates CP1 and CP2 but do not duplicates the elements
Definition: list.c:344
#define CDR(pcons)
Get the list less its first element.
Definition: newgen_list.h:111
#define MAP(_map_CASTER, _map_item, _map_code, _map_list)
Apply/map an instruction block on all the elements of a list (old fashioned)
Definition: newgen_list.h:226
list lUpdateExpr(entity module, list l)
#define alignment_templatedim(x)
Definition: hpf.h:136
#define alignment_constant(x)
Definition: hpf.h:140
#define align_template(x)
Definition: hpf.h:98
#define align_alignment(x)
Definition: hpf.h:96
#define distribute_distribution(x)
Definition: hpf.h:174
#define alignment_rate(x)
Definition: hpf.h:138
#define distribution_parameter(x)
Definition: hpf.h:212
@ is_hpf_newdecl_none
Definition: hpf_private.h:665
@ is_hpf_newdecl_delta
Definition: hpf_private.h:669
@ is_hpf_newdecl_alpha
Definition: hpf_private.h:666
@ is_hpf_newdecl_beta
Definition: hpf_private.h:667
@ is_hpf_newdecl_gamma
Definition: hpf_private.h:668
#define HPFC_PACKAGE
local definitions
Definition: hpfc-local.h:27
int HpfcExpressionToInt(expression e)
HpfcExpressionToInt(e)
Definition: hpfc-util.c:569
alignment FindAlignmentOfDim(list lal, int dim)
Definition: hpfc-util.c:377
distribution FindDistributionOfDim(list ldi, int dim, int *pdim)
Definition: hpfc-util.c:401
tag new_declaration_tag(entity array, int dim)
Definition: declarations.c:229
#define SND_TO_H
#define HOST_TIMEON
special FCD calls.
#define BUFFER
common /hpfc_buffers/
#define SND_TO_N
#define PVM_REAL4
#define PVM_INITSEND
PVM functions that may be called by the generated code.
#define CMP_COMPUTER
#define CMP_LID
#define TWIN_P
#define IDIVIDE
#define SND_TO_C
Run-time support functions and subroutine names.
#define PVM_COMPLEX16
#define CND_OWNERP
#define PVM_BYTE1
PVM types encoding for packing and unpacking.
#define BUFFER_RCV_SIZE
#define NODE_TIMEON
#define SND_TO_O
#define SEND_CHANNELS
#define SND_TO_A
#define CND_SENDERP
#define T_LIDp
#define LIVEMAPPING
#define INIT_NODE
#define SND_TO_NO
#define PVM_COMPLEX8
#define LAZY_SEND
#define RCV_FR_N
#define SND_NOT_INIT
#define PVM_RECV
#define HOST_END
#define PVM_REAL8
#define RCV_FR_mCH
#define BUFPCK
hpfc packing and unpacking
#define CMP_OWNERS
#define PVM_PACK
#define RCV_FR_H
#define HPFC_STOP
#define CND_COMPINOWNP
#define st_init_host()
#define BUFUPK
#define HPFC_NTELL
#define LOOP_BOUNDS
#define NODETIDS
#define SYNCHRO
#define PVM_CAST
#define RECV_CHANNELS
#define HPFC_rN2H
#define PVM_INTEGER2
#define MYPOS
#define HOST_SND_CHAN
#define RENAME_SUFFIX
#define LOCAL_IND_GAMMA
#define MYLID
#define HPFC_HCAST
host/node communications
#define MSTATUS
#define LAZY_RECV
#define LOCAL_IND
#define NODE_TIMEOFF
#define CMP_NEIGHBOUR
#define HPFC_rH2N
#define RCV_NOT_PRF
#define BUFFER_INDEX
#define MCASTHOST
#define CND_COMPUTERP
#define NBTASKS
#define HOST_RCV_CHAN
#define LOWER
#define HOST_TID
#define SND_TO_HA
define SND_TO_HA "HPFC SNDTO HA"
#define NODE_END
#define BUFSZ
#define SND_TO_OOS
#define T_LID
Variables.
#define PVM_STRING
#define PVM_INTEGER4
#define HPFC_sH2N
#define HPFC_sN2H
#define INIT_HOST
#define SND_TO_A_BY_H
#define HPFC_NCAST
#define PVM_UNPACK
#define PVM_SEND
#define RCV_FR_C
#define HOST_TIMEOFF
#define INFO
#define RCV_FR_S
#define BUFID
#define st_init_node()
#define LOCAL_IND_DELTA
#define RCV_FR_mCS
define RCV_FR_mCS "HPFC RCVFR mCS"
#define HPFC_HTELL
#define SND_TO_HNO
#define SND_TO_OS
distribute load_hpf_distribution(entity)
align load_hpf_alignment(entity)
intptr_t load_hpf_number(entity)
#define _UNUSED_
Definition: misc-local.h:232
#define pips_debug
these macros use the GNU extensions that allow variadic macros, including with an empty list.
Definition: misc-local.h:145
#define pips_assert(what, predicate)
common macros, two flavors depending on NDEBUG
Definition: misc-local.h:172
#define pips_internal_error
Definition: misc-local.h:149
string concatenate(const char *,...)
Return the concatenation of the given strings.
Definition: string.c:183
int tag
TAG.
Definition: newgen_types.h:92
int f(int off1, int off2, int n, float r[n], float a[n], float b[n])
Definition: offsets.c:15
static char * module
Definition: pips.c:74
#define HPF_PREFIX
moved here because needed by syntax:-(
#define TIMEON_SUFFIX
#define SYNCHRO_SUFFIX
#define MINUS_OPERATOR_NAME
#define PLUS_OPERATOR_NAME
#define MOD_INTRINSIC_NAME
#define HOSTSECTION_SUFFIX
#define TIMEOFF_SUFFIX
#define entity_variable_p(e)
An entity_variable_p(e) may hide a typedef and hence a functional type.
#define TELL_SUFFIX
suffixes for my own (FCD:-) directives.
#define DIVIDE_OPERATOR_NAME
#define UNARY_MINUS_OPERATOR_NAME
#define MULTIPLY_OPERATOR_NAME
const char * entity_local_name(entity e)
entity_local_name modified so that it does not core when used in vect_fprint, since someone thought t...
Definition: entity.c:453
bool entity_return_label_p(entity e)
Definition: entity.c:673
entity module_name_to_entity(const char *mn)
This is an alias for local_name_to_top_level_entity.
Definition: entity.c:1479
entity make_empty_subroutine(const char *name, language l)
Definition: entity.c:268
entity entity_empty_label(void)
Definition: entity.c:1105
basic entity_basic(entity e)
return the basic associated to entity e if it's a function/variable/constant basic_undefined otherwis...
Definition: entity.c:1380
const char * module_local_name(entity e)
Returns the module local user name.
Definition: entity.c:582
entity entity_intrinsic(const char *name)
FI: I do not understand this function name (see next one!).
Definition: entity.c:1292
entity make_empty_function(const char *name, type r, language l)
Definition: entity.c:283
bool entity_in_common_p(entity e)
Definition: entity.c:1082
expression reference_to_expression(reference r)
Definition: expression.c:196
expression entity_to_expression(entity e)
if v is a constant, returns a constant call.
Definition: expression.c:165
expression MakeBinaryCall(entity f, expression eg, expression ed)
Creates a call expression to a function with 2 arguments.
Definition: expression.c:354
expression int_to_expression(_int i)
transform an int into an expression and generate the corresponding entity if necessary; it is not cle...
Definition: expression.c:1188
list make_list_of_constant(int val, int number)
of expression
Definition: expression.c:3369
expression MakeUnaryCall(entity f, expression a)
Creates a call expression to a function with one argument.
Definition: expression.c:342
expression MakeTernaryCall(entity f, expression e1, expression e2, expression e3)
Creates a call expression to a function with 3 arguments.
Definition: expression.c:367
dimension entity_ith_dimension(entity, int)
Another semantics would be: is this reference r to e a kill for e? In general, this cannot be answere...
Definition: variable.c:1228
dimension FindIthDimension(entity, int)
Definition: type.c:1180
type MakeIntegerResult(void)
Definition: type.c:276
entity find_or_create_typed_entity(string, const char *, tag)
Looks for an entity of the specified basic.
Definition: variable.c:1046
int NumberOfDimension(entity)
Definition: size.c:588
type MakeOverloadedResult(void)
this function creates a default fortran operator result, i.e.
Definition: type.c:261
@ is_basic_string
Definition: ri.h:576
@ is_basic_float
Definition: ri.h:572
@ is_basic_overloaded
Definition: ri.h:574
@ is_basic_int
Definition: ri.h:571
@ is_basic_logical
Definition: ri.h:573
@ is_basic_complex
Definition: ri.h:575
#define expression_domain
newgen_execution_domain_defined
Definition: ri.h:154
#define storage_formal_p(x)
Definition: ri.h:2522
#define call_function(x)
Definition: ri.h:709
#define reference_variable(x)
Definition: ri.h:2326
#define basic_int(x)
Definition: ri.h:616
#define range_upper(x)
Definition: ri.h:2290
#define ram_undefined
Definition: ri.h:2221
#define dimension_lower(x)
Definition: ri.h:980
#define basic_tag(x)
Definition: ri.h:613
#define type_variable(x)
Definition: ri.h:2949
#define entity_storage(x)
Definition: ri.h:2794
#define statement_domain
newgen_sizeofexpression_domain_defined
Definition: ri.h:362
#define range_increment(x)
Definition: ri.h:2292
#define storage_ram_p(x)
Definition: ri.h:2519
#define call_domain
newgen_callees_domain_defined
Definition: ri.h:58
#define ram_section(x)
Definition: ri.h:2249
#define storage_formal(x)
Definition: ri.h:2524
#define EXPRESSION(x)
EXPRESSION.
Definition: ri.h:1217
#define statement_label(x)
Definition: ri.h:2450
#define entity_undefined_p(x)
Definition: ri.h:2762
#define entity_undefined
Definition: ri.h:2761
#define expression_undefined
Definition: ri.h:1223
#define basic_logical(x)
Definition: ri.h:622
@ is_instruction_call
Definition: ri.h:1474
#define RANGE(x)
RANGE.
Definition: ri.h:2257
#define formal_function(x)
Definition: ri.h:1406
#define reference_indices(x)
Definition: ri.h:2328
#define basic_float(x)
Definition: ri.h:619
#define range_lower(x)
Definition: ri.h:2288
#define variable_dimensions(x)
Definition: ri.h:3122
#define storage_ram(x)
Definition: ri.h:2521
#define basic_complex(x)
Definition: ri.h:628
#define ram_function(x)
Definition: ri.h:2247
#define storage_rom_p(x)
Definition: ri.h:2525
#define entity_type(x)
Definition: ri.h:2792
#define storage_return_p(x)
Definition: ri.h:2516
#define storage_return(x)
Definition: ri.h:2518
#define STATEMENT(x)
STATEMENT.
Definition: ri.h:2413
#define is_iof
Definition: run-time.c:576
void hpfc_init_run_time_entities()
to be seen from outside of this file
Definition: run-time.c:751
static RunTimeSupportDescriptor RTSTable[]
Definition: run-time.c:592
statement st_call_send_or_receive(entity f, reference r)
Sends.
Definition: run-time.c:138
expression pvm_what_option_expression(entity v)
Definition: run-time.c:74
void add_pvm_init_and_end(statement *phs, statement *pns)
this is for the main.
Definition: run-time.c:364
list array_lower_upper_bounds_list(entity array)
of expressions
Definition: run-time.c:539
statement st_compute_current_owners(reference ref)
Definition: run-time.c:173
string bound_parameter_name(entity array, string side, int dim)
returns a name for the bound of the declaration of array array, side side and dimension dim.
Definition: run-time.c:488
string pvm_what_options(basic b)
string pvm_what_options(b)
Definition: run-time.c:86
static bool RTSTable_initialized_p
Definition: run-time.c:590
bool hpfc_intrinsic_like_function(entity e)
Definition: run-time.c:828
static entity sub_ret_label
Definition: run-time.c:330
statement st_compute_neighbour(int d)
call to the runtime support function HPFC_CMPNEIGHBOUR(d)
Definition: run-time.c:394
static void substitute_return(entity o, entity n, statement s)
Definition: run-time.c:345
const char * hpfc_main_entity_name(entity e)
returns the name of the entity e belongs too (common, function...)
Definition: run-time.c:479
static entity make_packing_function(int ndim, bool kind, basic base, int nargs)
find or create an entity for the packing function...
Definition: run-time.c:403
#define no_entity
Definition: run-time.c:579
static list array_bounds_list(entity array, bool upper)
of expressions
Definition: run-time.c:527
static entity sub_call_n
Definition: run-time.c:329
expression expr_compute_local_index(entity array, int dim, expression expr)
new index computation formula, derived from the new declarations made for the given dimension.
Definition: run-time.c:198
static entity sub_call_o
Definition: run-time.c:328
#define is_sub
Definition: run-time.c:571
statement st_compute_current_computer(reference ref)
Computes.
Definition: run-time.c:151
#define no_basic
Definition: run-time.c:578
#define is_var
Definition: run-time.c:573
#define is_fun
Definition: run-time.c:572
static void srwt(statement s)
Definition: run-time.c:337
entity MakeRunTimeSupportFunction(string local_name, _UNUSED_ int number_of_arguments, tag return_type)
entity MakeRunTimeSupportFunction (local_name, number_of_arguments, return_type)
Definition: run-time.c:61
entity hpfc_name_to_entity(const char *name)
Definition: run-time.c:817
#define is_ifn
Definition: run-time.c:575
static void rwt(call c)
Definition: run-time.c:332
entity argument_bound_entity(entity module, entity array, bool upper, int dim)
Definition: run-time.c:499
statement hpfc_make_call_statement(entity e, list l)
statement hpfc_make_call_statement(e, l) generate a call statement to function e, with expression lis...
Definition: run-time.c:318
#define is_end
this file stores the table that describes run time functions and variables that may be called or refe...
Definition: run-time.c:570
expression hpfc_array_bound(entity array, bool upper, int dim)
Definition: run-time.c:516
entity MakeRunTimeSupportSubroutine(string local_name, _UNUSED_ int number_of_arguments)
Runtime Support Functions Management.
Definition: run-time.c:44
static RunTimeSupportDescriptor * find_entry_by_name(const char *name)
Definition: run-time.c:806
bool hpfc_io_like_function(entity e)
Definition: run-time.c:836
statement st_generate_packing(entity array, list content, bool bsend)
statement st_generate_packing_and_passing(array, content, bsend)
Definition: run-time.c:422
entity hpfc_main_entity(entity e)
returns the entity to which e is attached, that is first a common, then a function....
Definition: run-time.c:462
char * strdup()
static entity array
static char buf[BSZ]
Definition: split_file.c:157
static size_t current
Definition: string.c:115
static string buffer
Definition: string.c:113
#define BUFFER_SIZE
entity object
basic tag if necessary
Definition: run-time.c:587
tag basic
function or subroutine or variable or ...
Definition: run-time.c:586
The structure used to build lists in NewGen.
Definition: newgen_list.h:41
#define abs(v)
Definition: syntax-local.h:48
char * int2a(int)
util.c
Definition: util.c:42