Hacker News new | past | comments | ask | show | jobs | submit login

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.



> 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".


Hell, with non-maskable interrupts, any instruction can cause a trap!


Not 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.


Managing 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.


Coherency is very hard but it's not what causes traps from accessing memory. That part is a relatively simple permission check.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: