Skip to content

Improve ARMv8 function calling#560

Open
iLillie wants to merge 3 commits into
SamboyCoding:developmentfrom
iLillie:development
Open

Improve ARMv8 function calling#560
iLillie wants to merge 3 commits into
SamboyCoding:developmentfrom
iLillie:development

Conversation

@iLillie

@iLillie iLillie commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

In #557 there was a bug added that was not previously found, for BL instructions we want to find the target function and use the return registers for the target function, so calls with void are not set for calls that are supposed to have a return type.

Also logic for callParams did not take into account CallVoid OpCode.

@coveralls

Copy link
Copy Markdown

Coverage Report for CI Build 27545063549

Coverage decreased (-0.02%) to 35.332%

Details

  • Coverage decreased (-0.02%) from the base build.
  • Patch coverage: 6 uncovered changes across 2 files (0 of 6 lines covered, 0.0%).
  • 1 coverage regression across 1 file.

Uncovered Changes

File Changed Covered %
Cpp2IL.Core/IlGenerator.cs 3 0 0.0%
Cpp2IL.Core/InstructionSets/NewArmV8InstructionSet.cs 3 0 0.0%

Coverage Regressions

1 previously-covered line in 1 file lost coverage.

File Lines Losing Coverage Coverage
Cpp2IL.Core/InstructionSets/NewArmV8InstructionSet.cs 1 0.0%

Coverage Stats

Coverage Status
Relevant Lines: 12586
Covered Lines: 4851
Line Coverage: 38.54%
Relevant Branches: 8058
Covered Branches: 2443
Branch Coverage: 30.32%
Branches in Coverage %: Yes
Coverage Strength: 238829.84 hits per line

💛 - Coveralls

break;

AddCall(context, GetReturnRegisterForContext(possibleMethods[0]), address, instruction.BranchTarget);
}

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will silently drop the call if it's to an unmanaged/API function, need to handle it in an else.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had previously else that defaulted to the "incorrect" behavior, but I can do some testing and figure out the cases where the else might be hit 👍

@iLillie iLillie requested a review from SamboyCoding June 15, 2026 12:53
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

Successfully merging this pull request may close these issues.

3 participants