Changes between Version 99 and Version 100 of IR
- Timestamp:
- 11/30/15 09:45:16 (10 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
IR
v99 v100 18 18 * angular brackets are used to delimit tuples or sequences 19 19 * square brackets are used to delimit parameters in types 20 * unlike C, there is no "array-pointer pun". If an array `a` needs to be converted to a pointer, you must use addr(asub(a, 0))`.20 * unlike C, there is no "array-pointer pun". If an array `a` needs to be converted to a pointer, you must use `addr(asub(a, 0))`. 21 21 * there are no automatic conversions. All conversions must be by explicit casts or other functions. Operations such as numeric addition (`add`) require that both operands have the exact same type. 22 22 * in general, symbols can be used before they are defined, as long as they are in scope. For example, a function `f` can call `g`, even if `g` is defined after `f` in the same scope. There is no need for a "prototype". Similarly, a type definition can refer to a type defined later, or can refer to itself in its own definition. … … 312 312 * `SPAWN f, <e1,...,en>;` and `SPAWN e, f, <e1,...,en>;` 313 313 * `WAIT e;` 314 * `WAITALL e, n;` where `e` is a pointer to a process reference and `n` is the number of processes to be waited for 314 * `WAITALL e, n;` : wait on all procs in a list 315 * `e` has type `Pointer[Proc]` and `n` has an integral type, the number of procs in the list 315 316 * `ALLOCATE e, h, t, e0;` 316 317 * `e` has static type `Pointer[T]`, for some static type `T` … … 318 319 * `t` has type `Dytype[T]`, for the same static type `T` 319 320 * `e0` has an integral type. 320 * Allocates `e0` objects of type `t` on heap `h`, returning pointer to first element in `e`. **WOULD IT BE BETTER TO SPECIFY THE SCOPE?** 321 * Allocates `e0` objects of type `t` on heap `h`, returning pointer to first element in `e`. 322 * **WOULD IT BE BETTER TO SPECIFY THE SCOPE?** 321 323 * 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))`. 322 324 * `FREE p;` 323 * `EVAL e;`, where `e` is an expression that might contain exceptions (e.g., array index out of bound, division by zero); 325 * `EVAL e;` : evaluates an expression `e` 326 * useful only because `e` might contain exceptions (e.g., array index out of bound, division by zero) 324 327 * `NOOP;` 325 328 * **Is there a need to add annotations for "true" or "false" branch, etc.?** If so, we can just make these parameters to the Noop. … … 328 331 * `ATOMIC_EXIT;` 329 332 * `PARSPAWN p, d, f;` where `p` is pointer to process reference, `d` has `Domain` type and `f` has `Function` type. 330 * `NEXT dom, <i,j,…>;` : domain iterator: updates `i`,`j`,... to be the value of the next tuple in `dom` after `<i,j,...>` 331 * `FOR_ENTER dom;` **FIX ME** 333 * `NEXT dom, <i,j,…>;` : move to next element in domain 334 * updates `i`,`j`,... to be the value of the next tuple in `dom` after `<i,j,...>` 335 * `FOR_ENTER dom;` 336 * **FIX ME** 332 337 333 338 == Function Definitions ==
