mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-18 10:13:57 +08:00
powerpc/lib/sstep: Add isel instruction emulation
This adds emulation for the isel instruction. Tested for correctness against the isel instruction and its extended mnemonics (lt, gt, eq) on ppc64le. Signed-off-by: Matt Brown <matthew.brown.dev@gmail.com> Reviewed-by: Cyril Bur <cyrilbur@gmail.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
This commit is contained in:
parent
2c979c489f
commit
e27f71e5ff
@ -1255,6 +1255,14 @@ int analyse_instr(struct instruction_op *op, struct pt_regs *regs,
|
|||||||
/*
|
/*
|
||||||
* Logical instructions
|
* Logical instructions
|
||||||
*/
|
*/
|
||||||
|
case 15: /* isel */
|
||||||
|
mb = (instr >> 6) & 0x1f; /* bc */
|
||||||
|
val = (regs->ccr >> (31 - mb)) & 1;
|
||||||
|
val2 = (ra) ? regs->gpr[ra] : 0;
|
||||||
|
|
||||||
|
regs->gpr[rd] = (val) ? val2 : regs->gpr[rb];
|
||||||
|
goto logical_done;
|
||||||
|
|
||||||
case 26: /* cntlzw */
|
case 26: /* cntlzw */
|
||||||
asm("cntlzw %0,%1" : "=r" (regs->gpr[ra]) :
|
asm("cntlzw %0,%1" : "=r" (regs->gpr[ra]) :
|
||||||
"r" (regs->gpr[rd]));
|
"r" (regs->gpr[rd]));
|
||||||
|
Loading…
Reference in New Issue
Block a user