Repository navigation
LATX: 修复 AVX 访存宽度和权限检查,新增严格掩码访存开关 - #573
Merged
LaurenIsACoder merged 3 commits intoDec 2, 2026
Merged
Conversation
Load exactly 64 bits for VCVTPS2PD xmm,m64 and VCVTDQ2PD xmm,m64 in the LSX translator, rather than touching the following eight bytes. Leave the 256-bit forms reading their full 128-bit source. Signed-off-by: Zhaoyang Xie <xie_zyang@163.com>
xiezyang
force-pushed
the
avx-memory-fixes-master
branch
2 times, most recently
from
December 2, 2026 06:39
5b690c4 to
efea52f
Compare
Always skip masked-off AVX2 gather elements in the LASX path and check read permission only for selected elements. Preserve each completed result and clear its mask element before attempting the next load, so a later fault can resume without repeating completed accesses. Apply the same permission and fault-progress rules to the LSX path. Keep gather behavior independent of the masked-memory option. Cover integer and floating-point gathers, both guest ABIs, mask combinations, protected addresses, page checks, partial-fault recovery, LSX and AOT. Signed-off-by: Zhaoyang Xie <xie_zyang@163.com>
xiezyang
force-pushed
the
avx-memory-fixes-master
branch
from
December 2, 2026 09:58
efea52f to
799d693
Compare
Add LATX_MASKED_MEMORY and -latx-masked-memory with a default of zero. Control continuous masked loads and stores: MASKMOVQ/DQU, VMASKMOVDQU, VMASKMOVPS/PD and VPMASKMOVD/Q. When enabled, skip all memory for a zero mask, use an exact-width vector access for a full mask, and access only selected elements otherwise. Keep the bulk read/filter and read-modify-write policy when disabled. Share the LSX and LASX mask implementations and delay committing load destinations until every selected load succeeds. Disable AOT when strict masked memory is enabled, following the SOFTFPU and MT option handling; a later AOT option cannot override this restriction. Keep the ordinary AOT cache names and verify that strict mode neither generates nor loads AOT caches, while ordinary mode still supports cold and hot AOT. Keep AVX2 gather fixes unconditional and verify their full fault-suppression and recovery matrix with either option value. Document the option's scope, AOT restriction and possible cost of splitting vector accesses into smaller accesses. Signed-off-by: Zhaoyang Xie <xie_zyang@163.com>
xiezyang
force-pushed
the
avx-memory-fixes-master
branch
from
December 2, 2026 11:34
799d693 to
c1ccd65
Compare
xiezyang
marked this pull request as ready for review
December 2, 2026 11:40
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 / 变更说明
本 PR 包含三个独立提交:
修正两条转换指令的读取宽度(
455ddde357d)VCVTPS2PD xmm,m64、VCVTDQ2PD xmm,m64改为读取指令要求的 8 字节,避免原来读取 16 字节时触及操作数之后的不可访问地址。让 Gather 默认只读取 mask 选中的元素(
9718a7214ad)LATX_MASKED_MEMORY。为连续地址的掩码读写添加可选开关(
c1ccd6525a8)LATX_MASKED_MEMORY=0/1和-latx-masked-memory参数,默认值为0,与LATX_MT独立。MASKMOVQ/DQU、VMASKMOVDQU、VMASKMOVPS/PD、VPMASKMOVD/Q。LATX_MT、LATX_SOFTFPU的处理,即使显式设置LATX_AOT=1或-latx-aot 1,也不能在严格掩码访存开启时重新启用 AOT。Validation / 验证
验证版本:
c1ccd6525a88f6712d0f296d10b9b905c54cace0。环境:LoongArch64 Linux、16 KiB 宿主页,覆盖 x86_64 和 i386 客户程序。运行时显式设置
LATX_SOFTFPU=0、LATX_SOFTFPU_FAST=0,并在两种客户架构的实际翻译入口确认均为 0。地址与页权限检查另行覆盖LATX_MT=0/1/2。ninja -j6lat-pr-fast专项覆盖 LASX、强制 LSX、掩码开关
0/1和LATX_MT=0/1/2:0:验证 JIT、冷 AOT 和热 AOT,通过实际加载标记确认缓存已加载。1:显式请求开启 AOT,验证仍按严格访存执行,不加载已有缓存,也不生成或修改 AOT 缓存。限制:完整权限异常和 Gather 异常恢复矩阵在 JIT 下验证;AOT 覆盖开关为
0时的结果和缓存加载。本轮未开展性能测量、真实应用验证、关闭 AVX 配置的重复构建或独立 4 KiB 宿主页环境验证。Checklist / 检查项
CONTRIBUTING.md. / 我已阅读CONTRIBUTING.md。git commit -s). / 每个提交都包含 DCO 签署(git commit -s)。