Skip to content

AArch64 cond operands #1889

Open
Open
@adamjseitz

Description

@adamjseitz

There are a number of ARM64 instructions that represent a condition code as an operand. These include:

ccmn, ccmp, cinc, cinv, cneg, csel, cset, csetm, csinc, csinv, csneg, fccmp, fccmpe, fcsel

However, capstone does not represent these as an operand:

cstool -d arm64 00bc211e
 0  00 bc 21 1e  fcsel  s0, s0, s1, lt
        ID: 194 (fcsel)
        op_count: 3
                operands[0].type: REG = s0
                operands[0].access: WRITE
                operands[1].type: REG = s0
                operands[1].access: READ
                operands[2].type: REG = s1
                operands[2].access: READ
        Code-condition: 12
        Registers read: nzcv s0 s1
        Registers modified: s0
        Groups: fparmv8

I would suggest adding a new enum value ARM64_OP_COND to arm64_op_type and a field arm64_op_cc cc to the cs_arm64_op structure's value union to more accurately represent these instructions as having four operands.

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