Commit Graph

4 Commits

Author SHA1 Message Date
53d138d2d1 test_f64_conversion: the omod scale is an OpConstant %float of the same bits
fconst now emits one cached OpConstant %float per value (%fc<bits>) instead
of an OpConstant %uint bitcast at each use, so the v_cvt_f32_f64 omod check
looks for %fc<scale bits> = OpConstant %float and checks that its literal
gives back exactly the scale's 32 bits. The rest of the data flow is pinned
as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-27 12:07:15 +01:00
a9bed902d2 rdna2spirv: VOP3 clamp of a NaN gives +0 (DX10_CLAMP)
Gen.clamp_mods applied the VOP3 clamp bit as a bare GLSL.std.450
FClamp, which is undefined for a NaN operand. The game's MODE has
DX10_CLAMP=1, under which the hardware turns a NaN result into +0
(measured on gfx1036: the v_rcp_iflag_f32 run and SHADER-186 for
v_fmac_f16 / v_fma_mix*). Select +0 for a NaN before FClamp, as the
div_fixup, cvt_pk_u8 and cvt_pknorm clamps already do. This covers
every f32/f16 op that applies clamp through clamp_mods/clamp_f16.

- tests/semantic/test_vop3_clamp_nan.py: NaN operands (quiet,
  negative, signalling) and invalid operations (inf-inf, -inf*0)
  under clamp give +0 for f32, f16 (low and high half), conversions,
  legacy and mix ops; controls without a NaN are unchanged. It fails
  33 subtests on the old translator.
- The two negative controls that expected the undefined FClamp
  (test_alu_f32_min_max, test_alu_min3_max3) now expect +0, and the
  f16 unary harness checks clamp of a NaN result instead of skipping.
- test_rcp_iflag_mods / test_f64_conversion match the new SPIR-V.
- docs/design.md and docs/shader_validation.md no longer list the
  f32/f16 clamp of a NaN as unmodelled. Still a bare FClamp: the f64
  clamp (open PR #475) and the packed v_pk_* clamp.

AI-assisted (Claude Code).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 16:10:13 +05:30
3f64ac0323 test: follow full-EXEC f64 output word stores
(cherry picked from commit 0fe16691d1)
2026-11-24 04:01:06 +02:00
8f07d488fd Check f64 conversion output modifier data flow 2026-11-22 00:19:50 +01:00