Skip to content

Support Signed Lifted IL Shift Amounts in Custom Architectures #6090

@ehntoo

Description

@ehntoo

What is the feature you'd like to have?
Support negative/signed shift amounts in arithmetic and logical shifts. At present, an IL arithmetic shift right with a shift amount of 0xFFFFFFFF on a 32-bit architecture results in an attempted shift of val >> 4294967295, resulting in a value filled with whatever the upper-most bit was. I would like to see either additional Lifted IL operations that accept a signed shift amount, or to have the existing Lifted IL operations interpret the shift amount argument as a signed value, with corresponding documented semantics.

Is your feature request related to a problem?
Hexagon provides arithmetic and logical shift operations for both left- and right- shifts that take a shift amount from a register. The architecture defines the semantics for a negative shift amount as a shift of the same type (arithmetic or logical) in the opposite direction. This is presently somewhat tricky to lift, and would introduce additional conditionals into the IL flow for every shift operation of this type.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Component: APIIssue needs changes to the APIComponent: ArchitectureIssue needs changes to an architecture pluginCore: LLILIssue involves Low Level ILLiftingissues related to LLIL liftingState: Awaiting TriageIssue is waiting for more in-depth triage from a developer

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions