added new directives

This commit is contained in:
ALEXks
2024-12-05 12:50:36 +03:00
parent 77c46121a2
commit 21acea498e
18 changed files with 8906 additions and 9031 deletions

View File

@@ -318,41 +318,42 @@
%token ACC_CUDA_BLOCK 318
%token ACC_ROUTINE 319
%token ACC_TIE 320
%token BY 321
%token IO_MODE 322
%token CP_CREATE 323
%token CP_LOAD 324
%token CP_SAVE 325
%token CP_WAIT 326
%token FILES 327
%token VARLIST 328
%token STATUS 329
%token EXITINTERVAL 330
%token TEMPLATE_CREATE 331
%token TEMPLATE_DELETE 332
%token SPF_ANALYSIS 333
%token SPF_PARALLEL 334
%token SPF_TRANSFORM 335
%token SPF_NOINLINE 336
%token SPF_PARALLEL_REG 337
%token SPF_END_PARALLEL_REG 338
%token SPF_EXPAND 339
%token SPF_FISSION 340
%token SPF_SHRINK 341
%token SPF_CHECKPOINT 342
%token SPF_EXCEPT 343
%token SPF_FILES_COUNT 344
%token SPF_INTERVAL 345
%token SPF_TIME 346
%token SPF_ITER 347
%token SPF_FLEXIBLE 348
%token SPF_APPLY_REGION 349
%token SPF_APPLY_FRAGMENT 350
%token SPF_CODE_COVERAGE 351
%token SPF_UNROLL 352
%token SPF_MERGE 353
%token SPF_COVER 354
%token SPF_PROCESS_PRIVATE 355
%token ACC_DECLARE 321
%token BY 322
%token IO_MODE 323
%token CP_CREATE 324
%token CP_LOAD 325
%token CP_SAVE 326
%token CP_WAIT 327
%token FILES 328
%token VARLIST 329
%token STATUS 330
%token EXITINTERVAL 331
%token TEMPLATE_CREATE 332
%token TEMPLATE_DELETE 333
%token SPF_ANALYSIS 334
%token SPF_PARALLEL 335
%token SPF_TRANSFORM 336
%token SPF_NOINLINE 337
%token SPF_PARALLEL_REG 338
%token SPF_END_PARALLEL_REG 339
%token SPF_EXPAND 340
%token SPF_FISSION 341
%token SPF_SHRINK 342
%token SPF_CHECKPOINT 343
%token SPF_EXCEPT 344
%token SPF_FILES_COUNT 345
%token SPF_INTERVAL 346
%token SPF_TIME 347
%token SPF_ITER 348
%token SPF_FLEXIBLE 349
%token SPF_APPLY_REGION 350
%token SPF_APPLY_FRAGMENT 351
%token SPF_CODE_COVERAGE 352
%token SPF_UNROLL 353
%token SPF_MERGE 354
%token SPF_COVER 355
%token SPF_PROCESS_PRIVATE 356
%{
#include <string.h>
@@ -624,10 +625,12 @@ static int in_vec = NO; /* set if processing array constructor */
%type <ll_node> paralleldo_clause_list paralleldo_clause
/* FORTRAN ACC */
%type <bf_node> acc_specification acc_declare
%type <bf_node> acc_directive acc_region acc_end_region acc_checksection acc_end_checksection
%type <bf_node> acc_get_actual acc_actual acc_routine
%type <ll_node> opt_clause acc_clause_list acc_clause data_clause async_clause targets_clause
%type <ll_node> acc_var_list computer_list computer opt_targets_clause
%type <ll_node> acc_var_list computer_list computer opt_routine_clauses routine_clause_list routine_clause
%type <ll_node> acc_declare_list declare_var
/* new clauses for PARALLEL directive */
%type <ll_node> private_spec cuda_block_spec sizelist
@@ -1207,6 +1210,7 @@ spec: type_dcl
| common
| dimension
| dvm_specification /* FDVM */
| acc_specification /* FDVM */
| external
| intrinsic
| equivalence
@@ -7845,13 +7849,15 @@ op_slash_0 : {
operator_slash = 0;
};
acc_specification: acc_declare
| acc_routine
;
acc_directive: acc_region
| acc_end_region
| acc_checksection
| acc_end_checksection
| acc_get_actual
| acc_actual
| acc_routine
;
acc_region: ACC_REGION end_spec opt_clause
@@ -7945,17 +7951,49 @@ acc_end_region: ACC_END_REGION
acc_end_checksection: ACC_END_CHECKSECTION
{ $$ = get_bfnd(fi,ACC_END_CHECKSECTION_DIR,SMNULL,LLNULL,LLNULL,LLNULL);}
;
acc_declare: ACC_DECLARE in_dcl opt_double_colon acc_declare_list
{
$$ = get_bfnd(fi,ACC_DECLARE_DIR, SMNULL, $4, LLNULL, LLNULL);
}
;
acc_declare_list: declare_var
{ $$ = make_llnd(fi,EXPR_LIST, $1, LLNULL, SMNULL); }
| acc_declare_list COMMA declare_var
{ $$ = set_ll_list($1, $3, EXPR_LIST); }
;
declare_var: name
{
PTR_SYMB s;
s = make_scalar($1,TYNULL,LOCAL);
if((s->attr & PROCESSORS_BIT) ||(s->attr & TASK_BIT) || (s->attr & TEMPLATE_BIT) || (s->attr & ALIGN_BIT) || (s->attr & DISTRIBUTE_BIT) || (s->attr & DYNAMIC_BIT) || (s->attr & HEAP_BIT)|| (s->attr & DVM_POINTER_BIT) || (s->attr & INHERIT_BIT) ||(s->attr & SHADOW_BIT))
errstr("Inconsistent declaration of identifier %s", s->ident, 16);
$$ = make_llnd(fi,VAR_REF, LLNULL, LLNULL, s);
}
;
acc_routine: ACC_ROUTINE in_dcl opt_targets_clause
acc_routine: ACC_ROUTINE in_dcl opt_routine_clauses
{ $$ = get_bfnd(fi,ACC_ROUTINE_DIR,SMNULL,$3,LLNULL,LLNULL);}
;
opt_targets_clause: needkeyword keywordoff
{ $$ = LLNULL; }
| needkeyword targets_clause
{ $$ = $2;}
;
opt_routine_clauses:
{ $$ = LLNULL;}
| routine_clause_list
{ $$ = $1;}
;
routine_clause_list: routine_clause
{ $$ = set_ll_list($1,LLNULL,EXPR_LIST); }
| routine_clause_list routine_clause
{ $$ = set_ll_list($1,$2,EXPR_LIST); }
;
routine_clause: COMMA needkeyword PRIVATE LEFTPAR acc_declare_list RIGHTPAR
{ $$ = make_llnd(fi,ACC_PRIVATE_OP,$5,LLNULL,SMNULL);}
| COMMA needkeyword targets_clause
{ $$ = $3;}
;
spf_directive: spf_analysis
| spf_parallel
| spf_transform