compute: lower 64-bit integer VOPC compares in direct compute #3210
No reviewers
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!3210
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3208"
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?
@Leyukaka on GitHub · 2026-11-27 21:46 UTC · original
Leyukaka:vcmp-i64→main· +202 −0 · 4 files · 1 commits · merged 2026-11-27 22:07 UTCFixes #3209. Part of #2935. Target branch
main.Change (
src/gfx1013_direct_compute.inl): direct compute lowersv_cmp_{eq,ne,lt,le,gt,ge}_{i64,u64}, in the e32, e64 andv_cmpxforms.icmp(signed or unsigned predicate), and the lane mask is written like the 32-bit compares.v_cmpxwrites EXEC through the decoder's EXEC destination.Tests. The setup was Windows 11 build 26300.9974 with an NVIDIA GeForce RTX 5080 (driver 32.0.16.2101) and DXC from the Windows SDK 10.0.26100, on
maincf3df832plus this commit.native_vopc_cmp64_hardware(new) runs 10 cases that together cover eq, ne, lt, le, gt and ge, signed and unsigned, and the e32, e64 and cmpx forms. Its sources are SGPR/VGPR pairs with nonzero high words (including a sign-bit-only difference) and inline -1. The masks, per-lane selects on VCC and guards are checked against a CPU reference.native_direct_containerand thenative_salu_cmp64*tests pass.native_vopc_cmp64_hardware:Measured on a local capture (counts and instruction shape only) with
compile_dxil --jobs 8 gfx1013-direct-cs@36 --requestsonmain9e7eab5b.v_cmp_ne_i64_e32 vcc_lo, s[N:N+1], v[6:7](s[10:11] in 7 of them, s[8:9] and s[12:13] in one each).9e7eab5band the change oncf3df832; the one extra compiled request between the two (405 to 406) comes from #3148, which sits between them.AI-assisted.
v_cmp_{eq,ne,lt,le,gt,ge}_{i64,u64} (e32, e64 and v_cmpx) were refused as "direct comparison width". Both sources are now read as 64-bit values (an SGPR pair, a VGPR pair, or an inline constant sign-extended to 64 bits for both i64 and u64) and compared with an i64 icmp; the lane mask is written like the 32-bit compares. A 32-bit literal source stays refused, as do source modifiers and subword forms. native_vopc_cmp64_hardware covers eq/ne/lt/le/gt/ge, signed and unsigned, e32, e64 and cmpx, SGPR/VGPR pairs and inline -1 against a CPU reference, and checks that literal sources are refused. AI-assisted.@pigalot on GitHub · 2026-11-27 22:06 UTC · original · approved these changes
I reviewed
94e1d579merged over currentmain5b5e36ee. The merge is clean (treede82d908) andgit diff --cached --checkis clean.What I traced.
float_aluand before the generic VOPC path, and only for names ending in_i64or_u64in compute. So the 32-bit and float compares are unchanged.v_cmp_f_i64andv_cmp_t_i64still refuse with the same message as onmain("direct comparison width").zext(lo) | zext(hi) << 32;i64andu64, which matches how RDNA treats inline constants on 64-bit operands;vcc,exec, odd SGPRs, and DPP or SDWA (250 and 249 fall through to the operand refusal, or are caught assubword).icmp eq/ne/slt/sle/sgt/sgeor theuforms. The mask goes throughwrite_ballot, as the 32-bit compares do, andv_cmpxgets EXEC as its destination from the decoder.ir.features |= 1048576is the same Int64 flag the existing 64-bit paths set.What I ran.
dev: full build, then3/3 CPU tests (
native_direct_container,native_salu_cmp64_controls,native_salu_cmp64_ir) and 2/2 hardware tests (native_vopc_cmp64_hardware,native_salu_cmp64_hardware) pass, with no skips.release/O2: builtcompile_dxil,native_store_replayandnative_compute_ir_dump, then ran the same five tests. 5/5 pass.Mutants, each rebuilt in
devand run againstnative_vopc_cmp64_hardware(the unmutated baseline passes first):Restored and rebuilt afterwards;
git diff --quietis clean.Non-blocking.
negon an integer compare would silently ignore it. One e64 case withnegset in the refusal list would pin it.src0and a VGPR pair insrc1. A VGPR pair insrc0, or an SGPR pair in the e64src1, goes through the sameinputlambda, so I expect no difference, but neither is exercised.Verdict: approve on
94e1d579.Environment: NVIDIA GeForce RTX 5090 driver 32.0.16.1088; Windows 11 25H2 build 26200.9974; MSVC 19.52.37029; DXC 1.9.2602.17; Python 3.12.10; wave32; debug layer off.
CI:
Build and test on Windows,Assemble and translate gfx1013 fixturesandRun platform-independent Python checks on Linuxpass on94e1d579.This reply was AI-assisted.
github-bot referenced this pull request2026-12-02 05:36:25 +00:00