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

Handle ABIs that pass and return floating point values split across multiple integer registers #5900

Open
galenbwill opened this issue Sep 3, 2024 · 0 comments
Labels
Component: Core Issue needs changes to the core Component: Type Parser Issue needs changes to Clang/CoreTypeParser Effort: High Issue should take > 1 month Impact: High Issue adds or blocks important functionality Type: Enhancement Issue is a small enhancement to existing functionality

Comments

@galenbwill
Copy link
Contributor

The ARM EABI specifies that floating point values be passed and returned in integer registers. Single precision (float or float32) values fit into single registers, but double precision (double or float64) values must be placed in pairs of 32-bit integer registers.

Thus a function like atan2, with this signature in C: double atan2(double, double), would look in the binary like it was int32 atan2(int32, int32, int32, int32).

Ideally, Binary Ninja should support this syntax to capture its true semantics:

    double@r0:r1 atan2(double @ r0:r1, double @ r2:r3)

There are (at least) two parts to adding support for this:

  1. The type parser:
    1. needs to be able to handle register specifiers in return types
    2. needs to be able to handle split register specifiers
  2. The analysis needs to be able to deal with split register parameters and returns, including being aware of the type conversion that they imply.
@galenbwill galenbwill added Type: Enhancement Issue is a small enhancement to existing functionality Component: Core Issue needs changes to the core Component: Type Parser Issue needs changes to Clang/CoreTypeParser Impact: High Issue adds or blocks important functionality Effort: High Issue should take > 1 month Lifting issues related to LLIL lifting labels Sep 3, 2024
@plafosse plafosse removed the Lifting issues related to LLIL lifting label Sep 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Core Issue needs changes to the core Component: Type Parser Issue needs changes to Clang/CoreTypeParser Effort: High Issue should take > 1 month Impact: High Issue adds or blocks important functionality Type: Enhancement Issue is a small enhancement to existing functionality
Projects
None yet
Development

No branches or pull requests

2 participants