VOGONS


ARM (Thumb) Dynamic Core Code

Topic actions

Reply 20 of 48, by wd

User metadata
Rank DOSBox Author
Rank
DOSBox Author

That's pretty much what crazyc implemented, wrapping saves/restores
around these functions. But it might affect indeed more than i think.

Reply 23 of 48, by wd

User metadata
Rank DOSBox Author
Rank
DOSBox Author

Thank you, i only had a quick glance over it, and most stuff looks good
(didn't get the temp-reg change, got to have a closer look at that).

Reply 24 of 48, by M-HT

User metadata
Rank Newbie
Rank
Newbie

If you mean the change in step 3 (in files decoder_opcodes.h and operators.h), that was becuse FC_RETOP was used to hold the value of the 3rd parameter. And this was a problem if FC_RETOP and FC_OP1 were the same register (FC_OP1 is the 1st parameter and FC_OP2 the 2nd parameter). I checked the dynamic recompiler and this was the only place where such problem occured.

Reply 25 of 48, by wd

User metadata
Rank DOSBox Author
Rank
DOSBox Author

The change will break the other recompiler backends as far as i see, but i have
not had a closer look at it yet (needs a FC_OP3 or something).

Reply 26 of 48, by M-HT

User metadata
Rank Newbie
Rank
Newbie

I checked the other backends and I think they are OK with the change.
Did I miss something ?

Reply 27 of 48, by wd

User metadata
Rank DOSBox Author
Rank
DOSBox Author

In its current state the
if (immediate) gen_mov_byte_to_reg_low_imm(TEMP_REG_DRC,decode_fetchb());
would fail for x86/x64 because TEMP_REG_DRC is not byte-accessible.

Reply 28 of 48, by M-HT

User metadata
Rank Newbie
Rank
Newbie

I missed that.
So, one fix woud be to use function gen_mov_byte_to_reg_low_imm_canuseword instead of gen_mov_byte_to_reg_low_imm (and MOV_REG_BYTE_TO_HOST_REG_LOW_CANUSEWORD instead of MOV_REG_BYTE_TO_HOST_REG_LOW).

On x86, another fix would be to switch FC_ADDR (ebx) and TEMP_REG_DRC (esi).
On x64 I don't know if this switch would work or not.

Also I found two possible bugs.
1) on x86 and x64 in function gen_lea, TEMP_REG_DRC is used directly instead of scale_reg parameter.
2) on x86 in function gen_run_code, only ebx register is saved, but both ebx and esi should be saved.

Reply 29 of 48, by wd

User metadata
Rank DOSBox Author
Rank
DOSBox Author

I'll try to have a look at both issues, but for the moment i'll only commit
things that don't affect x64 before the release. The new defines for the
arm emitter look nice btw.

Reply 30 of 48, by wd

User metadata
Rank DOSBox Author
Rank
DOSBox Author

Is there already port of 0.73 that uses the arm backend for the recompiler,
or somebody (going to) work on it? As i'll be committing the remaining
updates and fixes of this thread, but some testing would be good along
with this.

Reply 31 of 48, by Pickle

User metadata
Rank Member
Rank
Member
wd wrote:
Is there already port of 0.73 that uses the arm backend for the recompiler, or somebody (going to) work on it? As i'll be commit […]
Show full quote

Is there already port of 0.73 that uses the arm backend for the recompiler,
or somebody (going to) work on it? As i'll be committing the remaining
updates and fixes of this thread, but some testing would be good along
with this.

Yes im running the CVS on the pandora hardware

Reply 32 of 48, by wd

User metadata
Rank DOSBox Author
Rank
DOSBox Author

Ok thanks, keep an eye on the changes and please report back if they cause trouble
(assuming you didn't directly incorporate M-HT's updates).

Reply 33 of 48, by n0p

User metadata
Rank Member
Rank
Member

Hi.
Maybe it's Windows Mobile specific, but DOSBox built for this system using ARM dynrec (CVS from 2009-07-04) experience random exits without warning/error.
CVS from 2009-06-23 was OK (ARM dynrec worked fine and stable).

Reply 34 of 48, by wd

User metadata
Rank DOSBox Author
Rank
DOSBox Author

Can you pinpoint some change? Like removing the respective instruction
(the dshifts were changed) makes it stable again?

Reply 35 of 48, by n0p

User metadata
Rank Member
Rank
Member

Oh, i'm really not that experienced, but i'll try.

Reply 36 of 48, by wd

User metadata
Rank DOSBox Author
Rank
DOSBox Author

Could you please check which of the commits caused it? One was on 25th
of june, one on the 27th of june (be sure to compare the contents of the
sources you grab with cvs tools against the sourceforge contents of the
respective version).

Also as a quick check (using your current sources) disable the double shift instructions
(see decoder.h of the dynrec directory, remove the cases that call dyn_dshift_ev_gv).

Reply 37 of 48, by n0p

User metadata
Rank Member
Rank
Member

wd, thank you.
With dyn_dshift_ev_gv removed dynamic core works stable.
Also i should say that current ARM dynrec works faster than previous one by at least 5%.

Reply 38 of 48, by wd

User metadata
Rank DOSBox Author
Rank
DOSBox Author

Maybe you can check if the commit from the 25th was already causing it,
or if it's broken together with the followup optimizations (27th).

Reply 39 of 48, by n0p

User metadata
Rank Member
Rank
Member

wd, i feel dumb.
I've tested dynrec 1.4 - works fine (Jagged Alliance throwed 8bit irq pending error once).
Tested 1.5 - it also runs fine.
Most probably it's just my old device behaves bad.
Sorry for taking your time.