latx: add opt-in Quicktrans fast translator - #434
Open
rmjskhy wants to merge 2 commits into
Open
Conversation
Signed-off-by: liuchaoyi <liuchaoyi@loongson.cn>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary / 变更说明
--enable-latx-fast-translator。默认不编译 Quicktrans;使用./latxbuild/build64.sh -f时才编译。LATX_FAST_TRANSLATOR=1才会启用快速翻译。tr_disasm()解码和翻译。LATX_FAST_TRANSLATOR_STRICT=1下,Quicktrans 翻译失败时立即停止,便于查找尚未支持的指令。LATX_FAST_TRANSLATOR_TRACE_MISSES=1下,打印 Quicktrans 的失败位置、阶段和原因,并说明老解码器能否接受该指令。option_aot和option_load_aot的默认值设为0,避免默认生成或加载 Quicktrans 尚未支持的 AOT 代码。target/i386/latx/translator/中原有的指令翻译函数。Validation / 验证
执行了以下构建和测试:
在 x86 主机执行
make -j2,确认latx-base-test已正确编译。在 LoongArch 主机执行默认构建:
在 LoongArch 主机执行快速翻译构建:
./latxbuild/build64.sh -c -f
完整构建通过,Quicktrans 生成器和一致性检查均通过。
在 Quicktrans 仓库执行:
make test
所有测试通过。
使用 smoke-exit 验证快速翻译入口,日志确认指令实际进入 Quicktrans,程序正常退出。
使用独立的临时 HOME 运行快速翻译版本。未设置 LATX_AOT 时没有生成 AOT 文件,确认 option_aot 和 option_load_aot 默认关闭。
执行 latx-base-test daily 测试:
LATX_FAST_TRANSLATOR=1 ./run-tests.py
--latx /mnt/disk_a/lat-github/lat/build64/latx-x86_64
--tier daily -j 2
结果:
instr-retf 在关闭 Quicktrans 后仍以相同方式失败,输出为
FAIL:retfq_target 和 FAIL:retfq_rsp,确认它是目标分支原有问题,不是本次修改引入。
git diff --check 通过。
Checklist / 检查项
I have read CONTRIBUTING.md. / 我已阅读 CONTRIBUTING.md。
Every commit contains a DCO sign-off (git commit -s). /
每个提交都包含 DCO 签署(git commit -s)。
当前提交尚未包含 Signed-off-by。需要由提交作者确认并使用
git commit --amend --signoff 补充 DCO 签署。
I have included relevant build or test results, or explained why they
are not applicable. /
我已提供相关构建或测试结果,或说明了不适用的原因。