logoalt Hacker News

greybcgtoday at 9:00 AM1 replyview on HN

There are cache control instructions already. The reason why it goes no further than prefetch/invalidate hints is probably because exposing a fuller api on the chip level to control the cache would overcomplicate designs, not be backwards compatible/stable api. Treating the cache as ram would also require a controller, which then also needs to receive instructions, or the cpu has to suddenly manage the cache itself.

I can understand why they just decide to bake the cache algorithms into hardware, validate it and be done with it. Id love if a hardware engineer or more well-read fellow could chime in.


Replies

Someonetoday at 9:43 AM

Another reason for doing cache algorithms in hardware is that cache access (especially for level 1 caches) has to be low latency to be useful.