ptitSeb / box64

Box64 - Linux Userspace x86_64 Emulator with a twist, targeted at ARM64 Linux devices
https://box86.org
MIT License
3.73k stars 267 forks source link

Update Test27 for Android #1461

Closed KreitinnSoftware closed 2 months ago

ptitSeb commented 5 months ago

can you re-enable test27 alse?

ptitSeb commented 5 months ago

Mmmm, test is failling.

KreitinnSoftware commented 4 months ago

on my local tests, without dynarec, test27 (sse4.2 test) is working proper, and with dynarec (i tried with safeflags=2 and strongmem=3) not working proper box64_android_test27_output_with_dynarec.log box64_android_test27_output_without_dynarec.log

Using diff get this

[pablo@pablo-ms7817 tests]$ diff box64_android_test27_output_with_dynarec.log ref27_android.txt 
207c207
< _mm_cmpestri("This", 4, "This is a string", 16, 0x8) flags: a:0 s:0 z:0 c:1 o:1
---
> _mm_cmpestri("This", 4, "This is a string", 16, 0x8) flags: a:0 s:1 z:0 c:1 o:1
213c213
< _mm_cmpestri("This", 4, "This is a string", 16, 0x9) flags: a:0 s:0 z:0 c:1 o:1
---
> _mm_cmpestri("This", 4, "This is a string", 16, 0x9) flags: a:0 s:1 z:0 c:1 o:1
231c231
< _mm_cmpestri("is", 2, "This is a string", 16, 0x8) flags: a:1 s:0 z:0 c:0 o:0
---
> _mm_cmpestri("is", 2, "This is a string", 16, 0x8) flags: a:1 s:1 z:0 c:0 o:0
237c237
< _mm_cmpestri("is", 2, "This is a string", 16, 0x9) flags: a:1 s:0 z:0 c:0 o:0
---
> _mm_cmpestri("is", 2, "This is a string", 16, 0x9) flags: a:1 s:1 z:0 c:0 o:0
267c267
< _mm_cmpestri("This is a string", 16, "", 0, 0x8) flags: a:0 s:1 z:1 c:0 o:0
---
> _mm_cmpestri("This is a string", 16, "", 0, 0x8) flags: a:0 s:0 z:1 c:0 o:0
273c273
< _mm_cmpestri("This is a string", 16, "", 0, 0x9) flags: a:0 s:1 z:1 c:0 o:0
---
> _mm_cmpestri("This is a string", 16, "", 0, 0x9) flags: a:0 s:0 z:1 c:0 o:0
279c279
< _mm_cmpestri("", 0, "This is a string", 16, 0x8) flags: a:1 s:0 z:0 c:0 o:0
---
> _mm_cmpestri("", 0, "This is a string", 16, 0x8) flags: a:1 s:1 z:0 c:0 o:0
285c285
< _mm_cmpestri("", 0, "This is a string", 16, 0x9) flags: a:1 s:0 z:0 c:0 o:0
---
> _mm_cmpestri("", 0, "This is a string", 16, 0x9) flags: a:1 s:1 z:0 c:0 o:0
ksco commented 4 months ago

Try to use BOX64_DYNAREC_TEST=1 box64 ./test27 on your local machine to see if there is any DIFF xxx logs.

KreitinnSoftware commented 4 months ago

Try to use BOX64_DYNAREC_TEST=1 box64 ./test27 on your local machine to see if there is any DIFF xxx logs.

I will test when I get home

KreitinnSoftware commented 4 months ago

Try to use BOX64_DYNAREC_TEST=1 box64 ./test27 on your local machine to see if there is any DIFF xxx logs.

box64-android-dynarec-test.log

ksco commented 4 months ago

So, the diffs are what you need to look into and fix..

KreitinnSoftware commented 3 months ago

I checked here again today about the test30 failure, comparing the logs running natively on android-x86-64 and box64, there was a difference in psqrtpd

[pablo@archlinux tests]$ diff box64-android-output-test30.txt ref30.txt 
198,199c198,199
< psqrtpd(0 -2 ) = 0 0x7ff8000000000000 
< psqrtpd(inf -inf ) = inf 0x7ff8000000000000 
---
> psqrtpd(0 -2 ) = 0 0xfff8000000000000 
> psqrtpd(inf -inf ) = inf 0xfff8000000000000
ptitSeb commented 3 months ago

I checked here again today about the test30 failure, comparing the logs running natively on android-x86-64 and box64, there was a difference in psqrtpd

[pablo@archlinux tests]$ diff box64-android-output-test30.txt ref30.txt 
198,199c198,199
< psqrtpd(0 -2 ) = 0 0x7ff8000000000000 
< psqrtpd(inf -inf ) = inf 0x7ff8000000000000 
---
> psqrtpd(0 -2 ) = 0 0xfff8000000000000 
> psqrtpd(inf -inf ) = inf 0xfff8000000000000

Missing the "FASTNAN=0" env. var. maybe?

KreitinnSoftware commented 3 months ago

Running with FASTNAN=0 gives:

[pablo@archlinux tests]$ BOX64_DYNAREC_FASTNAN=0 BOX64_DYNAREC_FASTROUND=0 BOX64_AVX=2 ../build/box64 test30_android > box64-android-output-test30.txt
[pablo@archlinux tests]$ diff box64-android-output-test30.txt ref30.txt 
198,199c198,199
< psqrtpd(0 -2 ) = 0 0x7ff8000000000000 
< psqrtpd(inf -inf ) = inf 0x7ff8000000000000 
---
> psqrtpd(0 -2 ) = 0 0xfff8000000000000 
> psqrtpd(inf -inf ) = inf 0xfff8000000000000

And with FASTNAN=1

[pablo@archlinux tests]$ BOX64_DYNAREC_FASTNAN=1 BOX64_DYNAREC_FASTROUND=0 BOX64_AVX=2 ../build/box64 test30_android > box64-android-output-test30.txt
[pablo@archlinux tests]$ diff box64-android-output-test30.txt ref30.txt 
198,199c198,199
< psqrtpd(0 -2 ) = 0 0x7ff8000000000000 
< psqrtpd(inf -inf ) = inf 0x7ff8000000000000 
---
> psqrtpd(0 -2 ) = 0 0xfff8000000000000 
> psqrtpd(inf -inf ) = inf 0xfff8000000000000 
232c232
< mulpd(0 -2 , inf -inf ) = 0x7ff8000000000000 inf 
---
> mulpd(0 -2 , inf -inf ) = 0xfff8000000000000 inf 
235c235
< mulpd(inf -inf , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 0x7ff8000000000000 
---
> mulpd(inf -inf , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 0xfff8000000000000 
254c254
< divpd(0x7ff8000000000000 -0 , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 0x7ff8000000000000 
---
> divpd(0x7ff8000000000000 -0 , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 0xfff8000000000000 
315c315
< haddpd(0 -2 , inf -inf ) = -2 0x7ff8000000000000 
---
> haddpd(0 -2 , inf -inf ) = -2 0xfff8000000000000 
318c318
< haddpd(inf -inf , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 0x7ff8000000000000 
---
> haddpd(inf -inf , 0x7ff8000000000000 -0 ) = 0xfff8000000000000 0x7ff8000000000000 
652,653c652,653
< sqrtsd(1 2 , -2 0 ) = 0x7ff8000000000000 2 
< sqrtsd(1 2 , -inf inf ) = 0x7ff8000000000000 2 
---
> sqrtsd(1 2 , -2 0 ) = 0xfff8000000000000 2 
> sqrtsd(1 2 , -inf inf ) = 0xfff8000000000000 2 
715,716c715,716
< divsd(0 -2 , -0 0x7ff8000000000000 ) = 0x7ff8000000000000 -2 
< divsd(0 -2 , -0 0x7ff8000000000000 ) = 0x7ff8000000000000 -2 
---
> divsd(0 -2 , -0 0x7ff8000000000000 ) = 0xfff8000000000000 -2 
> divsd(0 -2 , -0 0x7ff8000000000000 ) = 0xfff8000000000000 -2