LATX, opt: Extend GHBR optimization across user-mode translation #498
Rebase validation for 5a48356c824 on 5e52e497307 (LoongArch Linux)
| Command | Result |
| --- | --- |
| meson test -C build64 --suite lat-pr-fast --print-errorlogs | 55/55 passed |
| meson test -C build32 --suite lat-pr-fast --print-errorlogs | 44/44 passed |
| meson test -C build64 --suite latx-integration 'test-latx-ghbr-' 'test-latx-hbr-' test-redundant-xvldi | 17/17 passed |
| meson test -C build64 --suite latx-integration 'test-rip-relative-cache-*' | 5/5 passed |
| meson test -C build32 --suite latx-integration test-latx-lea-i386-addr16 | 1/1 passed |
The x86-64 guest fixtures were compiled on x86-64 Linux and supplied to the runners on LoongArch. All ten GHBR fixtures passed JIT and cold/hot AOT execution, with the hot run confirming that the guest's cache loaded. Both IR2 passes and upstream's address-temporary release are retained. Upstream already carries the GLib declarations and broader AOT truncation coverage.
ganjue66da
Summary / 变更说明
Extend user-mode LATX GHBR optimization across GPR writeback, implicit multiply/divide inputs, conditional definitions, fused AND/IMUL patterns, bit-scan results, and redundant IR2 zero extensions. Add a semantic inventory, JIT/AOT regression coverage, and opt-in GHBR statistics.
Preserve architectural state at guest exception points: potentially faulting instructions make all GPR high halves live before their destination definitions. MULXQ explicitly reads the RDX high half. A completed CMOVcc r32 clears the destination high half on both condition outcomes; CMPXCHG retains its conditional-definition model. Unknown IR2 operations reset tracked zero state, and external TU successors retain the full live-register fallback.
Validation / 验证
Validated head:
3c07c8eda7054b3b5c9627028e461f51a105fe6f, based on currentmasterat5e52e497307d34c23479731095fc86f6074c3b3d. Rebase reports the branch is up to date.On a LoongArch host:
lat-pr-fast: 55/55 passed, no skips or timeouts.The test environment supplies the existing Clang UBSan standalone runtime through
LIBRARY_PATHandLD_LIBRARY_PATHfor the sanitizer-enabled callback test; sanitizer instrumentation remains enabled.Guest artifacts are checked against source and binary SHA256 manifests.
git diff --checkpassed; checkpatch reports no errors and one new-file MAINTAINERS advisory.SPEC performance has not been rerun after adding the exception-state constraints; the previous performance benefit is not claimed for this candidate. This validation does not constitute exhaustive coverage of all instructions or asynchronous signal/debug paths.
Checklist / 检查项
CONTRIBUTING.md. / 我已阅读CONTRIBUTING.md。