Is there a simple way to do a (dword) rotate left with MMX? At the moment the best I can think of is:
regsrc - The register to rotate
c - Number of bits to rotate
regx - Spare register to use
So in use:
Any sugesstions?
Thanks
regsrc - The register to rotate
c - Number of bits to rotate
regx - Spare register to use
prlld MACRO regsrc:REQ,c:REQ,regx:=<MM7>
movq regx,regsrc
pslld regsrc,c
psllr regx,32 - c
por regsrc,regx
ENDM
So in use:
prlld MM0,13,MM1
prlld MM3,19
Any sugesstions?
Thanks
If the ROL is a multiple of 16 PSHULW could be used on
Athlon / P3 / P4. Cool thing is you get a movq for free too.
pshulw dest,scr,10010011y ; ROL 16 ; ROR 48
pshulw dest,scr,01001110y ; ROL 32 ; ROR 32
pshulw dest,scr,00111001y ; ROL 48 ; ROR 16
nop ; pshulw dest,scr,11100100y ; ROL 64 ; ROR 64
Athlon / P3 / P4. Cool thing is you get a movq for free too.
pshulw dest,scr,10010011y ; ROL 16 ; ROR 48
pshulw dest,scr,01001110y ; ROL 32 ; ROR 32
pshulw dest,scr,00111001y ; ROL 48 ; ROR 16
nop ; pshulw dest,scr,11100100y ; ROL 64 ; ROR 64