Skip to content

LATX, AVX: avoid loading overwritten VPMOVSX destinations - #445

Draft
luzeng87 wants to merge 1 commit into
lat-opensource:masterfrom
luzeng87:avx-vpmovsx-pure-dest
Draft

LATX, AVX: avoid loading overwritten VPMOVSX destinations#445
luzeng87 wants to merge 1 commit into
lat-opensource:masterfrom
luzeng87:avx-vpmovsx-pure-dest

Conversation

@luzeng87

@luzeng87 luzeng87 commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Summary

  • allocate VPMOVSX destinations without loading their previous YMM contents
  • preserve source upper-half state when source and destination differ
  • add an x86-64 assembly regression covering aliased and distinct registers

VPMOVSX fully overwrites its destination. Loading the old destination can materialize upper-half state that the extension immediately replaces.

Validation

  • clean LoongArch release build with GCC -O2 and LATX optimize O1
  • native x86-64 assembly fixture: pass
  • LATX JIT: pass
  • LATX cold AOT: pass, non-empty AOT file generated
  • LATX hot AOT: pass

Signed-off-by: Lu Zeng <luzeng87@gmail.com>
@luzeng87
luzeng87 force-pushed the avx-vpmovsx-pure-dest branch from 4b69fe7 to 8331caa Compare September 2, 2026 10:45
@luzeng87

luzeng87 commented Sep 3, 2026

Copy link
Copy Markdown
Contributor Author

Correctness review found that the production change is in translate_vaddsubpd(), while the PR and test describe VPMOVSX. Moving the allocation change to translate_vpmovsxxx() then fails the destination/source alias case in a clean LoongArch JIT, cold-AOT, and hot-AOT check. Closing this PR instead of merging a mis-targeted or unverified optimization.

@luzeng87 luzeng87 closed this Sep 3, 2026
@luzeng87 luzeng87 reopened this Sep 3, 2026
@luzeng87
luzeng87 marked this pull request as draft September 3, 2026 03:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant