Skip to content

LATX: optimize AVX scalar physics patterns - #438

Open
luzeng87 wants to merge 3 commits into
lat-opensource:masterfrom
luzeng87:gb603-avx-patterns
Open

LATX: optimize AVX scalar physics patterns#438
luzeng87 wants to merge 3 commits into
lat-opensource:masterfrom
luzeng87:gb603-avx-patterns

Conversation

@luzeng87

Copy link
Copy Markdown
Contributor

Summary / 变更说明

This PR depends on #437. Until #437 is merged, GitHub also shows its prerequisite commit in this PR; the GB603-specific changes are the final two commits.

  • Write common VEX.128 results directly to the destination register and reduce redundant shuffle/copy operations.
  • Fold adjacent VCOMIS*/VUCOMIS* plus JCC sequences while preserving ordered and unordered floating-point behavior.
  • Fold repeated scalar additions and the six AVX three-lane sum groups found in Geekbench 7 workload 603.
  • Match instruction and register relationships only; there is no program-address check and no Geekbench-specific runtime switch.
  • Reject the sum3 pattern unless all skipped result registers are overwritten before any later use.
  • Add native x86, LAT JIT, cold-AOT, and hot-AOT semantic tests for every new pattern.

This change does not modify the AOT cache identity or enable LAT --optimize-O2.

Performance / 性能

3A6000-25G, Geekbench 7 geekbench_avx2, workload 603, GCC 8.3.0 -O2 -g, LAT --optimize-O1:

  • Previous optimized baseline: hot AOT 626-629.
  • This clean branch: cold AOT 613; hot AOT 644.
  • AOT was considered ready only after 5 files totaling 14,932,326 bytes remained unchanged for eight checks.
  • Same-machine non-AVX reference: hot AOT 644.

The clean branch excludes jump-cache, profiler, AES/VAES, and AOT build-identity changes.

Validation / 验证

  • Clean x86_64 LAT build passed (407/407 build steps).
  • Clean i386 LAT build passed (407/407 build steps).
  • meson test -C build64-pr --suite lat-pr-fast: 24 passed, 0 failed.
  • avx128-shuffle.S, avx-sum3-pattern.S, repeat-add.S, and vcomis-jcc.S: native x86, LAT JIT, cold AOT, and hot AOT all passed with non-empty AOT files.

Checklist / 检查项

  • I have read CONTRIBUTING.md. / 我已阅读 CONTRIBUTING.md
  • Every commit contains a DCO sign-off (git commit -s). / 每个提交都包含 DCO 签署。
  • I have included relevant build, test, and performance results. / 我已提供相关构建、测试和性能结果。

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>
Signed-off-by: Lu Zeng <luzeng87@gmail.com>
Signed-off-by: Lu Zeng <luzeng87@gmail.com>
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