The past biting you on the ass
Rick Murray (539) 13840 posts |
I’ve talked before about the difficulties of maintaining backwards compatibility, saying that it would be nice to have a RISC OS with all the snazzy features of Linux, but not if it comes at the cost of no longer being…you know…RISC OS. Well, if you think we have it hard, take a moment to pity ARM. Way back when, it was decided to expose the Program Counter as the address of the instruction currently being fetched. This would simplify the logic with respect to branching as putting a new address in PC will directly set the processor to that new location. A side effect crops up when we are debugging programs and discover that innocuous ADD instructions and the like throw exceptions! What? Well, it is simple to understand when you realise that the address of PC (and hence the location of your exception) is the address of the instruction being fetched. Step back one instruction, that’s the one being decoded internally. Step back one more instruction, that’s the one actually being executed (and the one that will have actually caused the exception). Well, now. Current ARM processors have pipelines that contain loads of stages – 8 stages on the Pi’s ARM11, 13 on the Beagle xM, and 8-11 stage (dynamic) pipeline on the iMX6’s Cortex-A9. To complicate matters further… Out of order execution. Branch prediction. All sorts of clever things. But, yet, PC is two instructions ahead of the instruction being executed. A quirk of history. I wonder how much silicon is expended in making that continue working as it always had, even though I can’t imagine it having much relevance to a modern ARM other than “remember the address of the instruction being executed and bodge it by two words”. ;-) |
John Williams (567) 768 posts |
I must protest at the “americanism” “ass”. Surely you mean “arse”! I’m sure your mother didn’t teach you that! Les fesses! On est mordu, sans doute! Mais … |
Rick Murray (539) 13840 posts |
Hai, hai... I'm used to that. :-P
Nope. I don’t use that version due to pronunciation differences (same reason I spell “mom” with an ‘o’, it looks more like how I say it).
Mais non, c’est un expression, hein? |
Paul Sprangers (346) 524 posts |
… une? |
John Williams (567) 768 posts |
And I thought I was being picky! An ass is an animal with big hairy feet |