Repository navigation
rdna2spirv: v_mul_f64, v_fma_f64, v_min/max_f64, v_cvt_f64_f32, v_cvt_{i32,u32}_f64 - #6229
Closed
DeSunShine wants to merge 1 commit into
Closed
DeSunShine wants to merge 1 commit into
DeSunShine wants to merge 1 commit into
Conversation
DeSunShine
force-pushed
the
f64-alu-rules
branch
from
November 23, 2026 13:39
79b1b21 to
4afd706
Compare
…_{i32,u32}_f64
Seven RDNA2 instructions that had no rule. f64 -> integer conversions
truncate, saturate and give 0 for NaN, with the raw OpConvertFToS/U only
seeing an in-range operand, as for the f32 forms. tests/spirv_interp.py
converts integers and f32 to double without an f32 rounding and executes
OpFConvert. CPU tests: tests/test_f64_alu_rules.py. GPU tests ps_f64_alu /
ps_f64_cvt (shaderFloat64), not yet run on hardware.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013DSntNHdpsDTxnrMYfutBo
Contributor
Author
|
Duplicate of #1976, closing in favour of it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Claimed in the coordination issue as:
Depends on: conflicts with #3325 (
v_cvt_i32_f64/v_cvt_u32_f64, same files) and overlaps #1976 (v_mul_f64,v_fma_f64,v_min/max_f64,v_cvt_*_f64among its ops)What and why
Rules for seven RDNA2 f64 instructions that had none:
v_mul_f64,v_fma_f64,v_min_f64,v_max_f64,v_cvt_f64_f32,v_cvt_i32_f64,v_cvt_u32_f64. With the patch, the ISA unknown count on main goes from 170 to 163.clamp_mods_f64asv_add_f64does.v_mul_f64isOpFMulon doubles;v_fma_f64is GLSL.std.450Fmaon doubles (single rounding only where the driver fuses it;--fma khr/--fma exactstill cover f32 only).v_min_f64/v_max_f64areNMin/NMax, S0 kept when S1 is NaN, as the f32 forms.v_cvt_f64_f32is exact.v_cvt_i32_f64/v_cvt_u32_f64truncate toward zero, saturate out-of-range values and infinities (i32: 0x80000000/0x7fffffff, u32: 0/0xffffffff) and give 0 for NaN (RDNA2 ISA), with the rawOpConvertFToS/Uonly seeing an in-range operand; output modifiers on them areUnsupported.tests/spirv_interp.pynow converts integers and f32 to double without an f32 rounding and executesOpFConvert.docs/design.md; the floating-point row now says howv_fma_f64relates to--fma.Source: AMD RDNA 2 ISA (VOP1/VOP3 opcode descriptions). None of these instructions occurs in the corpus.
Tested
CPU only (Windows 11, Python 3.15):
python -m pytest -q tests/test_f64_alu_rules.py tests/test_f64_*.py tests/test_spirv_interp*.py tests/test_run_gpu_*.py tests/test_design_contract_rows.py— 153 passed, 802 subtests passedpython -I tests/semantic/regen_fixtures.py --check— cleanGPU: not run yet. New GPU tests
runtime/test/shaders/ps_f64_alu.asmandps_f64_cvt.asm(needshaderFloat64; wired intocheck.py,scripts/run_gpu_tests.py,tests/semantic/regen_fixtures.py). Run pending on an RTX 4090; results will go here and in #166. Word 0 ofps_f64_aluis 0 instead of0x3c300000on a driver that roundsFmatwice.AI-assisted: yes
Checklist
docs/design.md, with how it was confirmed.