8000 [DYNAREC] Fixed call_c issues by ksco · Pull Request #823 · ptitSeb/box64 · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[DYNAREC] Fixed call_c issues #823

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

Merged
merged 3 commits into from
Jun 6, 2023
Merged

[DYNAREC] Fixed call_c issues #823

merged 3 commits into from
Jun 6, 2023

Conversation

ksco
Copy link
Collaborator
@ksco ksco commented Jun 6, 2023
  1. We cannot use xRAX as a return value register when using call_c, it will be "restored" after the c function returns.
  2. div64 and div32 sets xRDX, so even if xRDX is a callee-saved register, we still need to save & restore it.

@ksco
Copy link
Collaborator Author
ksco commented Jun 6, 2023

I think the restore of RAX and RDX in the case of function call is a bad idea, as they are the return registers. I'm fine with the current workaround, but it should be note that we have an small optimisation oportunity here.

But we need to sync RAX and RDX from xEmu to Dynarec after the call, is there a better way to do it?

@ksco ksco changed the title [DYNAREC] Fixed call_c issues and small optims to DIV opcode [DYNAREC] Fixed call_c issues Jun 6, 2023
@ptitSeb
Copy link
Owner
ptitSeb commented Jun 6, 2023

I think the restore of RAX and RDX in the case of function call is a bad idea, as they are the return registers. I'm fine with the current workaround, but it should be note that we have an small optimisation oportunity here.

But we need to sync RAX and RDX from xEmu to Dynarec after the call, is there a better way to do it?

I'm still unsure. Will need to study some dump to see how (in)efficient calls are.

@ptitSeb ptitSeb merged commit 2b0ceaf into ptitSeb:main Jun 6, 2023
@ksco ksco deleted the callc branch June 6, 2023 10:28
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.

2 participants
0