RDCOG/WRCOG instruction - is it possible?
Peter Jakacki
Posts: 10,193
in Propeller 2
It seems that there is no simple instruction to read indirectly from cog memory as we can with RDLUT/WRLUT for LUT memory and RDLONG/WRLONG etc for hub memory. Of course we can use SETS/SETD plus a two instruction delay or else use the awkward ALTDS instruction but either way none of these are clean and simple or efficient.
What is really begging is a RDCOG and WRCOG instruction which can use a register as an indirect register.
@Chip: is it possible and practical to include those instructions in P2?
What is really begging is a RDCOG and WRCOG instruction which can use a register as an indirect register.
@Chip: is it possible and practical to include those instructions in P2?
Comments
Your terse statement is quite contrary to what I have stated but also does not answer the question (is it possible?) neither does it demonstrate how you have come to your conclusion.
Alternatively, I think, a longer pipeline would be needed ... just for indirection.
It's just that I have written a mountain of code for the P2 and this one instruction and the lack of the other really stands out. Well, maybe I will change my mind but that's my feelings about it at this point anyway.
While I agree that ALTDS is a little awkward it more than compensates I think in its efficiency.
Foe example Nice and compace and efficient.
Perhaps Pnut can be enhaced later on with some additional syntax tweaks to allow easier config of the ALTDS modes.
Given the pipeline architecture, ALTDS is probably about as efficient a mechanism as can be expected.
ALTDS is a low level patch, and I agree needs mnemonics for what would become 64 bit opcodes.
In an ideal environment, mnemonics would be generic and smart enough to select the smallest form, but that needs multi pass and an intelligence level not yet in the tool chains.
Generic, as well as explicit small/large names, could be defined now, and the improvement applied over time.