Status registers...
Just like the "GOTO considered harmful", status registers have been considered "impure" by the RISC church.
I would say : do what you can to avoid them. They can create a lot of problems. But there are times when you can't avoid them and trying to be too smart will backfire.
To be listed :
- the countless ways status bits (like zero flag, carry flag etc.) will harm your architecture (the RISC credo)
- how RISC manages to avoid them
- how status bits are still present in many RISC architecture... under another name...
- why they can't be avoided in microcontrollers
- how to not implement them
- what to not put in a status register
- ...
As a rule of thumb : status flags start to hurt when the core gets pipelined or superscalar. They can keep performance from increasing and force enhanced cores to jump through OoO hoops. So if your core isn't meant to be as powerful as an application processor, yeah, go for it, but be very careful.
POWER managed to solve this but I'm not fluent with this architecture.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.