View Single Post
Old 07 December 2018, 10:48   #90
chb
Registered User
 
Join Date: Dec 2014
Location: germany
Posts: 439
Quote:
Originally Posted by meynaf View Post
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?
chb is offline  
 
Page generated in 0.04418 seconds with 11 queries