Changes between Version 63 and Version 64 of IR


Ignore:
Timestamp:
11/25/15 21:22:47 (10 years ago)
Author:
siegel
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • IR

    v63 v64  
    189189 * `\padd(e1, e2)`: pointer addition. `e1` has pointer type and `e2` has an integer type or range type.  If `e2` has integer type the result has pointer type.   Otherwise, the result has `Mem` type.
    190190 * `\psub(e1,e2)`: pointer subtraction
    191  * `\region(ptr)`, where `ptr` is an expression with a pointer type.  This represents the set of all memory units reachable from `ptr`, including the memory unit pointed to by `ptr` itself.
    192  * `\munion(mem1, mem2)`, where `mem1` and `mem2` are expressions of type `Memory`.  This is the union of the two memory sets.
    193  * `\misect(mem1, mem1)` : set intersection
    194  * `\mcomp(mem1)` : set complement (everything not in `mem1`)
    195  * `\aslice(a, dom)`, where `a` is an expression of array type and `dom` is an expression of `Domain` type.   The dimension of the array must match the dimension of the domain.   This represents all memory units which are the cells in the array indexed by a tuple in `dom`.
     191 * `\mem_reach(ptr)`, where `ptr` is an expression with a pointer type.  This represents the set of all memory units reachable from `ptr`, including the memory unit pointed to by `ptr` itself.
     192 * `\mem_union(mem1, mem2)`, where `mem1` and `mem2` are expressions of type `Memory`.  This is the union of the two memory sets.
     193 * `\mem_isect(mem1, mem1)` : set intersection
     194 * `\mem_comp(mem1)` : set complement (everything not in `mem1`)
     195 * `\mem_slice(a, dom)`, where `a` is an expression of array type and `dom` is an expression of `Domain` type.   The dimension of the array must match the dimension of the domain.   This represents all memory units which are the cells in the array indexed by a tuple in `dom`.
    196196* Scopes and Processes
    197197 * `\root`, `\here` : values of type `Scope`
     
    215215== The Primitive Statements ==
    216216
    217 * Assign:  `assign e1,e2;`
    218 * Call: `call f, <e1,...,en>;` and `\call e, f, <e1,...,en>;`
     217* `ASSERT e, "msg", ...;` : assertion with message
     218* `ASSUME e;`
     219* `ASSIGN e1,e2;`
     220* `CALL f, <e1,...,en>;` and `CALL e, f, <e1,...,en>;`
    219221 * call to a function which is not abstract and is not a pure system function
    220 * Spawn: `\spawn f, (e1,...,en);` and `\spawn e, f, (e1,...,en);`
    221 * Wait: `\wait e;`
    222 * Wailtall: `\waitall e, n` where `e` is a pointer to a process reference and `n` is the number of processes to be waited for
    223 * Allocation
    224  * `\allocate e, h, t, e0;`, where
    225   * `e` has type `Pointer`
    226   * `h` has type `Heap`
    227   * `t` has type `Dytype`
    228   * `e0` has integer type.
    229  * Allocates `e0` objects of type `t` on heap `h`
    230  * To translate the C `malloc` you first need to figure out the type of the elements being malloced.  If the argument to malloc is `n`, then you first need to insert an assertion `\eq(\mod(n, \sizeof_type(t)), 0)`, and then `\allocate e, h, t, \div(n, \sizeof_type(t))`.
    231 * Free: `\free p;`
    232 * Expression statement: `e;`, where `e` is side effect free except that it might contain error/exception (e.g., array index out of bound, division by zero);
    233 * Noop: `;`
     222* `SPAWN f, <e1,...,en>;` and `SPAWN e, f, <e1,...,en>;`
     223* `WAIT e;`
     224* `WAITALL e, n;` where `e` is a pointer to a process reference and `n` is the number of processes to be waited for
     225* `ALLOCATE e, h, t, e0;`
     226 * `e` has type `Pointer`
     227 * `h` has type `Heap`
     228 * `t` has type `Dytype`
     229 * `e0` has integer type.
     230 * Allocates `e0` objects of type `t` on heap `h`, returning pointer to first element in `e`
     231 * To translate the C `malloc` you first need to figure out the type of the elements being malloced.  If the argument to malloc is `n`, then you first need to insert an assertion `\eq(\mod(n, \sizeof_type(t)), 0)`, and then `ALLOCATE e, h, t, \div(n, \sizeof_type(t))`.
     232* `FREE p;`
     233* `EVAL e;`, where `e` is an expression that might contain exceptions (e.g., array index out of bound, division by zero);
     234* `NOOP;`
    234235 * **Is there a need to add annotations for "true" or "false" branch, etc.?**  If so, we can just make these parameters to the Noop.
    235 * Return: `\return;` and `\return e;`
    236 * Atomic_enter: `\atomic_enter;`
    237 * Atomic_exit: `\atomic_exit;`
    238 * Parfor_spawn: `\parspawn p, d, f;` where `p` is pointer to process reference, `d` has `Domain` type and `f` has `Function` type.
    239 * Domain iterator: `\next dom, <i,j,…>` updates `i`, `j`, ... to be the value of the inter tuple in `dom` after `<i, j, ...>`
    240 * For_dom_enter (for domains): `\for_enter dom;`
     236* `RETURN;` and `RETURN e;`
     237* `ATOMIC_ENTER;`
     238* `ATOMIC_EXIT;`
     239* `PARSPAWN p, d, f;` where `p` is pointer to process reference, `d` has `Domain` type and `f` has `Function` type.
     240* `NEXT dom, <i,j,…>;` : domain iterator: updates `i`, `j`, ... to be the value of the inter tuple in `dom` after `<i, j, ...>`
     241* `FOR_ENTER dom;` **FIX ME**
    241242
    242243== Declarations and Function Definitions ==