Changes between Version 22 and Version 23 of IR2


Ignore:
Timestamp:
04/26/21 15:46:00 (5 years ago)
Author:
siegel
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • IR2

    v22 v23  
    8787  | (lvalue '=')? '$spawn' expr '(' arg-list? ')' ';'  /* process creation */
    8888  | 'return' expr? ';'  /* return from function call */
    89   | '$parspawn' expr ',' expr ',' expr ';'
    90   | (lvalue '=')? '$malloc' '(' expr ',' expr ',' type-name ')' ';'
    91  
     89  | '$parspawn' expr ',' expr ',' expr ';'  /* parallel spawn */
     90  | (lvalue '=')? '$alloc' expr ',' expr ',' type-name ';'  /* heap allocation */
     91arg-list: expr (',' expr)* ;  /* actual argument list */
     92
    9293}}}
     94
     95Notes
     96* For function calls and spawns, the first expression shall have type pointer-to-function-....  The function pointed to will be the one called or spawned.
     97* The 3 expressions in a `$parspawn` are (1) pointer to the first element of the process array, an expression of type `$proc*`, (2) an expression of type `$domain`, and (3) an expression of type pointer-to-function-....  The function must have the type that consumes n `$int`s, where n is the dimension of the domain, and returns `void`.   The function is spawned once for each element of the domain.  References to the new processes are stored in the process array. 
     98* The first expression following `$alloc` has type `$heap*`.  It is a pointer to the heap that will be modified by allocating the new memory.  The second expression has type `$int` and is the number of elements being allocated.    This is followed by the element type.    The function returns a pointer to the first element of an array, similar to C's malloc.    It is deallocated using function`$free`.
    9399
    94100Built-in functions:
     
    98104void $wait( $proc p );  /* wait until p terminates */
    99105void $waitall( $int nprocs, $proc * procs );  /* wait for all procs in list to terminate */
    100 void $free( void * ptr );  /* frees something that was $malloc-ed */
     106void $free( void * ptr );  /* frees something that was $alloc-ed */
    101107
    102108}}}