[PATCH 5/5] powerpc/lib/sstep: Add isel instruction emulation

Segher Boessenkool segher at kernel.crashing.org
Thu Jul 13 17:47:32 AEST 2017


On Thu, Jul 13, 2017 at 01:25:48PM +1000, Matt Brown wrote:
> +		case 585:	/* isel */

The secondary opcode for isel is only 5 bits, not 10 like most other
insns have.

> +			mb = (instr >> 6) & 0x1f; /* bc */
> +			val = (regs->ccr >> (mb + 32)) & 1;

regs->ccr >> (31 - mb)  ?

> +
> +			if (val)
> +				regs->gpr[rd] = regs->gpr[ra];

You need to treat ra=0 separately (as 0, not reg 0).

> +			else
> +				regs->gpr[rd] = regs->gpr[rb];
> +			goto logical_done;


Segher


More information about the Linuxppc-dev mailing list