4 ms·
I wasn't suggesting determining whether the values were pointers or not. The number itself suggests whether it can be stored with less bits. If the occurrence o
by gnode 8y ago
I wasn't suggesting determining whether the values were pointers or not. The number itself suggests whether it can be stored with less bits. If the occurrence of such numbers were relatively high, then this becomes a sensible tradeoff.
In set associative caches, one or more of the "ways" in each index could be optimised for these relatively common small numbers, with fewer bits given to it, capable of only storing numbers of the small form.
- pedrocr 8y ago> In set associative caches, one or more of the "ways" in each index could be optimised for these relatively common small numbers, with fewer bits given to it, capable of only storing numbers of the small form. But these aren't caches of 64bit numbers where that optimization would apply. These are caches of 4kb pages of bytes. And since this is x86 I don't think it's even guaranteed that pointers are 64bit aligned. Maybe for the TLB cache an optimization like that would be useful?
- gnode 8y ago> These are caches of 4kb pages of bytes. This isn't true. x86_64 CPUs use 64-bit cache lines, in associative sets. They don't have any caches which contain entire pages. The TLB stores the mappings for whole pages, if that's what you're thinking about?
- pedrocr 8y ago4kb was indeed too large but it's not 64bit either. They're 64byte cache lines, so the same applies.