Andreas Klebinger pushed to branch wip/andreask/interpreter_primops at Glasgow Haskell Compiler / GHC
Commits:
- 
69ac44b9
by Andreas Klebinger at 2025-04-17T13:26:53+02:00
1 changed file:
Changes:
| ... | ... | @@ -199,11 +199,11 @@ See also Note [Width of parameters] for some more motivation. | 
| 199 | 199 |      (RTS_LIKELY(((StgWord*) Sp_plusW(n)) < ((s)->stack + (s)->stack_size - sizeofW(StgUnderflowFrame))))
 | 
| 200 | 200 | |
| 201 | 201 | |
| 202 | -#define WDS_TO_W64(n) (n * sizeof(StgWord64) / sizeof(StgWord))
 | |
| 202 | +#define W64S_TO_WDS(n) ((n) * sizeof(StgWord64) / sizeof(StgWord))
 | |
| 203 | 203 | |
| 204 | 204 |  // Always safe to use - Return the value at the address
 | 
| 205 | 205 |  #define ReadSpW(n)       (*((StgWord*)   SafeSpWP(n)))
 | 
| 206 | -#define ReadSpW64(n)     (*((StgWord64*) SafeSpWP(WDS_TO_W64(n))))
 | |
| 206 | +#define ReadSpW64(n)     (*((StgWord64*) SafeSpWP(W64S_TO_WDS(n))))
 | |
| 207 | 207 |  // Perhaps confusingly this still reads a full word, merely the offset is in bytes.
 | 
| 208 | 208 |  #define ReadSpB(n)       (*((StgWord*)   SafeSpBP(n)))
 | 
| 209 | 209 | |
| ... | ... | @@ -249,9 +249,9 @@ See ticket #25750 | 
| 249 | 249 |  #define SafeSpWP(n)      \
 | 
| 250 | 250 |    ((StgWord*) ((WITHIN_CAP_CHUNK_BOUNDS_W(n)) ? Sp_plusW(n) : slow_spw(Sp, cap->r.rCurrentTSO->stackobj, n)))
 | 
| 251 | 251 |  #define SafeSpBP(off_w)      \
 | 
| 252 | -  ( (StgWord*) (WITHIN_CAP_CHUNK_BOUNDS_W((1+(off_w))/sizeof(StgWord))) ? \
 | |
| 252 | +  ( (StgWord*) ((WITHIN_CAP_CHUNK_BOUNDS_W((1+(off_w))/sizeof(StgWord))) ? \
 | |
| 253 | 253 |          Sp_plusB(off_w) : \
 | 
| 254 | -        (StgWord*) ((ptrdiff_t)((off_w) % sizeof(StgWord)) + (StgWord8*)slow_spw(Sp, cap->r.rCurrentTSO->stackobj, (off_w)/sizeof(StgWord))))
 | |
| 254 | +        (StgWord*) ((ptrdiff_t)((off_w) % sizeof(StgWord)) + (StgWord8*)slow_spw(Sp, cap->r.rCurrentTSO->stackobj, (off_w)/sizeof(StgWord)))))
 | |
| 255 | 255 | |
| 256 | 256 | |
| 257 | 257 |