Made intrinsic PROCs take the workspace as a parameter, and turned . to _ in their names (and implemented the RESIZE.MOBILE.ARRAY.1D intrinsic)
This commit is contained in:
parent
5f9d0c6429
commit
fae0d6d6a2
|
@ -1944,7 +1944,7 @@ cgenIntrinsicProc :: Meta -> String -> [A.Actual] -> CGen ()
|
|||
cgenIntrinsicProc m "ASSERT" [A.ActualExpression e] = call genAssert m e
|
||||
cgenIntrinsicProc _ "RESCHEDULE" [] = call genReschedule
|
||||
cgenIntrinsicProc m s as = case lookup s intrinsicProcs of
|
||||
Just amtns -> do tell ["occam_", s, "("]
|
||||
Just amtns -> do tell ["occam_", [if c == '.' then '_' else c | c <- s], "(wptr,"]
|
||||
seqComma [call genActual (A.Formal am t (A.Name emptyMeta n)) a
|
||||
| ((am, t, n), a) <- zip amtns as]
|
||||
tell [");"]
|
||||
|
|
|
@ -303,14 +303,14 @@ static inline int occam_check_retype (int src, int dest, const char *pos) {
|
|||
}
|
||||
|
||||
#define MAKE_STRINGTO(type, occname, flag) \
|
||||
static inline void occam_STRINGTO##occname(BOOL*, type*, const unsigned char*) occam_unused; \
|
||||
static inline void occam_STRINGTO##occname(BOOL* error, type* n, const unsigned char* string) { \
|
||||
static inline void occam_STRINGTO##occname(Workspace, BOOL*, type*, const unsigned char*) occam_unused; \
|
||||
static inline void occam_STRINGTO##occname(Workspace wptr, BOOL* error, type* n, const unsigned char* string) { \
|
||||
*error = 1 != sscanf((const char*)string, flag, n); \
|
||||
}
|
||||
|
||||
#define MAKE_STRINGTO_SMALL(type, occname, flag) \
|
||||
static inline void occam_STRINGTO##occname(BOOL*, type*, const unsigned char*) occam_unused; \
|
||||
static inline void occam_STRINGTO##occname(BOOL* error, type* n, const unsigned char* string) { \
|
||||
static inline void occam_STRINGTO##occname(Workspace, BOOL*, type*, const unsigned char*) occam_unused; \
|
||||
static inline void occam_STRINGTO##occname(Workspace wptr, BOOL* error, type* n, const unsigned char* string) { \
|
||||
int t; \
|
||||
*error = 1 != sscanf((const char*)string, flag, &t) || (int)(type)t != t; \
|
||||
*n = (type)t; \
|
||||
|
@ -322,8 +322,8 @@ static inline int occam_check_retype (int src, int dest, const char *pos) {
|
|||
#define MAKE_STRINGTO_32 MAKE_STRINGTO
|
||||
#define MAKE_STRINGTO_64 MAKE_STRINGTO
|
||||
|
||||
static inline void occam_BOOLTOSTRING(INT*, unsigned char*, const BOOL) occam_unused;
|
||||
static inline void occam_BOOLTOSTRING(INT* len, unsigned char* str, const BOOL b) {
|
||||
static inline void occam_BOOLTOSTRING(Workspace, INT*, unsigned char*, const BOOL) occam_unused;
|
||||
static inline void occam_BOOLTOSTRING(Workspace wptr, INT* len, unsigned char* str, const BOOL b) {
|
||||
if (b) {
|
||||
memcpy(str,"TRUE",4*sizeof(char));
|
||||
*len = 4;
|
||||
|
@ -333,8 +333,8 @@ static inline void occam_BOOLTOSTRING(INT* len, unsigned char* str, const BOOL b
|
|||
}
|
||||
}
|
||||
|
||||
static inline void occam_STRINGTOBOOL(BOOL*, BOOL*, const unsigned char*) occam_unused;
|
||||
static inline void occam_STRINGTOBOOL(BOOL* error, BOOL* b, const unsigned char* str) {
|
||||
static inline void occam_STRINGTOBOOL(Workspace, BOOL*, BOOL*, const unsigned char*) occam_unused;
|
||||
static inline void occam_STRINGTOBOOL(Workspace wptr, BOOL* error, BOOL* b, const unsigned char* str) {
|
||||
if (memcmp("TRUE", str, 4*sizeof(char)) == 0) {
|
||||
*b = true;
|
||||
*error = false;
|
||||
|
|
|
@ -49,6 +49,15 @@ static inline void tock_init_chan_array (Channel *pointTo, Channel **pointFrom,
|
|||
}
|
||||
//}}}
|
||||
|
||||
//{{{ mobile intrinsics
|
||||
static inline void occam_RESIZE_MOBILE_ARRAY_1D (Workspace wptr, mt_array_t ** pptr, const int count) occam_unused;
|
||||
static inline void occam_RESIZE_MOBILE_ARRAY_1D (Workspace wptr, mt_array_t ** pptr, const int count) {
|
||||
*pptr = MTResize1D (wptr, *pptr, count);
|
||||
(*pptr)->dimensions[0] = count;
|
||||
}
|
||||
|
||||
//}}}
|
||||
|
||||
//{{{ top-level process interface
|
||||
static void tock_tlp_input_bcall (FILE *in, int *ch) occam_unused;
|
||||
static void tock_tlp_input_bcall (FILE *in, int *ch) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user