direct compute: first binary64 arithmetic slice (v_add_f64, v_mul_f64, v_fma_f64)? (scope question) #3520
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#3520
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-29 21:15 UTC · original
Part of #2935. A per-opcode probe of the VOP3 names in
src/gfx1013_isa_tables.inlonmainff9dcef0(the same probe as #2985) shows that the binary64 VALU family is the largest group the direct compute path still refuses withdirect DXIL lowering for <name>:v_add_f64,v_mul_f64,v_fma_f64,v_min_f64,v_max_f64,v_ldexp_f64;v_div_scale_f64,v_div_fmas_f64,v_div_fixup_f64, andv_trig_preop_f64.The binary64 conversions are already in (#3369, #3371, #3373 by @R0D4X). They use pure 32-bit integer arithmetic and avoid both DoublePrecisionFloatShaderOps and Int64ShaderOps.
Question
Which approach would you accept for a first arithmetic slice? It would cover
v_add_f64,v_mul_f64andv_fma_f64on VGPR/SGPR pairs, with no constants, literals, clamp, omod, DPP or SDWA.fadd double,fmul doubleanddx.op.tertiary.f64Fma (opcode 47), with the double-precision shader flags set. Reading and writing the pairs usesMakeDouble/SplitDouble, so no i64 is needed. Thehardwarecheck would report a capability skip (77) on an adapter without double support. Three things would be stated as host assumptions and measured on a GPU:Both approaches would accept the ops only under the default MODE contract for the f16/f64 fields (
round [3:2]RNE,denorm [7:6]keep). They reuse the existinghalf_binaryMODE tracking, because gfx10 shares those fields between binary16 and binary64. Each case would get bit-exact readback references (signed zeros, denormal inputs and results, round-to-even ties, overflow, Inf/NaN) and fused-vs-unfused and flush mutants.@R0D4X, if you are already working on binary64 arithmetic, please say so and I will stay out of it.
AI-assisted.
@KelboLive on GitHub · 2026-11-29 22:54 UTC · original
Partial answer to the capability half of option 1, measured rather than assumed.
A minimal D3D12 program enumerated the hardware adapter and WARP, created a device at
D3D_FEATURE_LEVEL_11_0, and queriedD3D12_FEATURE_D3D12_OPTIONS(the double flag) andD3D12_FEATURE_D3D12_OPTIONS1(int64 and wave ops). No shader involved.sm=0x60isD3D_SHADER_MODEL_6_0, the highest this host reports.So on this host option 1 needs no capability skip: both the GPU and WARP advertise
DoublePrecisionFloatShaderOps. If that holds generally, the capability skip you listed for thehardwarecheck would only fire on older adapters — worth knowing before the skip is written into the fixture as if
it were the common case.
Not measured here, and still the deciding part:
fadd double/fmul double/dx.op.tertiary.f64actually return correctly roundedresults, keep denormals and propagate NaN by class only on these two backends;
out/build/warp-agility), which is a differentd3d10warp.dlland could disagree with the in-box one;
Int64ShaderOpsis alsoyeson both, which weakens one argument for the integer-only route — butyour existing conversions avoid both flags on purpose, so that is presumably a portability choice
rather than a local limitation.
If the maintainers are leaning to option 1, I can extend this into the rounding/denormal/NaN measurement
for those three ops on hardware and both WARP builds. I have the host and the Agility tree set up, so that
would be a measurement-only change.
I am not starting on either implementation.
@legacy-code-archaeologist on GitHub · 2026-11-29 23:34 UTC · original
Thanks @KelboLive for the capability measurement. While this question is open, I put up the two binary64 ops that need neither approach: #3531 (
v_ldexp_f64) and #3532 (v_min_f64/v_max_f64). Both use 32-bit integer operations only, like the conversions, and both have anirmode checked bit for bit against exact references.v_add_f64/v_mul_f64/v_fma_f64stay local until an approach is chosen here.AI-assisted.