diff options
| author | Richard Brooksby | 2012-09-06 18:12:30 +0100 |
|---|---|---|
| committer | Richard Brooksby | 2012-09-06 18:12:30 +0100 |
| commit | e17fee98ea221678f40bae915dd32c91ccc71922 (patch) | |
| tree | 964d34004bb6afc562ccf0904d5f29adc76090cc /mps/code | |
| parent | 1ff35a0168344a1640359938656c91a277f5d118 (diff) | |
| download | emacs-e17fee98ea221678f40bae915dd32c91ccc71922.tar.gz emacs-e17fee98ea221678f40bae915dd32c91ccc71922.zip | |
Renaming duplicate mps_word_* macros in fmtdy.c so that it can be concatenated with mps.c for open dylan.
Copied from Perforce
Change: 179314
ServerID: perforce.ravenbrook.com
Diffstat (limited to 'mps/code')
| -rw-r--r-- | mps/code/fmtdy.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/mps/code/fmtdy.c b/mps/code/fmtdy.c index 21d47080d8e..f622bfe128c 100644 --- a/mps/code/fmtdy.c +++ b/mps/code/fmtdy.c | |||
| @@ -78,9 +78,9 @@ | |||
| 78 | 78 | ||
| 79 | #define ALIGN sizeof(mps_word_t) | 79 | #define ALIGN sizeof(mps_word_t) |
| 80 | 80 | ||
| 81 | #define MPS_WORD_WIDTH (sizeof(mps_word_t) * CHAR_BIT) | 81 | #define FMTDY_WORD_WIDTH (sizeof(mps_word_t) * CHAR_BIT) |
| 82 | #define MPS_WORD_SHIFT (MPS_WORD_WIDTH == 64 ? 6 : 5) | 82 | #define FMTDY_WORD_SHIFT (FMTDY_WORD_WIDTH == 64 ? 6 : 5) |
| 83 | /* MPS_WORD_SHIFT is a bit hacky, but good enough for tests. */ | 83 | /* FMTDY_WORD_SHIFT is a bit hacky, but good enough for tests. */ |
| 84 | 84 | ||
| 85 | #ifdef FMTDY_COUNTING | 85 | #ifdef FMTDY_COUNTING |
| 86 | #define FMTDY_COUNT(x) x | 86 | #define FMTDY_COUNT(x) x |
| @@ -124,7 +124,7 @@ int dylan_wrapper_check(mps_word_t *w) | |||
| 124 | assert(ww[WF] == (((WS - 1) << 2) | 2)); /* fields with patterns */ | 124 | assert(ww[WF] == (((WS - 1) << 2) | 2)); /* fields with patterns */ |
| 125 | assert((ww[WV] & 0x00ffffff) == 0);/* non-traceable vector */ | 125 | assert((ww[WV] & 0x00ffffff) == 0);/* non-traceable vector */ |
| 126 | /* Code in this file only works for version 2 */ | 126 | /* Code in this file only works for version 2 */ |
| 127 | assert(((ww[WV] >> (MPS_WORD_WIDTH - 8)) & 0xff) == 2); | 127 | assert(((ww[WV] >> (FMTDY_WORD_WIDTH - 8)) & 0xff) == 2); |
| 128 | assert(ww[WS] == ((1 << 2) | 1)); /* one pattern word in wrapper wrapper */ | 128 | assert(ww[WS] == ((1 << 2) | 1)); /* one pattern word in wrapper wrapper */ |
| 129 | /* The first field is traceable, the second field can be traced, */ | 129 | /* The first field is traceable, the second field can be traced, */ |
| 130 | /* but doesn't need to be. */ | 130 | /* but doesn't need to be. */ |
| @@ -139,7 +139,7 @@ int dylan_wrapper_check(mps_word_t *w) | |||
| 139 | fl = fh >> 2; /* fixed part length */ | 139 | fl = fh >> 2; /* fixed part length */ |
| 140 | ff = fh & 3; /* fixed part format code */ | 140 | ff = fh & 3; /* fixed part format code */ |
| 141 | vh = w[WV]; /* variable part header */ | 141 | vh = w[WV]; /* variable part header */ |
| 142 | version = (vh >> (MPS_WORD_WIDTH - 8)) & 0xff; | 142 | version = (vh >> (FMTDY_WORD_WIDTH - 8)) & 0xff; |
| 143 | assert(version == 2); /* Code in this file only works for version 2 */ | 143 | assert(version == 2); /* Code in this file only works for version 2 */ |
| 144 | unused(version); | 144 | unused(version); |
| 145 | reserved = (vh >> 8) & 0xff; | 145 | reserved = (vh >> 8) & 0xff; |
| @@ -197,12 +197,12 @@ int dylan_wrapper_check(mps_word_t *w) | |||
| 197 | assert(ff == 2 || t == 0); | 197 | assert(ff == 2 || t == 0); |
| 198 | 198 | ||
| 199 | /* The number of patterns is (fixed fields+31)/32. */ | 199 | /* The number of patterns is (fixed fields+31)/32. */ |
| 200 | assert(ff != 2 || t == ((fl + MPS_WORD_WIDTH - 1) / MPS_WORD_WIDTH)); | 200 | assert(ff != 2 || t == ((fl + FMTDY_WORD_WIDTH - 1) / FMTDY_WORD_WIDTH)); |
| 201 | 201 | ||
| 202 | /* The patterns are random bits, so we can't check them. However, */ | 202 | /* The patterns are random bits, so we can't check them. However, */ |
| 203 | /* the left-over bits in the last pattern should be zero. */ | 203 | /* the left-over bits in the last pattern should be zero. */ |
| 204 | 204 | ||
| 205 | assert(ff != 2 || (w[WS+t] >> ((fh>>2) & (MPS_WORD_WIDTH-1))) == 0); | 205 | assert(ff != 2 || (w[WS+t] >> ((fh>>2) & (FMTDY_WORD_WIDTH-1))) == 0); |
| 206 | 206 | ||
| 207 | return 1; | 207 | return 1; |
| 208 | } | 208 | } |
| @@ -339,7 +339,7 @@ static mps_res_t dylan_scan_pat(mps_ss_t mps_ss, | |||
| 339 | MPS_SCAN_BEGIN(mps_ss) { | 339 | MPS_SCAN_BEGIN(mps_ss) { |
| 340 | p = base; | 340 | p = base; |
| 341 | goto in; | 341 | goto in; |
| 342 | pat: p += MPS_WORD_WIDTH; | 342 | pat: p += FMTDY_WORD_WIDTH; |
| 343 | if(p >= limit) goto out; | 343 | if(p >= limit) goto out; |
| 344 | in: pp = p; | 344 | in: pp = p; |
| 345 | pat = *pc++; | 345 | pat = *pc++; |
| @@ -355,7 +355,7 @@ static mps_res_t dylan_scan_pat(mps_ss_t mps_ss, | |||
| 355 | res = MPS_FIX2(mps_ss, pp-1); | 355 | res = MPS_FIX2(mps_ss, pp-1); |
| 356 | if(res == MPS_RES_OK) goto loop; | 356 | if(res == MPS_RES_OK) goto loop; |
| 357 | return res; | 357 | return res; |
| 358 | out: assert(p < limit + MPS_WORD_WIDTH); | 358 | out: assert(p < limit + FMTDY_WORD_WIDTH); |
| 359 | assert(pc == pats + nr_pats); | 359 | assert(pc == pats + nr_pats); |
| 360 | } MPS_SCAN_END(mps_ss); | 360 | } MPS_SCAN_END(mps_ss); |
| 361 | 361 | ||
| @@ -364,10 +364,10 @@ static mps_res_t dylan_scan_pat(mps_ss_t mps_ss, | |||
| 364 | 364 | ||
| 365 | 365 | ||
| 366 | #define NONWORD_LENGTH(_vt, _es) \ | 366 | #define NONWORD_LENGTH(_vt, _es) \ |
| 367 | ((_es) < MPS_WORD_SHIFT ? \ | 367 | ((_es) < FMTDY_WORD_SHIFT ? \ |
| 368 | ((_vt) + ((mps_word_t)1 << (MPS_WORD_SHIFT - (_es))) - 1) >> \ | 368 | ((_vt) + ((mps_word_t)1 << (FMTDY_WORD_SHIFT - (_es))) - 1) >> \ |
| 369 | (MPS_WORD_SHIFT - (_es)) : \ | 369 | (FMTDY_WORD_SHIFT - (_es)) : \ |
| 370 | (_vt) << ((_es) - MPS_WORD_SHIFT)) | 370 | (_vt) << ((_es) - FMTDY_WORD_SHIFT)) |
| 371 | 371 | ||
| 372 | 372 | ||
| 373 | extern mps_res_t dylan_scan1(mps_ss_t mps_ss, mps_addr_t *object_io) | 373 | extern mps_res_t dylan_scan1(mps_ss_t mps_ss, mps_addr_t *object_io) |