Skip to content

[PPC] Add BO and BI fields of branch instructions to cs_insn.detail.ppc #1909

@Rot127

Description

@Rot127

The BO and BI field in PPC branch opcodes determine:
BO: if the ctr register is altered or a cr register field is checked.
BI: holds the offset of the cr bit to check.

Those fields are not explicitly stored in the cs_insn.detail.ppc struct. Instead register operands like cr5eq are added (which also matches the behavior of objdump).

Nonetheless it would be useful to have access to the raw values of all opcode fields without manual parsing.

As an example:
The link below leads to code where instructions are uplifted to an intermediate language. Since the uplifted instructions should match closely the ISA it is easier to work with the BO and BI values directly:
https://github.com/Rot127/rizin/blob/e8763786435e1829a68134d701e9b83231e82a4d/librz/analysis/arch/ppc/ppc_il.c#L585-L714

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions