Skip to content

LATX, AVX: remove redundant VPSHUFB index masking - #450

Closed
luzeng87 wants to merge 1 commit into
lat-opensource:masterfrom
luzeng87:avx-byte-shuffle
Closed

LATX, AVX: remove redundant VPSHUFB index masking#450
luzeng87 wants to merge 1 commit into
lat-opensource:masterfrom
luzeng87:avx-byte-shuffle

Conversation

@luzeng87

@luzeng87 luzeng87 commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Summary

  • pass the original VPSHUFB control vector directly to XVSHUF.B because ignored control bits do not affect lane selection
  • retain explicit sign-bit zeroing for dynamic controls
  • omit the sign-mask path when an immutable RIP-relative control table contains no zeroing entries

Validation

  • clean 3A6000 build: passed
  • lane selection and sign-bit zeroing over 100,000 deterministic input sets: passed
  • JIT, cold AOT, and hot AOT: passed with a non-empty AOT file
  • git diff --check: passed

Signed-off-by: Lu Zeng <luzeng87@gmail.com>
@luzeng87

luzeng87 commented Sep 3, 2026

Copy link
Copy Markdown
Contributor Author

A standalone VPSHUFB property test covering 100,000 source/control combinations fails in JIT as soon as the index mask is removed. The read-only-memory specialization is also unsafe because a translated block can outlive the sampled memory contents. Closing this optimization; neither path is correct as submitted.

@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
@luzeng87

luzeng87 commented Sep 3, 2026

Copy link
Copy Markdown
Contributor Author

Closed after a standalone VPSHUFB property test found incorrect control-byte handling. It is not included in any grouped PR.

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