3 ms·
It doesn't trap because trapping means you need to track the possibility of a branch at every single arithmetic operation. It doesn't have a flag so flag renami
by wbl 3y ago
It doesn't trap because trapping means you need to track the possibility of a branch at every single arithmetic operation. It doesn't have a flag so flag renaming isn't needed: you can get the overflow from a CMP instruction and macroop fusion should just work.
- codedokode 3y ago> you need to track the possibility of a branch at every single arithmetic operation Every memory access can cause a trap, but CPUs seem to have no problem about it. The branch is very unlikely and can always be predicted as "not taken".
- twbarr 3y agoHell, with non-maskable interrupts, any instruction can cause a trap!
- meithecatte 3y agoNot even that - instruction fetch can cause a page fault. When an NMI happens,the CPU still has the choice of when to service it. If it needs to flush the pipeline, it might as well retire the instructions up to the first store.
- hajile 3y agoManaging memory coherency is probably the single hardest part to design in any given CPU. Why add even more hard things (especially if they can interact and add even more complexity on top)? Get rid of what complexity you can then deal with the rest that you must have.
- Dylan16807 3y agoCoherency is very hard but it's not what causes traps from accessing memory. That part is a relatively simple permission check.