cpu: lower AVX conversions, compares, flag tests, and aligned/streaming moves #387
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/393"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from R0Y00/Xbox2Windows. Originally posted by Vonsek on 2026-11-22T00:13:21Z.
Change
tools/ffx_version_query.py:vcvtdq2ps,vcvtdq2pd,vcvtps2dq,vcvtpd2dq,vcvttps2dq,vcvttpd2dq,vcvtps2pd,vcvtpd2psvcvtsi2ss,vcvtsi2sd,vcvtss2sd,vcvtsd2ss,vcvtss2si,vcvttss2si,vcvtsd2si,vcvttsd2si(with 32-bit and 64-bit integer-indefinite clamping)vcmpps,vcmppd,vcmpss,vcmpsdvptest,vtestps,vtestpdvmovaps,vmovapd,vmovdqa,vlddqu,vmovntdqaEncodingKind.VEX(rejecting EVEX encodings) and zero upper YMM bytes for 128-bit XMM destinations.OSXSAVE) and 28 (AVX) plus XCR0 XMM/YMM state before invoking the native fixture (exiting 77 withSKIP_RETURN_CODE 77on hosts without AVX).tests/cpu/avx_cvt_cmp_test.{asm,def,py}, CMake targetcpu_avx_cvt_cmp_test_lifted, CTestcpu_aot_avx_cvt_cmp_test, coverage mapping intools/form_coverage.py, and documentation indocs/experiments.md.Verification
cmake --build --preset dev --target cpu_avx_cvt_cmp_test_lifted:ValueError: unsupported query operation at 0x1000: vmovdqa ymm1,ymmword ptr [rcx]cmake --build --preset dev --target cpu_avx_cvt_cmp_test_liftedsucceeded with 0 warningsctest --preset dev --no-tests=error -R "^(cpu_aot_avx_cvt_cmp_test|cpu_aot_bmi1)$" -V: 2/2 passed (33 AVX conversion/compare/test/move cases matched native and translated DLLs+ EVEXvcvtdq2psrejection control).\out\pe-env\Scripts\python.exe -B tests/form_coverage_check.py:form coverage checks passedEvidence and follow-up
AVX-grouped mnemonics indocs/coverage/x64_zen2.tsvusing source-built fixtures, gated by a runtime CPUID/XCR0 check.Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-22T00:25:32Z.
Review: COMMENTED
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit:
eb126f7db1ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-22T00:19:37Z.
Codex Review Summary: ✅ Completed
This comment shows the latest Codex review activity on this pull request.
eb126f7ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-23T18:24:44Z.
I updated this branch after #407 landed and kept both test fixtures. The conversion paths use Windows intrinsics for MXCSR-controlled rounding, and the compare path uses all five predicate bits. The original vs generated fixture exercises all four rounding modes and verifies that the signaling predicate sets the masked invalid flag. The streaming VMOVNTDQA form stays outside this patch; the VLDDQU case remains covered.
On Windows with MSVC 19.51, the Release AVX conversion/compare, scalar FP, and shuffle/blend CTests all ran and passed (3/3). The branch is ready for Windows CI.
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-23T18:40:46Z.
The Windows failures were two stale rejection assertions. The original VEX.128 store now checks that its misalignment branch precedes the write, and the conversion test rejects a masked EVEX form while the new AVX fixture still compares supported YMM conversions against native execution. The unsupported legacy cases are still tested. All three affected Windows Release CTests now pass locally. The new head needs both Windows jobs again.
Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-22T00:25:32Z.
Code review location:
tools/ffx_version_query.py; line 37When the caller selects a non-default MXCSR rounding mode, this helper still rounds every non-truncating conversion to nearest/even. In a standalone Linux/x64 check using this header, round-toward-zero made native
vcvtsd2siconvert1.75to1, whilecvt_to_i32andcvt_to_i64returned2. The same helper backsvcvtps2dq,vcvtpd2dq,vcvtss2si, andvcvtsd2si, so these instructions silently produce incorrect numeric results outside the default rounding mode. Honor MXCSR.RC and add differential cases for the other rounding modes.Useful? React with 👍 / 👎.
Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-22T00:25:32Z.
Code review location:
tools/ffx_version_query.py; line 304For NaN operands, predicate bit 4 distinguishes quiet and signaling comparisons even when their result masks are identical. For example,
vcmppswith immediate 31 (TRUE_US) must set MXCSR's invalid-operation status and raise an exception if it is unmasked, but masking with 15 selects the literaltrue, so the generated code performs no floating-point comparison. A standalone Linux/x64 check with quiet NaNs produced native exception status0x01versus lowered status0x00, despite matching result masks. Preserve the signaling behavior, or reject predicates whose exception semantics are not implemented.Useful? React with 👍 / 👎.