Subject: Re: [PATCH 1/5] powerpc/lib/sstep: Add cmpb instruction emulation

From: Segher Boessenkool <[email-masked]>
Date: Thu, 13 Jul 2017 02:10:46 -0500

On Thu, Jul 13, 2017 at 01:43:53AM -0500, Segher Boessenkool wrote:
> On Thu, Jul 13, 2017 at 01:51:30PM +1000, Andrew Donnellan wrote:
> > On 13/07/17 13:25, Matt Brown wrote:
> > >@@ -1049,6 +1066,13 @@ int analyse_instr(struct instruction_op *op, struct 
> > >pt_regs *regs,
> > > 			do_cmp_unsigned(regs, val, val2, rd >> 2);
> > > 			goto instr_done;
> > >
> > >+		case 19173952: /* cmpb */
> > 
> > This looks wrong and should never trigger, given that the switch 
> > statement is comparing against ((instr >> 1) & 0x3ff).
> > 
> > How did you get this value?
> 
> The correct number is 508, and 19173952 = 37744*508.  How to get
> 37744 is a mystery though :-)

Ah.  Take the binary representation of 508, and interpret that as if
it were octal :-)  Those pesky meddling leading zeroes!

Segher