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

CPU: Cycle accurate timings for divs/divu #101

Open
ggnkua opened this issue Mar 22, 2016 · 3 comments
Open

CPU: Cycle accurate timings for divs/divu #101

ggnkua opened this issue Mar 22, 2016 · 3 comments

Comments

@ggnkua
Copy link

ggnkua commented Mar 22, 2016

Hi,

If I read the cpu emulation code correctly, divs/divu cycles are calculated simply by adding the worst case cycle count. If that's the case then the following code Jorge Qwik (ijor) will give accurate cycles for all cases of division:

http://pasti.fxatari.com/68kdocs/div68kCycleAccurate.c

Hope this helps,
George

@stefanberndtsson
Copy link
Member

Yes, I know about that one, and I had some thoughts of implementing it, but at the moment, I can't due to ostis being LGPL, and that code being GPL. I won't rule out that this can be solved, but I won't actually do anything about it until I've started rewriting the cpu to be clocked instead of instruction-stepped as it is now. I'll keep this open though.

@larsbrinkhoff
Copy link
Member

It looks like it might be possible to implement the hardware algorithm, and thus compute the result in parallel with the cycle time. It would be a good fit for our close-to-the-hardware policy.

@larsbrinkhoff
Copy link
Member

The Yacht table also seems to have some algorithm for calculating the number of DIVU and DIVS cycles.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants