26 #include "pips_config.h"
53 #define NO_POC { { spoc_poc_unused, 0 }, { spoc_poc_unused, 0 } }
54 #define NO_MES { measure_none, measure_none }
57 #define NOPE_SPOC { spoc_nothing, NO_POC, alu_unused, NO_MES }
58 #define NOPE_TRPX { 0, 0, 0, 0, 0, 0, false, false, NULL }
59 #define NOPE_OPCL { F, F, NULL, NULL }
60 #define NOPE_SIGMAC { "Id", "nop", "width, height", F, 0 }
61 #define NOPE_MPPA {"MPPA_KERNEL_NOP"}
64 #define NO_SPOC { spoc_not_implemented, NO_POC, alu_unused, NO_MES }
65 #define NO_TRPX { 0, 0, 0, 0, 0, -1, false, false, NULL }
66 #define NO_OPCL { F, F, NULL, NULL }
67 #define NO_SIGMAC { "not_implemented", NULL, NULL, F, 0 }
68 #define NO_MPPA {"MPPA_KERNEL_NOP"}
70 #define TRPX_OP(c, op) { 0, 0, 0, 0, 0, c, true, false, "TERAPIX_UCODE_" op }
71 #define TRPX_IO(c, op) { 0, 0, 0, 0, 0, c, true, true, "TERAPIX_UCODE_" op }
72 #define TRPX_NG(c, op) { 1, 1, 1, 1, 0, c, false, false, "TERAPIX_UCODE_" op }
75 #define TRPX_MS(m, c, op) { 0, 0, 0, 0, m, c, true, false, "TERAPIX_UCODE_" op }
77 #define OPCL(op) { T, F, "PIXEL_" op, NULL }
78 #define OPCLK(op,init) { F, T, "PIXEL_" op, "PIXEL_" init }
80 #define SGC_W(ag, pref) { #ag, #pref, "width", T, 1 }
81 #define SGC_WH(ag, pref) { #ag, #pref, "width, height", F, 0 }
83 #define MPPA(kernel) {#kernel}
86 #define TY_INT "int32_t"
87 #define TY_PIN "int32_t *"
88 #define TY_CIP "const int32_t *"
89 #define TY_UIN "uint32_t"
90 #define TY_PUI "uint32_t *"
92 #define NO_PARAM { NULL, NULL, NULL }
120 SGC_W(img_add_img_16, add),
121 MPPA(MPPA_KERNEL_ADD)
126 SGC_W(img_sub_img_16, sub),
127 MPPA(MPPA_KERNEL_SUB)
132 SGC_W(img_mul_img_16, mul),
133 MPPA(MPPA_KERNEL_MUL)
138 SGC_W(img_div_img_16, div),
139 MPPA(MPPA_KERNEL_DIV)
144 SGC_W(img_addsat_img_16, addsat),
145 MPPA(MPPA_KERNEL_ADDSAT)
150 SGC_W(img_subsat_img_16, subsat),
151 MPPA(MPPA_KERNEL_SUBSAT)
156 SGC_W(img_absdiff_img_16, absd),
157 MPPA(MPPA_KERNEL_ABSDIFF)
162 SGC_W(img_inf_img_16, inf),
163 MPPA(MPPA_KERNEL_INF)
168 SGC_W(img_sup_img_16, sup),
169 MPPA(MPPA_KERNEL_SUP)
174 SGC_W(img_and_img_16, and),
175 MPPA(MPPA_KERNEL_AND)
180 SGC_W(img_or_img_16, or),
186 SGC_W(img_xor_img_16, xor),
187 MPPA(MPPA_KERNEL_XOR)
192 SGC_W(img_mask_img_16, mask),
193 MPPA(MPPA_KERNEL_MASK)
195 {
AIPO "replace_const",
":",
AIPO "replace_const",
200 SGC_W(img_replace_const, replc),
201 MPPA(MPPA_KERNEL_REPLACE_CONST)
208 SGC_W(img_invert_16, not),
209 MPPA(MPPA_KERNEL_NOT)
214 SGC_W(img_log2_16, log2),
215 MPPA(MPPA_KERNEL_LOG2)
217 {
AIPO "add_const",
"+_", NULL, 1, 1, 0, 1,
NO_PARAM, {
TY_INT, NULL, NULL },
220 SGC_W(img_add_const_16, addc),
221 MPPA(MPPA_KERNEL_ADD_CONST)
223 {
AIPO "inf_const",
"<_", NULL, 1, 1, 0, 1,
NO_PARAM, {
TY_INT, NULL, NULL },
226 SGC_W(img_inf_const_16, infc),
227 MPPA(MPPA_KERNEL_INF_CONST)
229 {
AIPO "sup_const",
">_", NULL, 1, 1, 0, 1,
NO_PARAM, {
TY_INT, NULL, NULL },
232 SGC_W(img_sup_const_16, supc),
233 MPPA(MPPA_KERNEL_SUP_CONST)
235 {
AIPO "sub_const",
"-_", NULL, 1, 1, 0, 1,
NO_PARAM, {
TY_INT, NULL, NULL },
238 SGC_W(img_sub_const_16, subc),
239 MPPA(MPPA_KERNEL_SUB_CONST)
241 {
AIPO "const_sub",
"_-", NULL, 1, 1, 0, 1,
NO_PARAM, {
TY_INT, NULL, NULL },
244 SGC_W(img_const_sub_16, csub),
245 MPPA(MPPA_KERNEL_CONST_SUB)
247 {
AIPO "and_const",
"&_", NULL, 1, 1, 0, 1,
NO_PARAM, {
TY_INT, NULL, NULL },
250 SGC_W(img_and_const_16, andc),
251 MPPA(MPPA_KERNEL_AND_CONST)
253 {
AIPO "or_const",
"|_", NULL, 1, 1, 0, 1,
NO_PARAM, {
TY_INT, NULL, NULL },
256 SGC_W(img_or_const_16, orc),
257 MPPA(MPPA_KERNEL_OR_CONST)
259 {
AIPO "xor_const",
"^_", NULL, 1, 1, 0, 1,
NO_PARAM, {
TY_INT, NULL, NULL },
262 SGC_W(img_xor_const_16, xorc),
263 MPPA(MPPA_KERNEL_XOR_CONST)
265 {
AIPO "addsat_const",
"+s_", NULL, 1, 1, 0, 1,
NO_PARAM,
269 SGC_W(img_addsat_const_16, addsatc),
270 MPPA(MPPA_KERNEL_ADDSAT_CONST)
272 {
AIPO "subsat_const",
"-s_", NULL, 1, 1, 0, 1,
NO_PARAM,
276 SGC_W(img_subsat_const_16, subsatc),
277 MPPA(MPPA_KERNEL_SUBSAT_CONST)
279 {
AIPO "const_subsat",
"_-s", NULL, 1, 1, 0, 1,
NO_PARAM,
283 SGC_W(img_const_subsat_16, csubsat),
284 MPPA(MPPA_KERNEL_CONST_SUBSAT)
286 {
AIPO "absdiff_const",
"-|_", NULL, 1, 1, 0, 1,
NO_PARAM,
290 SGC_W(img_absdiff_const_16, absdc),
291 MPPA(MPPA_KERNEL_ABSDIFF_CONST)
293 {
AIPO "mul_const",
"*_", NULL, 1, 1, 0, 1,
NO_PARAM, {
TY_INT, NULL, NULL },
296 SGC_W(img_mul_const_16, mulcst),
297 MPPA(MPPA_KERNEL_MUL_CONST)
299 {
AIPO "div_const",
"/_", NULL, 1, 1, 0, 1,
NO_PARAM, {
TY_INT, NULL, NULL },
302 SGC_W(img_div_const_16, divc),
303 MPPA(MPPA_KERNEL_DIV_CONST)
305 {
AIPO "const_div",
"_/", NULL, 1, 1, 0, 1,
NO_PARAM, {
TY_INT, NULL, NULL },
308 SGC_W(img_const_div_16, cdiv),
309 MPPA(MPPA_KERNEL_CONST_DIV)
312 {
AIPO "set_constant",
"C", NULL, 1, 0, 0, 1,
NO_PARAM, {
TY_INT, NULL, NULL},
315 SGC_W(img_set_constant_16, setc),
316 MPPA(MPPA_KERNEL_SET_CONST)
330 MPPA(MPPA_KERNEL_COPY)
340 SGC_W(thresholder, thr),
341 MPPA(MPPA_KERNEL_THRESHOLD)
344 {
AIPO "erode_6c",
"E6", NULL, 1, 1, 0, 1,
NO_PARAM, {
TY_CIP, NULL, NULL },
349 SGC_WH(img_erode_6c_16, ero6c),
350 MPPA(MPPA_KERNEL_ERODE_6)
352 {
AIPO "dilate_6c",
"D6", NULL, 1, 1, 0, 1,
NO_PARAM, {
TY_CIP, NULL, NULL },
357 SGC_WH(img_dilate_6c_16, dil6c),
358 MPPA(MPPA_KERNEL_DILATE_6)
360 {
AIPO "erode_8c",
"E8", NULL, 1, 1, 0, 1,
NO_PARAM, {
TY_CIP, NULL, NULL },
365 SGC_WH(img_erode_16, ero),
366 MPPA(MPPA_KERNEL_ERODE_8)
368 {
AIPO "dilate_8c",
"D8", NULL, 1, 1, 0, 1,
NO_PARAM, {
TY_CIP, NULL, NULL },
373 SGC_WH(img_dilate_16, dil),
374 MPPA(MPPA_KERNEL_DILATE_8)
377 {
AIPO "global_min",
"min", NULL, 0, 1, 1, 0,
384 MPPA(MPPA_KERNEL_MIN)
386 {
AIPO "global_max",
"max", NULL, 0, 1, 1, 0, {
TY_PIN, NULL, NULL },
392 MPPA(MPPA_KERNEL_MAX)
394 {
AIPO "global_min_coord",
"min!", NULL, 0, 1, 3, 0,
399 TRPX_MS(5, 3,
"GLOBAL_MIN_COORD"),
OPCL(
"MIN_COORD"),
400 SGC_WH(img_global_min_coord, minc),
401 MPPA(MPPA_KERNEL_MIN_COORDS)
403 {
AIPO "global_max_coord",
"max!", NULL, 0, 1, 3, 0,
408 TRPX_MS(5, 3,
"GLOBAL_MAX_COORD"),
OPCL(
"MAX_COORD"),
409 SGC_WH(img_global_max_coord, maxc),
410 MPPA(MPPA_KERNEL_MAX_COORDS)
412 {
AIPO "global_vol",
"vol", NULL, 0, 1, 1, 0,
418 SGC_WH(img_global_vol, vol),
419 MPPA(MPPA_KERNEL_VOL)
423 {
AIPO "convolution",
"conv", NULL, 1, 1, 0, 3,
431 { -1, -1, -1, -1, 0, 3,
false,
false,
"TERAPIX_UCODE_CONV" },
433 OPCLK(
"ADD",
"ZERO"),
434 SGC_WH(img_convole_16, conv),
435 MPPA(MPPA_KERNEL_CONVOLE_8)
438 {
AIPO "fast_correlation",
"corr", NULL, 1, 2, 0, 1,
450 #define FREIA_AIPO_API_SIZE (sizeof(*FREIA_AIPO_API)/sizeof(freia_api_t))
512 default:
return "unexpected value...";
524 shape =
"shape=none";
break;
526 shape =
"shape=box";
break;
528 shape =
"shape=trapezium,orientation=270";
break;
530 shape =
"shape=parallelogram";
break;
532 shape =
"shape=diamond";
break;
538 shape =
"shape=circle";
572 while (skip--) args =
CDR(args);
600 case 16:
return 0xffff;
648 string name =
get_var(
"pi", nparams);
665 string name =
get_var(
"pi", nparams);
680 string name =
get_var(
"po", nparams);
770 bool is_image =
false;
884 if (s==t || !s || !t)
return false;
934 if (s==t || !s || !t)
return false;
959 while (equal && p1 && p2) {
962 p1 =
CDR(p1), p2 =
CDR(p2);
1076 set global_remainings,
1079 const string function_name,
1084 pips_debug(7,
"%d statements, must come after statement %d\n",
1125 "using first statement as backup...\n");
1172 pips_debug(8,
"no aipo call found... backup plan?\n");
1247 #define E_WRITE(v) (v)
1248 #define E_READ(v) ((void*)(((_int)v)+1))
1271 const char* why =
"default", *func =
"?";
1280 written=
true, why =
"not found";
1290 written =
true, why =
"no sig";
1298 pips_debug(8,
"reference to %s is %s (%s in %s)\n",
1300 written?
"written":
"read", why, func);
1390 set image_occs_stats,
1396 image_occs_stats, image_stats, signatures };
1455 if (check)
pips_assert(
"constant convolution width", bw);
1456 if (check)
pips_assert(
"odd convolution width", ((*pw)%2)==1);
1458 if (check)
pips_assert(
"constant convolution height", bh);
1459 if (check)
pips_assert(
"odd convolution height", ((*ph)%2)==1);
1507 entity oimg1 = NULL, oimg2 = NULL;
1508 if (img1==img2)
return true;
1514 pips_debug(9,
"images: %s -> %s / %s -> %s\n",
1518 if (oimg1 && oimg1==img2)
return true;
1519 if (oimg2 && img1==oimg2)
return true;
1521 return oimg1 && oimg2 && oimg1==oimg2;
1586 set image_occurences)
1588 bool s1_seen =
false, in_sequence =
false;
1604 if (!in_sequence && s==
s1)
1605 in_sequence =
true, s1_seen =
true;
1619 else if (in_sequence &&
set_belong_p(image_occurences, s))
1666 image_stats_detailed, signatures);
1729 ls,
s1, l2, img_stats))
1740 pips_debug(7,
"substituting back %s by %s\n",
1781 pips_assert(
"at least two statements", first!=last);
1793 bool before =
false;
1825 int aipos = 0, copies = 0;
1829 if (strncmp(op,
AIPO, strlen(
AIPO))==0) aipos++;
1835 *pa = aipos, *pc = copies;
1836 return aipos+copies;
1965 *k00 = 1, *k10 = 1, *k20 = 1,
1966 *k01 = 1, *k11 = 1, *k21 = 1,
1967 *k02 = 1, *k12 = 1, *k22 = 1;
2023 k01, k11, k21, k02, k12, k22);
2032 string fn =
strdup(
cat(src_dir,
"/", func_name,
HELPER "functions.", suffix));
call make_call(entity a1, list a2)
parameter make_parameter(type a1, mode a2, dummy a3)
type copy_type(type p)
TYPE.
expression copy_expression(expression p)
EXPRESSION.
instruction make_instruction_sequence(sequence _field_)
instruction make_instruction_call(call _field_)
void free_expression(expression p)
void free_instruction(instruction p)
language make_language_c(void)
dummy make_dummy_unknown(void)
mode make_mode_value(void)
sequence make_sequence(list a)
void free_sequence(sequence p)
struct paramStruct params
struct _newgen_struct_entity_ * entity
void const char const char const int
struct _newgen_struct_statement_ * statement
statement freia_memory_management_statement(entity image, const hash_table occs, bool alloc)
void freia_switch_image_in_statement(statement s, entity old, entity img, bool write)
switch read or written image in statement if this is an AIPO call, only substitute output or input de...
string dagvtx_function_name(const dagvtx v)
string dagvtx_operation(const dagvtx v)
statement dagvtx_statement(const dagvtx v)
return statement if any, or NULL (for input nodes).
_int dagvtx_opid(const dagvtx v)
effects load_cumulated_rw_effects(statement)
#define effect_any_reference(e)
FI: cannot be used as a left hand side.
#define effect_write_p(eff)
#define effect_read_p(eff)
#define effect_scalar_p(eff) entity_scalar_p(effect_entity(eff))
bool malloc_effect_p(effect)
#define effects_effects(x)
bool get_bool_property(const string)
FC 2015-07-20: yuk, moved out to prevent an include cycle dependency include "properties....
static void clean_stats_to_image(hash_table s2i)
bool entity_freia_api_p(const entity f)
returns whether the entity is a freia API (AIPO) function.
const freia_api_t * hwac_freia_api(const char *function)
freia-utils.c
bool is_freia_dealloc(const statement s)
static string stat_nb(statement s)
bool is_freia_alloc(const statement s)
void freia_spoc_set_operation(const freia_api_t *api, _int *type, _int *id)
??? beurk: I keep the operation as two ints for code regeneration.
statement freia_copy_image(const entity source, const entity target)
static bool related_effect(statement s, struct related_ctx *ctx)
entity freia_create_helper_function(const string function_name, list lparams)
set freia_compute_output_images(entity module, statement s)
void freia_add_image_arguments(list limg, list *lparams)
prepend limg images in front of the argument list limg is consummed by the operation.
string helper_file_name(string func_name, string suffix)
return malloc'ed "foo.database/Src/%{module}_helper_functions.c" should it depend on the target?...
static bool some_related_image_effect(statement s, entity img, hash_table new_images, hash_table image_stats, bool write_only)
static void check_ref2(reference r, occs_ctx *ctx)
list freia_get_vertex_params(const dagvtx v)
static entity get_assigned_variable(const statement s)
for "ret = freia_aipo_*()": return the 'ret' variable...
list freia_extract_params(const int napi, list args, string_buffer head, string_buffer head2, hash_table params, int *nparams)
returns an allocated expression list of the parameters only (i.e.
static string get_var(string prefix, int *params)
list freia_get_params(const freia_api_t *api, list args)
get freia further parameters, skipping image ones
void hwac_kill_statement(statement s)
remove contents of statement s.
static bool check_stmt(statement s, occs_ctx *ctx)
static bool related_images_p(const entity img1, const entity img2, const hash_table new_images)
is there an effect to this image or related images in the statement?
list freia_allocate_new_images_if_needed(list ls, list images, const hash_table occs, const hash_table init, const hash_table signatures)
insert image allocation if needed, for intermediate image inserted before if an image is used only tw...
static bool lexpression_equal_p(const list l1, const list l2)
bool freia_image_variable_p(const entity var)
rather approximative?
static bool freia_extract_kernel(expression e, bool strict, intptr_t *k00, intptr_t *k10, intptr_t *k20, intptr_t *k01, intptr_t *k11, intptr_t *k21, intptr_t *k02, intptr_t *k12, intptr_t *k22)
extract values from a kernel definition return 9 values, expected to be 0/1 elsewhere....
hash_table freia_build_image_occurrences(statement s, set image_occs_stats, hash_table image_stats, const hash_table signatures)
int freia_max_pixel_value(void)
static bool is_freia_this_call(const statement s, const string fname)
void freia_close_dep_cache(void)
static bool reference_written_p(const reference r, const hash_table signatures)
tell about the image effect.
static void set_add_scalars(set s, const statement stat, const bool written)
append simple scalar entities with written/read effects to s scalars assigned to are ignored (return ...
static void oi_call_rwt(call c, set images)
void freia_migrate_statements(sequence sq, const set stats, const set before)
int freia_substitute_by_helper_call(dag d, set global_remainings, set remainings, list ls, const string function_name, list lparams, set helpers, int preceeding)
substitute those statement in ls that are in dag d and accelerated by a call to function_name(lparams...
static void oi_stmt_rwt(statement s, set images)
static bool real_freia_scalar_rw_dep(const statement s, const statement t, list *vars)
is there a simple scalar (no image) rw dependency from s to t? WW deps are ignored....
void hwac_replace_statement(statement s, call newc, bool kill)
replace statement contents with call to c, or continue if kill
bool freia_convolution_p(dagvtx v)
is it the convolution special case?
const freia_api_t * get_freia_api(int index)
bool same_constant_parameters(const dagvtx v1, const dagvtx v2)
tell whether v1 and v2 point to statements with the same parameters.
bool freia_extract_kernel_vtx(dagvtx v, bool strict, intptr_t *k00, intptr_t *k10, intptr_t *k20, intptr_t *k01, intptr_t *k11, intptr_t *k21, intptr_t *k02, intptr_t *k12, intptr_t *k22)
vertex-based version
static int reference_argument_number(const reference r, const list le)
return the argument number, starting from 1, of this reference or 0 if not found.
call freia_ok(void)
build all is well freia constant
static bool check_ref(reference r, occs_ctx *ctx)
hack to help replace use-def chains which did not work initially with C.
call freia_statement_to_call(const statement s)
return the actual function call from a statement, dealing with assign and returns....
string what_operation(const _int type)
bool freia_convolution_width_height(dagvtx v, _int *pw, _int *ph, bool check)
get width & height of convolution
void freia_insert_added_stats(list ls, list stats, bool before)
insert statements to actual code sequence in "ls" BEWARE that ls is assumed to be in reverse order....
void freia_init_dep_cache(void)
static statement image_free(entity v)
generate statement: "freia_free(v);"
bool freia_aipo_spoc_implemented(const freia_api_t *api)
whether api available with SPoC
#define TRPX_MS(m, c, op)
static bool only_minor_statements_in_between(entity image, hash_table new_images, hash_table image_stats, list ls, statement s1, list l2, set image_occurences)
tell whether there is no image processing statements between s1 and l2
static hash_table dep_cache
set freia_compute_current_output_images(void)
string what_operation_shape(const _int type)
SPoC: set shape depending on hardware component used by vertex.
static const freia_api_t FREIA_AIPO_API[]
!!! there are some underlying assumptions when using this structure: only one of ALU/POC/MES is used ...
bool freia_scalar_rw_dep(const statement s, const statement t, list *vars)
bool freia_assignment_p(const entity e)
tell whether it is an assignment to ignore?
int freia_aipo_count(dag d, int *pa, int *pc)
int hwac_freia_api_index(const string function)
returns the index of the description of an AIPO function
expression freia_get_nth_scalar_param(const dagvtx v, int n)
bool freia_aipo_terapix_implemented(const freia_api_t *api)
whether api available with Ter@pix
bool freia_statement_aipo_call_p(const statement s)
returns whether the statement is a FREIA call.
void freia_clean_image_occurrences(hash_table occs)
cleanup occurrence data structure
const freia_api_t * get_freia_api_vtx(dagvtx v)
static statement find_aipo_statement(list ls, bool before)
#define FREIA_DEFAULT_BPP
#define dagvtx_freia_api(v)
#define pstatement_statement_p(x)
#define dagvtx_content(x)
#define vtxcontent_opid(x)
#define pstatement_statement(x)
#define vtxcontent_source(x)
#define gen_context_recurse(start, ctxt, domain_number, flt, rwt)
void gen_full_free_list(list l)
statement instruction_to_statement(instruction)
Build a statement from a give instruction.
statement get_current_module_statement(void)
Get the current module statement.
entity get_current_module_entity(void)
Get the entity of the current module.
void gen_recurse_stop(void *obj)
Tells the recursion not to go in this object.
void gen_context_multi_recurse(void *o, void *context,...)
Multi-recursion with context function visitor.
gen_chunk * gen_get_ancestor(int, const void *)
return the first ancestor object found of the given type.
void gen_null2(__attribute__((unused)) void *u1, __attribute__((unused)) void *u2)
idem with 2 args, to please overpeaky compiler checks
bool gen_true2(__attribute__((unused)) gen_chunk *u1, __attribute__((unused)) void *u2)
void gen_null(__attribute__((unused)) void *unused)
Ignore the argument.
bool gen_true(__attribute__((unused)) gen_chunk *unused)
Return true and ignore the argument.
instruction make_continue_instruction()
Creates a CONTINUE instruction, that is the FORTRAN nop, the ";" in C or the "pass" in Python for exa...
list gen_nreverse(list cp)
reverse a list in place
#define NIL
The empty list (nil in Lisp)
list gen_copy_seq(list l)
Copy a list structure.
size_t gen_length(const list l)
#define CONS(_t_, _i_, _l_)
List element cell constructor (insert an element at the beginning of a list)
list gen_nconc(list cp1, list cp2)
physically concatenates CP1 and CP2 but do not duplicates the elements
#define CAR(pcons)
Get the value of the first element of a list.
void gen_free_list(list l)
free the spine of the list
list gen_last(list l)
Return the last element of a list.
bool gen_in_list_p(const void *vo, const list lx)
tell whether vo belongs to lx
#define FOREACH(_fe_CASTER, _fe_item, _fe_list)
Apply/map an instruction block on all the elements of a list.
#define CDR(pcons)
Get the list less its first element.
list gen_nthcdr(int n, const list lx)
caution: the first item is 0! was: return( (n<=0) ? l : gen_nthcdr( n-1, CDR( l ))) ; if n>gen_length...
sequence statement_sequence(statement)
Get the sequence of a statement sequence.
bool statement_call_p(statement)
bool statement_sequence_p(statement)
Statement classes induced from instruction type.
void insert_statement(statement, statement, bool)
This is the normal entry point.
hash_table hash_table_make(hash_key_type key_type, size_t size)
void * hash_get(const hash_table htp, const void *key)
this function retrieves in the hash table pointed to by htp the couple whose key is equal to key.
void hash_put(hash_table htp, const void *key, const void *val)
This functions stores a couple (key,val) in the hash table pointed to by htp.
void hash_table_free(hash_table htp)
this function deletes a hash table that is no longer useful.
bool hash_defined_p(const hash_table htp, const void *key)
true if key has e value in htp.
bool expression_constant_p(expression)
HPFC module by Fabien COELHO.
string db_get_directory_name_for_module(const char *name)
returns the allocated and mkdir'ed directory for module name
#define pips_debug
these macros use the GNU extensions that allow variadic macros, including with an empty list.
#define pips_user_warning
#define pips_assert(what, predicate)
common macros, two flavors depending on NDEBUG
#define pips_internal_error
char * i2a(int)
I2A (Integer TO Ascii) yields a string for a given Integer.
string bool_to_string(bool)
#define HASH_FOREACH(key_type, k, value_type, v, ht)
struct __hash_table * hash_table
Define hash_table structure which is hidden.
#define same_string_p(s1, s2)
bool set_empty_p(const set)
tell whether set s is empty.
set set_intersection(set, const set, const set)
list set_to_list(const set)
create a list from a set the set is not freed
list set_to_sorted_list(const set, gen_cmp_func_t)
int set_size(const set)
returns the number of items in s.
set set_difference(set, const set, const set)
#define SET_FOREACH(type_name, the_item, the_set)
enumerate set elements in their internal order.
bool set_belong_p(const set, const void *)
void set_fprint(FILE *, string, const set, gen_string_func_t)
print set s to file stream out.
set set_make(set_type)
Create an empty set of any type but hash_private.
set set_add_element(set, const set, const void *)
string(* gen_string_func_t)(const void *)
int(* gen_cmp_func_t)(const void *, const void *)
int f(int off1, int off2, int n, float r[n], float a[n], float b[n])
list lparams
Array bounds.
static const char * prefix
#define ENTITY_ASSIGN_P(e)
#define STATEMENT_NUMBER_UNDEFINED
default values
#define ENTITY_BITWISE_OR_UPDATE_P(e)
#define call_to_statement(c)
#define entity_variable_p(e)
An entity_variable_p(e) may hide a typedef and hence a functional type.
#define ENTITY_C_RETURN_P(e)
#define module_functional_parameters(func)
#define ENTITY_RETURN_P(e)
const char * entity_user_name(entity e)
Since entity_local_name may contain PIPS special characters such as prefixes (label,...
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...
int compare_entities(const entity *pe1, const entity *pe2)
Comparison function for qsort.
entity local_name_to_top_level_entity(const char *n)
This function try to find a top-level entity from a local name.
bool entity_function_p(entity e)
static int init
Maximal value set for Fortran 77.
bool entity_pointer_p(entity e)
entity make_empty_function(const char *name, type r, language l)
bool expression_integer_value(expression e, intptr_t *pval)
expression entity_to_expression(entity e)
if v is a constant, returns a constant call.
bool expression_equal_p(expression e1, expression e2)
Syntactic equality e1==e2.
bool brace_expression_p(expression e)
Return bool indicating if expression e is a brace expression.
bool expression_reference_p(expression e)
Test if an expression is a reference.
reference expression_reference(expression e)
Short cut, meaningful only if expression_reference_p(e) holds.
entity expression_variable(expression e)
entity expression_to_entity(expression e)
just returns the entity of an expression, or entity_undefined
expression call_to_expression(call c)
Build an expression that call a function or procedure.
bool entity_scalar_p(entity)
The concrete type of e is a scalar type.
type expression_to_user_type(expression)
Preserve typedef'ed types when possible.
#define functional_result(x)
#define reference_variable(x)
#define basic_typedef_p(x)
#define type_functional(x)
#define basic_pointer_p(x)
#define statement_domain
newgen_sizeofexpression_domain_defined
#define call_domain
newgen_callees_domain_defined
#define EXPRESSION(x)
EXPRESSION.
#define entity_undefined_p(x)
#define reference_domain
newgen_range_domain_defined
struct _newgen_struct_call_ * call
#define sequence_statements(x)
#define instruction_call_p(x)
#define statement_declarations(x)
#define statement_instruction(x)
#define statement_comments(x)
#define instruction_call(x)
#define call_arguments(x)
#define statement_number(x)
#define value_expression_p(x)
#define expression_syntax(x)
#define value_expression(x)
#define variable_basic(x)
#define STATEMENT(x)
STATEMENT.
#define entity_initial(x)
static int lend()
return 1 for 'end' alone on card (up to col.
internally defined structure.
FI: I do not understand why the type is duplicated at the set level.
The structure used to build lists in NewGen.
FREIA API function name -> SPoC hardware description (and others?)
unsigned int arg_misc_out
code taken from http://fast-edge.googlecode.com and adapted to c99
const hash_table signatures