cpu: PF after the VEX scalar compares in the shared lowering (SETP/SETNP/CMOVP/CMOVNP/JP/JNP) #1153
Labels
No labels
accessibility
awaiting author
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
priority: P0
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/R0Y00--Xbox2Windows#1153
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
@legacy-code-archaeologist on GitHub · 2026-11-24 01:51 UTC · original
Claim and design question: PF after the VEX scalar compares in the shared lowering
setnp,cmovpandcmovnp(Integer group ofdocs/coverage/x64_zen2.tsv) have no passing fixture. Intools/ffx_version_query.py:unorderedand assignparity = unordered, but only when the function declares PF. Today that is only a checked x87 function that reads PF (theparity = x87_depth is not None and …rule).Compilers emit exactly this pattern for float equality and NaN tests, for example
vucomiss xmm0, xmm1; setnp al; sete cl; and al, clfora == b, orjpto a NaN path. So AVX code with float comparisons stops there. I found no open issue or PR about it and would like to take a first increment.Proposed rule
parityin any function whose body contains a PF consumer: JP, JNP, SETP, SETNP, CMOVP or CMOVNP, in addition to today's x87 rule.parity = unordered);x87_lower.check_flags;parity = false).write(parity)/write(!parity), and CMOVP/CMOVNP like the other CMOVcc, including the 32-bit zero extension when the condition is false.Proposed fixture (source-built MASM, differential,
; coverage: source cpu_aot_parity)Exports:
setnp/sete/andequality idiom.Inputs, chosen at run time: ordered pairs, equal values, ±0, ±infinity, quiet and signaling NaNs in either operand. Native and translated results must match, flags included.
Refusals (named diagnostics):
Controls (mutated C++):
noparity(PF always false) andswap(P and NP exchanged) must fail. Also an/O2build and both presets.Question: is extending PF to these consumers after the VEX compares the scope you want for a first PR? I'd leave PF from ordinary ALU results out, as a separate step, because it touches every integer flag producer.
Test host: Intel Skylake (i7-6820HQ) on Windows 11 26100.
AI-assisted (Claude Code).
@R0Y00 on GitHub · 2026-11-24 02:02 UTC · original
Please take the PF consumer slice. Accept each consumer where the existing control-flow and flag analysis proves the reaching PF definition, including the four VEX compares and the already modeled x87 producers. Preserve the current refusal when the producer is unmodeled, undefined or ambiguous at a join.
Test the ordered/equal/unordered flags under a documented masked MXCSR setup, with both quiet and signaling NaNs in each operand. Keep existing floating-point exception behavior outside that fixture scope. Check both outcomes of CMOVP/CMOVNP, including upper 32-bit clearing for a 32-bit destination and the existing memory-read/fault behavior. The proposed stale-PF and reversed-condition controls should both fail. Include the independent Windows native versus translated and /O2 runs.
Intel instruction set reference
@R0Y00 on GitHub · 2026-11-24 03:42 UTC · original
Implemented in #1193. The source-built Release test matched native flags and memory-source behavior on the tested VEX and x87 paths, including ordered and unordered inputs. The /O2 result also matched. The stale and reversed parity controls produced the expected mismatches, and paths without a modeled reaching PF definition were refused.