Change the mask shown for rlw* to be shifted. ie the result of the instruction is source & mask, right-aligned.

This commit is contained in:
Shawn Hoffman 2011-11-20 15:35:43 -08:00
parent 507a4aa704
commit 73beeaf45a

View File

@ -563,7 +563,7 @@ typedef unsigned int ppc_word;
} }
static unsigned int Helper_Mask(int mb, int me) static unsigned int Helper_Rotate_Mask(int r, int mb, int me)
{ {
//first make 001111111111111 part //first make 001111111111111 part
unsigned int begin = 0xFFFFFFFF >> mb; unsigned int begin = 0xFFFFFFFF >> mb;
@ -573,9 +573,9 @@ typedef unsigned int ppc_word;
unsigned int mask = begin ^ end; unsigned int mask = begin ^ end;
//and invert if backwards //and invert if backwards
if (me < mb) if (me < mb)
return ~mask; mask = ~mask;
else //rotate the mask so it can be applied to source reg
return mask; return _rotl(mask, 32 - r);
} }
@ -587,7 +587,7 @@ typedef unsigned int ppc_word;
int mb = (int)PPCGETC(in); int mb = (int)PPCGETC(in);
int me = (int)PPCGETM(in); int me = (int)PPCGETM(in);
sprintf(dp->opcode,"rlw%s%c",name,in&1?'.':'\0'); sprintf(dp->opcode,"rlw%s%c",name,in&1?'.':'\0');
sprintf(dp->operands,"%s, %s, %s%d, %d, %d (%08x)",regnames[a],regnames[s],regsel[i],bsh,mb,me,Helper_Mask(mb, me)); sprintf(dp->operands,"%s, %s, %s%d, %d, %d (%08x)",regnames[a],regnames[s],regsel[i],bsh,mb,me,Helper_Rotate_Mask(bsh, mb, me));
} }