Comments (4)
A good first step would be to dump the instructions the dynarec produces: BOX64_DYNAREC_DUMP=2 BOX64_TRACE=0-1 BOX64_TRACE_FILE=dump.txt <program>
, then looking at the problematic addresses (note that the trace build* is quite helpful in this case). Note that BOX64_DYNAREC_TEST
adds quite a lot of clutter, so if you can't see the issue you can try again with that option.
Also, a DUMP
of 2 will add color (ANSI escape codes) to the output (you can read it using less -R
). If you want to open it in a text editor, this will make the file much less readable; in this case, you should instead use a DUMP
of 1
.
*The trace build requires libzydis version v3.2.1: https://github.com/zyantific/zydis/tree/v3.2.1 (newer versions change the API).
from box64.
A bit of context about what those ADJUST FLAG11 do:
One of the x86 flags OF is on bit 11 of the xFlags. But on RV64, most (all?) operation that use an Immediate have a signed 12bits immediate. That means, if trying to use an immediat to set this bit, the value will get sign extensed (because bit 11 is the sign bit for a 12bit signed value).
To avoid more opcode when setting this bit (that is set/unset often), it's moved to a different place inside RV64 dynarec (one of the lower reserved bit, the F_OF2
macro). And it works fine (and quite fast). The olnly issue is when exchanging the flags register outside of the Dynarec: those ADJUST macro allow to swap/unswap this bit in place.
from box64.
@rajdakin Thanks for your hints. I further investigated the code and found these differences only occured when I used BOX64_DYNAREC_TEST=1
. I saw this code:
box64/src/dynarec/rv64/dynarec_rv64_private.h
Lines 170 to 178 in 62695ce
When I removed the FLAGS_ADJUST_TO11
& FLAGS_ADJUST_FROM11
, python3.12 could run without any dynarec-interpreter differences even if I enabled BOX64_DYNAREC_TEST=1
. Honestly, I don't know why we need FLAGS_ADJUST_*
here, but I just suspected them doing something unexpected to the FLAGS.
from box64.
A bit of context about what those ADJUST FLAG11 do: One of the x86 flags OF is on bit 11 of the xFlags. But on RV64, most (all?) operation that use an Immediate have a signed 12bits immediate. That means, if trying to use an immediat to set this bit, the value will get sign extensed (because bit 11 is the sign bit for a 12bit signed value). To avoid more opcode when setting this bit (that is set/unset often), it's moved to a different place inside RV64 dynarec (one of the lower reserved bit, the
F_OF2
macro). And it works fine (and quite fast). The olnly issue is when exchanging the flags register outside of the Dynarec: those ADJUST macro allow to swap/unswap this bit in place.
Thanks for your attention on this issue. And I now fully understand why we need these macros.
from box64.
Related Issues (20)
- Trying to run intune-portal for our ARM-based linux clients HOT 2
- `BOX64_DYNAREC_TEST` on RISC-V is Failing HOT 7
- DanserGo: need help with acquiring Shared Object files HOT 2
- Unexpected Behaviors when Using RISC-V Extension "zbs" HOT 1
- Trying to install dotnet8 with winetricks on PiOS Bookworm HOT 7
- Trying to run Windows version of Steam through wine new wow64 mode HOT 4
- Error while trying to install dotnet 8 HOT 2
- Wine AppImage Won't Run, Missing Syscall HOT 1
- How to Count the Number of Executions of Each Dynablock in Box64? HOT 7
- 8c5752de23ac421025032e405ca3168191ae7a33 dynarec breaks rkbin's boot_merger HOT 5
- vkMapMemory fails in wine vkcube.exe
- Failed to start wps-office HOT 26
- Segmentation fault with cpython
- Unimplemented Opcode (66 0F 6F D1) 67 66 0F FE C8 66 0F 76 C5 66 0F 6F DC 66 0F
- Is it possible to regenerate `table64` for a dynablock? HOT 12
- Raspberry Pi 5 with Raspberry Pi OS may not run steam "steam-runtime-launcher-service crashes" HOT 2
- game Nox freeze at the launch screen
- error: only one operation may be used at a time HOT 3
- Security Warning: RISC-V CPUs from T-HEAD May Have Vulnerabilities on Several Extensions HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from box64.