Skip to content

LATX, AVX: reduce temporary vectors in instruction lowering - #448

Closed
luzeng87 wants to merge 6 commits into
lat-opensource:masterfrom
luzeng87:avx-conversion-destination
Closed

LATX, AVX: reduce temporary vectors in instruction lowering#448
luzeng87 wants to merge 6 commits into
lat-opensource:masterfrom
luzeng87:avx-conversion-destination

Conversation

@luzeng87

@luzeng87 luzeng87 commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Summary

Group small AVX lowering changes that remove temporary vectors without changing architectural results:

  • write packed float-to-integer conversions directly to the destination
  • use direct saturating narrowing and rounded multiply instructions
  • avoid redundant copies in extract, insert, and broadcast translations
  • write VPBLENDVB directly to its destination
  • use direct widening multiply-add sequences for VPMADDWD and VPMADDUBSW
  • write byte shifts and immediate shuffles directly when aliases permit

Correctness

Each lowering keeps an alternate temporary path where source/destination overlap requires it. Tests cover aliasing, MXCSR rounding modes, saturation boundaries, NaN and overflow inputs, lane selection, and VEX.128 upper-half clearing.

Validation

  • individual instruction fixtures: passed on native x86 and LoongArch
  • JIT, cold AOT, and hot AOT modes: passed with non-empty AOT files
  • deterministic packing and multiply fixtures: 100,000 input sets passed
  • DCO sign-offs present on all commits

This PR supersedes the separate narrowing, vector-copy, blend, multiply-add, and shuffle PRs. It remains a draft while grouped checks run.

Signed-off-by: Lu Zeng <luzeng87@gmail.com>
@luzeng87
luzeng87 marked this pull request as draft September 3, 2026 03:06
Signed-off-by: Lu Zeng <luzeng87@gmail.com>
Signed-off-by: Lu Zeng <luzeng87@gmail.com>
Signed-off-by: Lu Zeng <luzeng87@gmail.com>
Signed-off-by: Lu Zeng <luzeng87@gmail.com>
Signed-off-by: Lu Zeng <luzeng87@gmail.com>
@luzeng87

luzeng87 commented Sep 3, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by the consolidated #438 draft. Its AVX lowering changes and focused alias, rounding, saturation, multiply, and shuffle tests are retained there.

@luzeng87 luzeng87 closed this Sep 3, 2026
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