cpu: lower VEX.256 packed single-precision min and max #381
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/387"
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:04:27Z.
Change
tools/ffx_version_query.py:vmovupdvaddps,vsubps,vmulps,vdivps,vsqrtps,vminps,vmaxps,vaddpd,vsubpd,vmulpd,vdivpd,vsqrtpd,vminpd,vmaxpdvandps,vandnps,vorps,vxorps,vandpd,vandnpd,vorpd,vxorpdvaddsubps,vhaddps,vhsubps,vaddsubpd,vhaddpd,vhsubpdvmovmskps,vmovmskpdEncodingKind.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_packed_fp.{asm,def,py}, CMake targetcpu_avx_packed_fp_lifted, CTestcpu_aot_avx_packed_fp, coverage mapping intools/form_coverage.py, and documentation indocs/experiments.md.Verification
cmake --build --preset dev --target cpu_avx_packed_fp_lifted:ValueError: unsupported query operation at 0x1008: vaddps ymm0,ymm1,ymm2cmake --build --preset dev --target cpu_avx_packed_fp_liftedsucceeded with 0 warningsctest --preset dev --no-tests=error -R "^(cpu_aot_avx_packed_fp|cpu_aot_bmi1)$" -V: 2/2 passed (30 AVX 256-bit packed FP cases matched native and translated DLLs+ EVEXvaddpsrejection 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:15:16Z.
Review: COMMENTED
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit:
adbc413a36ℹ️ 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:07:32Z.
Codex Review Summary: ✅ Completed
This comment shows the latest Codex review activity on this pull request.
adbc413ℹ️ 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-23T08:20:08Z.
I assembled the original MASM fixtures from this PR and #382 and tested their exports through
cpu_switch_aot.translate_peatd2ac415. The shared entry rejected all 30 exports here and all 22 in #382. That leaves both sets of fixtures useful. Please start this queue with a narrow packed-min/max slice for #387, using the shared lowering and a native bit comparison for one width. Include the DAZ-on subnormal second-operand case from the existing review and both operand orders. The aligned SSE moves and the broader #382 conversion set can keep their own review.Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-23T14:45:06Z.
Independent Windows result on an i9-14900HX with MSVC 19.51 /Od and /O2: the source-built 256-bit VMINPS/VMAXPS returned 0x00000000 for (+0, 0x00000001) with MXCSR 0x1fc0, while the scalar conditional returned 0x00000001. Reversing the operands returned zero in both. Across 64 output words per build (both operations, both orders, DAZ on/off, signed subnormals, zeros and distinct qNaNs), the conditional differed in 10 words. Two 128-bit MINPS/MAXPS intrinsics applied in source order matched all 64. That gives us a Windows oracle for the packed single-precision min/max slice.
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-23T15:29:28Z.
Maintainer update at
cedf64f: resolved the conflict with the now-merged #395 and kept this slice to register-form VEX.256VMINPSandVMAXPS. The original MASM comparison remains in place. Two SSE halves preserve source order, including when DAZ is enabled. The fixture checks 64 exact word observations covering signed subnormals, signed zero, NaN and both operand orders, and rejects the unsupported memory form.ctest --preset <dev|release> --no-tests=error -R '^cpu_aot_(avx_packed_fp|avx_packed_int|float_packed|sse34_fp)$'passed 4/4 in each preset. Windows CI is now running on the updated branch. The other floating-point forms can be assessed with their own native evidence.Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-22T00:15:16Z.
Code review location:
tools/ffx_version_query.py; line 304When the caller enables MXCSR.DAZ, these comparisons treat subnormal inputs as zero, but the subsequent selection and
memcpyretain the original subnormal bits. Native VMIN/VMAX also apply DAZ to the returned operand: with MXCSR0x1fc0, lhs+0.0f, and rhs bits0x00000001, nativevminpsreturns0x00000000, while the generated loop returns0x00000001. This mismatch reproduces with the emitted lowering compiled unoptimized using GCC 13 and Clang 17 on x86-64 Linux, and affects both PS/PD and both vector widths. Use min/max intrinsics that preserve the instruction semantics, or explicitly normalize operands according to MXCSR, and add a DAZ-enabled differential case.Useful? React with 👍 / 👎.