By: Travis Downs (travis.downs.delete@this.gmail.com), September 19, 2018 6:09 pm
Room: Moderated Discussions
anon (spam.delete.delete@this.this.spam.com) on September 19, 2018 2:42 am wrote:
> Or the displacement vs page crossing statistics are vastly different depending on the source.
Maybe? Kind of hard to see how though.
Displacements are definitely used differently for pointer chasing versus say unrolled linear access of an array (where the address is certain to come from an ALU op) or memcpy. I would expect node based structures to have many small offsets, usually the same offset, while unrolled linear code has a range of offsets which may be big for big unrolls. Hard to imagine it affecting page crossing much There is a small effect to object alignment: e.g., heap objects which are likely targets of pointer chasing might be 16B or 32B aligned always, which reduces the chance of heap crossing a bit - sometimes to zero for small offsets like 8 - but this effect is very weak.
Even if displacement distribution is wildly different, however, it's hard to see how you get different page crossing stats at a given displacement. You'd have to have the memory allocators or stack layout or something in on the game.
> Have you tested disp8 vs disp32 for ALU sources?
The test I used has no displacement, so is about the best case for no page crossing (impossible unless you are accessing something misaligned).
> Or the displacement vs page crossing statistics are vastly different depending on the source.
Maybe? Kind of hard to see how though.
Displacements are definitely used differently for pointer chasing versus say unrolled linear access of an array (where the address is certain to come from an ALU op) or memcpy. I would expect node based structures to have many small offsets, usually the same offset, while unrolled linear code has a range of offsets which may be big for big unrolls. Hard to imagine it affecting page crossing much There is a small effect to object alignment: e.g., heap objects which are likely targets of pointer chasing might be 16B or 32B aligned always, which reduces the chance of heap crossing a bit - sometimes to zero for small offsets like 8 - but this effect is very weak.
Even if displacement distribution is wildly different, however, it's hard to see how you get different page crossing stats at a given displacement. You'd have to have the memory allocators or stack layout or something in on the game.
> Have you tested disp8 vs disp32 for ALU sources?
The test I used has no displacement, so is about the best case for no page crossing (impossible unless you are accessing something misaligned).