Any way to extract S field of a register to another in a single instruction?
rogloh
Posts: 5,787
in Propeller 2
What am I missing? If I use SETS D, S I think I need to clear the D register first, or if I do a AND S, #$1ff I destroy S.
Surely this is doable...
Surely this is doable...
Comments
Also not sure about the 2 clock pipeline delay in setting a either. and this would work too
The sets should not have pipeline problems if we are not executing from it.
MUXQ would work but still requires a SETQ setup sometime earlier. Not really any different to clearing D first.
Is this any good?
The original 7 instruction code I show just seems too inefficient. The original footprint I had in place only checked zero and a total 512 byte limit but no 512 byte boundary crossing was 5 instructions and I'm trying to not grow it much to extend to cases where any transfer crosses a 512 byte boundary is identified and rejected.
I would quite like the "andn a, #$1ff wcz" at the end though because it leaves the flags in the right condition.
Update: there's also the FLES / FLE / FGE/ FGES stuff too. That might be something useful too.
@evanh. a is just a free temp register so it can be left in any state.
And a, #$1ff
Add a,count
CMP a, #$201 or cmpr if you need the opposite c.
This saves the sub.
sizeerror is probably close by, but one issue with TJxx D,#S is that cannot jump from anywhere in COG RAM to anywhere in LUT RAM and vice-versa. Alternative: