• Paul Mackerras's avatar
    powerpc: Fix emulation of the isel instruction · f1bbb99f
    Paul Mackerras authored
    The case added for the isel instruction was added inside a switch
    statement which uses the 10-bit minor opcode field in the 0x7fe
    bits of the instruction word.  However, for the isel instruction,
    the minor opcode field is only the 0x3e bits, and the 0x7c0 bits
    are used for the "BC" field, which indicates which CR bit to use
    to select the result.
    
    Therefore, for the isel emulation to work correctly when BC != 0,
    we need to match on ((instr >> 1) & 0x1f) == 15).  To do this, we
    pull the isel case out of the switch statement and put it in an
    if statement of its own.
    
    Fixes: e27f71e5 ("powerpc/lib/sstep: Add isel instruction emulation")
    Signed-off-by: default avatarPaul Mackerras <paulus@ozlabs.org>
    Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
    f1bbb99f
sstep.c 59 KB