Document the LoongArch LSX lane trap and testing under qemu

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
This commit is contained in:
Henrik RydgårdandClaude Opus 5.5 committed 2026-09-24 15:42:38 -06:00
1 parent 79e4568e50
commit 8f804d6f0f
2 files changed
+23

No files matched your search

@@ -63,6 +63,9 @@ public:
LoongArch64Gen::LoongArch64Reg R(IRReg preg); // Returns a cached register, while checking that it's NOT mapped as a pointer
LoongArch64Gen::LoongArch64Reg RPtr(IRReg preg); // Returns a cached register, if it has been mapped as a pointer
// With LSX, a group of four lanes can be mapped as one vector reg, and then F() returns that same
// reg for every lane. So F(x + 1) isn't a separate register, and code that writes lanes one by one
// has to fall back to CompIR_Generic under LSX, or it overwrites lane 0.
LoongArch64Gen::LoongArch64Reg F(IRReg preg);
LoongArch64Gen::LoongArch64Reg V(IRReg preg);
+20
View File
@@ -174,6 +174,26 @@ That's normal and not a test failure - read the `N tests passed, N tests failed`
See docs/pspautotests.md for a workflow for running pspautotests and improving PPSSPP with the results.
### LoongArch64 and RISC-V JITs under qemu
CI tests these JITs by cross-building headless and running pspautotests under qemu-user, and you can do the
same on Linux (packages: `gcc-14-loongarch64-linux-gnu g++-14-loongarch64-linux-gnu qemu-user`, or the riscv64
equivalents):
```bash
./b.sh --loongarch64 PPSSPPHeadless # builds into build-loongarch64/
mkdir -p build-qemu
printf '#!/bin/bash\nexec qemu-loongarch64 -L /usr/loongarch64-linux-gnu "$(dirname "$0")/../build-loongarch64/PPSSPPHeadless" "$@"\n' > build-qemu/PPSSPPHeadless
chmod +x build-qemu/PPSSPPHeadless
python3 test.py -g --graphics=software --cpu=jit-ir --timeout=60 --known-failures=loongarch64
```
`test.py` runs the most recently modified `build*/PPSSPPHeadless`, so `touch` the shim after rebuilding the real
binary, or it runs your native build instead. The full suite takes a couple of minutes.
qemu reports LSX and LASX as present, so CI only exercises the LoongArch vector paths.
The scalar fallbacks never run here, so passing tells you nothing about them.
## Quick rebuild on Linux
You don't need to do ./b.sh --debug to verify every single little change, instead use this shortcut: