Quote:
Originally Posted by meynaf
On 68020+ there is a barrel shifter so ROL/ROR timing is no longer a problem. Having added an extra instruction for byte swapping in words would have led to duplicates.
|
Hmm, according to the 68020 manual ROR/ROL is 5/8/8 cycles (best case/cache case/worst case), a SWAP is 1/4/4, so still quite a bit faster. The rotate operations seem to be considerably slower than the pure shifts.
But there's a slightly mysterious sentence in the Programmer's Reference Manual:
Quote:
Fast byte swapping is possible by using the ROR and ROL instructions with a shift count of eight, enhancing the performance of the shift/rotate instructions.
|
Is there a special case for n = 8 which needs less cycles?