Skip to content

thumb2 consistent it conditional lifting #5527

Open
@w1282

Description

@w1282

What is the feature you'd like to have?
It would be nice if the lifting strategy for the thumb2 it instruction could be changed in a way that causes the higher-level ILs to reduce the conditional into a more readable if/else format.

For example, right now

cmp r0, #1
it ne
movs r0, #3
bne #_exit_label
// code being protected from cases where `r0 != 1`

is lifted to HLIL as...

bool cond:0_1 = r0 != 1
if (r0 != 1)
    r0 = 3
if (not(cond:0_1))
    // code being protected from cases where `r0 != 1`
return

instead of the more readable

if (r0 != 1)
    result = 3
else
    // useful code being protected from cases where `r0 != 1`
return

Is your feature request related to a problem?
Readability

Metadata

Metadata

Assignees

No one assigned

    Labels

    Arch: ARM/ThumbIssues with the ARM/Thumb architecture pluginComponent: ArchitectureIssue needs changes to an architecture pluginEffort: LowIssue should take < 1 weekImpact: LowIssue is a papercut or has a good, supported workaroundLiftingissues related to LLIL lifting

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions