- XBA
- XCE
- TXY
- TYX
Register renaming in the 65816?
-
jeffythedragonslayer
- Posts: 114
- Joined: 03 Oct 2021
Register renaming in the 65816?
Does the 65816 use register renaming? Some instructions sound like they would be somewhat easy to implement with register renaming:
Re: Register renaming in the 65816?
I would doubt it, although it's possible - the Z80 does this, in several different ways, it relabels things rather than moving data.
Edit: not sure if we could know, short of reverse engineering the chip.
Edit: not sure if we could know, short of reverse engineering the chip.
-
jeffythedragonslayer
- Posts: 114
- Joined: 03 Oct 2021
Re: Register renaming in the 65816?
I think the way register renaming needs to work is to have something by way of a register address - even if only one bit - such that the register access is done through a decoder and the decoder's action is modified by the renaming map.
In the very simplest case, that XBA is done as a rename, it means that A and B are accessed - always - through an indirect bit which says which is which.
But a look at instruction timings tells us that the Txx instructions take two cycles, whereas XBA takes three. So XBA is doing more work than a single operation, and so we can, I think, conclude that XBA is actually shuffling A and B contents - it's not renaming the two.
But but but, XCE takes only two cycles, so there is mechanism in there to swap two bits (just two bits!) efficiently, or there is mechanism in there to access those two bits through an indirect which-is-which bit.
In the very simplest case, that XBA is done as a rename, it means that A and B are accessed - always - through an indirect bit which says which is which.
But a look at instruction timings tells us that the Txx instructions take two cycles, whereas XBA takes three. So XBA is doing more work than a single operation, and so we can, I think, conclude that XBA is actually shuffling A and B contents - it's not renaming the two.
But but but, XCE takes only two cycles, so there is mechanism in there to swap two bits (just two bits!) efficiently, or there is mechanism in there to access those two bits through an indirect which-is-which bit.
Re: Register renaming in the 65816?
BigEd wrote:
I would doubt it, although it's possible - the Z80 does this, in several different ways, it relabels things rather than moving data.
Re: Register renaming in the 65816?
My 1988 KK Computer uses register renaming... even though the term itself was unknown to me at the time.
KK is a 65C02 augmented with 6 new registers and 44 new instructions. Register K0 is the default source for address bits A23-A16, and thus has similarities to PBR and DBR on the 65C816 (also unknown to me at the time).
As the homegrown mnemonics imply, a far jump or far call (JMP_K3 or JSR_K3) uses K3 to specify the new A23-A16.
This is accomplished by an apparent swap of K3 with K0. But, as Ed explained, it isn't actually the register contents that change. Instead, there's an XOR gate that changes the behavior of the decoding mechanism that selects K3 as opposed to K0.
-- Jeff
KK is a 65C02 augmented with 6 new registers and 44 new instructions. Register K0 is the default source for address bits A23-A16, and thus has similarities to PBR and DBR on the 65C816 (also unknown to me at the time).
As the homegrown mnemonics imply, a far jump or far call (JMP_K3 or JSR_K3) uses K3 to specify the new A23-A16.
This is accomplished by an apparent swap of K3 with K0. But, as Ed explained, it isn't actually the register contents that change. Instead, there's an XOR gate that changes the behavior of the decoding mechanism that selects K3 as opposed to K0.
-- Jeff
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html
https://laughtonelectronics.com/Arcana/ ... mmary.html