Skip to content

Avx correctness - #468

Draft
xiezyang wants to merge 10 commits into
lat-opensource:masterfrom
xiezyang:avx-correctness
Draft

Avx correctness#468
xiezyang wants to merge 10 commits into
lat-opensource:masterfrom
xiezyang:avx-correctness

Conversation

@xiezyang

@xiezyang xiezyang commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Summary / 变更说明

Validation / 验证

Checklist / 检查项

  • I have read CONTRIBUTING.md. / 我已阅读 CONTRIBUTING.md
  • Every commit contains a DCO sign-off (git commit -s). /
    每个提交都包含 DCO 签署(git commit -s)。
  • I have included relevant build or test results, or explained why they
    are not applicable. /
    我已提供相关构建或测试结果,或说明了不适用的原因。

Install the complete load/store exception mapping, replace hardware flags on load, honor guest exception masks without the x87 diagnostic override, and clear stale Cause. Preserve MMX state around the status helper.

No software Denormal-input detection is introduced. Includes emitter-model and x86 guest regression tests. The 524,288-case host model passes; LoongArch execution is pending.

Reorganized from 8235cda, 6aa7692 and 73d84958d8.
Keep VCVTPS2PH register upper lanes clear and propagate helper exception status into MXCSR without clobbering MMX. Register the helper's AOT relocation together with its use.

Use the final implementation without the redundant per-lane clear. Reorganized from d636626, 79d1b38 and d4012d8f19; no behavior change relative to ef9dde911e.
Decode the equivalent W=0 bytes for Capstone and restore the original W bit and instruction bytes in IR1. Reorganized from 01b000d.

Also retain the final scalar-compare assertion indentation; that line has no semantic change. All content matches the corresponding paths in ef9dde911e.
Use the full-width copy in the zero-offset path. Reorganized from 9c3aaaa without changing the final implementation.
Retain the boundary correction from 8e22df5 as an independent integer-instruction fix.
Introduce the final scalar/packed classification helper and use it for add, subtract, multiply, divide, square root and reciprocal estimates. Preserve original sources for NaN payload/sign selection and confine scalar repair to the active lane.

Include the 12,600-case host emitter model. The optimized implementation is introduced directly: no per-lane predecessor, FCMP-based repair or software Denormal-input detection is added.

Arithmetic/helper portions reorganized from d0b2f2a, 4aad1fa, f034607, 94ab1c9239 and ef9dde911e. FMA and reductions follow separately. Runtime validation remains pending.
Connect scalar, packed and mixed add/sub FMA paths to the final shared NaN repair. Keep original inputs available across sign changes and destination/source aliases, including third-source aliases.

Export the helper together with its cross-file callers and remove superseded in-line negative-FMA NaN handling. Reorganized from d0b2f2a, b5fb772 and 9e8638a; final behavior matches ef9dde911e.
Repair addition and subtraction lanes using their preserved original operands before reassembling the result. Introduce the final temporary-lifetime arrangement directly, rather than adding and later repairing the higher-pressure implementation.

VADDSUB portions reorganized from d0b2f2a, 8586113, 4aad1fa and f034607. Final code matches ef9dde911e; runtime alias/NaN testing remains pending.
Apply the shared repair to VHADD and VHSUB using the shuffled original inputs at both vector widths. Keep this integration separate from VADDSUB and dot-product reduction.

Horizontal-arithmetic portion reorganized from d0b2f2a; final implementation matches ef9dde911e.
Repair multiplication and reduction results using the original selected inputs. Preserve masked output lanes and use the final in-place VDPPD shuffle strategy to limit vector temporary pressure.

Dot-product portions reorganized from d0b2f2a, 4aad1fa and f034607, retaining the classification helper from ef9dde911e. No scalar predecessor or Denormal-input detector is introduced.
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