On Fri, 16 Dec 2005, ashwin k wrote:
> Dear all,
> I am working on encryption project ,I need to perform rotate operation in
BLACKFIN 533 without the CC bit interfereing.
> Because of this I have done rotate in 4 CYCLES by lshift,lshift(-) and or
operation.
> can it be done in less cycles?
> this is crucial for me
> can you help with parallel instructions (if possible)?
Check the manual:
http://www.analog.com/UploadedFiles/Associated_Docs/64547534176398BF53x_56x_PRM_14_shift_rotate.pdf
page 21-24 mostly.
I think you can do other parallel instructions, but it's probably
addressing stuff. I didn't look in detail.
Rather than think of the CC bit as interfering, think of it as part of
your data. The manual says:
The D-register versions of this instruction rotate all 32 bits. The
Accumulator versions rotate all 40 bits of those registers.
If you are working with more than 32 and less than 40 bits, then the
accumulator is where you want to be. If more than 40 bits, you want to
use the cc bit anyway. If less than 32 bits, any data register will work
fine.
It's just another bit. It may take one instruction to set or clear it,
but then the rotate to get what you want is one more instruction. At 2
instructions, you are pretty efficient. You can also do your rotates and
mask what you don't need.
I grant having rotate without carry is nice. But it's not so bad either
to just have rotate thru carry.
Patience, persistence, truth,
Dr. mike