dosbox-staging icon indicating copy to clipboard operation
dosbox-staging copied to clipboard

Is there need for instructions test?

Open xor2003 opened this issue 3 years ago • 7 comments

Are you using the latest Dosbox-Staging Version?

  • [X] I have checked releases and am using the latest release.

Different version than latest?

No response

What Operating System are you using?

No response

Whats your question and how can we help?

QEMU project have good test for x86 instructions and flags like add, adc, mul, etc. Executibale can be called on real and emulated CPU and results can be compared. (I mean it is not google test) I haven't found such test in this project. I already tried it myself on dosbox and it work pretty fine. Do you want me to make a pull request? I wanted to ask before doing some work.

Code of Conduct & Contributing Guidelines

  • [X] Yes, I agree.

xor2003 avatar Nov 15 '21 09:11 xor2003

I can only speak for myself - and maybe kcgen :)

yes please!!!

LowLevelMahn avatar Nov 15 '21 09:11 LowLevelMahn

Correctness tests are very welcome, indeed! Thanks for helping, @xor2003.

kcgen avatar Nov 15 '21 10:11 kcgen

If I call test from DOSBox-X or Windows or Linux it does not crash. I if call from staging - it is crashing on div instruction.

x86 instructions test (testi386.exe) is build using mingw right now. The HX extender is used so you can run it on real CPU (windows/wine system) and under emulator and compare results.

Sorry you have to integrate it yourself. I don't know how to properly do it.

xor2003 avatar Nov 15 '21 20:11 xor2003

So the instruction emulation is very good for staging. CMOV, CMPXCHB8 are not implemented. Maybe not required. qemu_x86_instructions.zip

xor2003 avatar Nov 16 '21 16:11 xor2003

Thank you @xor2003. It would be nice to get these working.

I did some quick tests see if the signed 32-bit division routines implemented by the DOSBox-X team could work in Staging (IDVID from instructions.h) but that wasn't sufficient, as the test program still failed in the same spot even with core = normal.

So it seems DOSBox-X has implemented further per-requisites to have this work properly. I haven't checked to see if CMOV or CMPXCHB8 are in the same boat, or if they could be more trivially ported.

Are games affected by these?

If games aren't affected - then perhaps you or someone else could pursue adding these to Staging?

I would imagine each instruction would be a separate block of code, easily merged with no risk and no extra maintenance burden. So this would be very welcome, if someone wants to add them (with all credit and author attribution to DOSBox-X team, of course :+1: )

kcgen avatar Nov 16 '21 17:11 kcgen

Probably of minimal value, at least CMOV. https://yarchive.net/comp/linux/cmov.html, and it wasn't available until PPro, IIRC.

kklobe avatar Nov 16 '21 17:11 kklobe

Right these instructions (CMOV, etc) are not required for DOS software since provided for recent CPUs. What's why they are not yet in original Dosbox I think.

xor2003 avatar Nov 17 '21 08:11 xor2003

It's dead, Jim.

Burrito78 avatar May 13 '23 13:05 Burrito78