Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AArch64 cond operands #1889

Open
adamjseitz opened this issue Jun 30, 2022 · 1 comment
Open

AArch64 cond operands #1889

adamjseitz opened this issue Jun 30, 2022 · 1 comment

Comments

@adamjseitz
Copy link
Contributor

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.

@Rot127
Copy link
Collaborator

Rot127 commented Nov 2, 2023

Personally I wouldn't say this is necessary. lt at an operand position is syntactical sugar IMHO. Having condition information at two different places makes the whole design just more complicated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants