LATX, AVX: defer redundant VEX.128 upper-half clears - #437
Conversation
Track VEX.128 destinations whose architectural YMM high halves are known to be zero, and materialize those clears only when a 256-bit operation can observe them or before leaving the TB. This removes repeated LASX clear instructions while preserving signal, JIT, TU, and AOT-visible state. Add a standalone JIT, cold-AOT, and hot-AOT semantic test for the deferred state. Signed-off-by: Lu Zeng <luzeng87@gmail.com>
xiezyang
left a comment
There was a problem hiding this comment.
该改动会导致部分 YMM 指令的结果未写回目标寄存器,建议修复后再合入。
- VMASKMOVPS/PD 的 YMM 寄存器目标路径只在 XMM 情况下执行 temp -> dest,导致低 128 位保留旧值,高 128 位被错误清零。
target/i386/latx/translator/tr-avx-mov.c - VPBLENDVB/W 存在相同问题。
target/i386/latx/translator/tr-avx.c
建议无条件将 temp 写回 dest,仅在 XMM 形式调用 set_high128_xreg_to_zero(dest)。
Signed-off-by: Lu Zeng <luzeng87@gmail.com>
|
Updated with commit 7be22ce to fix the Geekbench 101 hot-AOT crash. Diagnosis:
Fix:
Validation on 3A6000 @ 2.5 GHz:
|
|
Correctness recheck found reproducible YMM failures on this head. Repairing the three missing temporary-to-destination writes is not sufficient: the mixed XMM/YMM state regression still fails in a clean LoongArch build. This broad deferred-state change is not safe to merge; closing it rather than adding more fixes to the stack. |
Signed-off-by: Lu Zeng <luzeng87@gmail.com>
|
Added commit 3dabdd4 to restore full-width destination writeback for YMM VMASKMOVPS/VMASKMOVPD, VPBLENDVB, and VPBLENDW. The earlier deferred-zeroing change incorrectly made the destination copy conditional on an XMM destination and then applied upper-half clearing to YMM destinations. Validation on LoongArch 3A6000:
The PR remains a draft while the wider AVX deferred-zeroing cases are reviewed. |
Summary
Validation
Signed-off-by: Lu Zeng luzeng87@gmail.com