|
|
|
|
|
by oivaksef
2345 days ago
|
|
Why don't we have two sets of memory - the main, slow, cached memory, and a smaller set of super fast low latency memory, like cache, but that the programmer and compiler can use explicitly? Sort of like special purpose performance instructions like SIMD but on the memory side |
|
The Cell from Sony did have explicit cache control (I think) and it was notoriously difficult to program for.
The real reason cache isn't handled explicitly though is because it isn't necessary. Getting good performance and cache usage can be done at the C++ level, you just have to know how the CPU works and access memory linearly so it can be prefetched. I've tried to use prefetch instructions and beating the out of order buffer in the CPU is actually very difficult.