Files
metal2vulkan/crates
Anees Iqbal e2b5b29c07 Translator: a float predicate is non-zero by its bits, as Metal reads it
Metal's answer, from lane fcfloat's authored case (our MSL fixture
fc_float_gate: a fragment output's [[sample_mask]] gated by a float
function constant, so whether the output is present shows in the target;
Apple M3 Max, job m3-max-75714, three runs each):
  s = 1.5 present, +0.0 absent, -0.0 (0x80000000) PRESENT,
  quiet NaN (0x7fc00000) present, unsupplied absent.
So Metal keeps what a float predicate gates wherever the supplied value's
bits are not all zero. 267d3163a6's fold compared values (v != 0.0) and so
dropped -0.0's argument; 8f84a9c4fd then made float_nonzero compare values
too. Both now compare bits: normalize_predicate_float gives 1.0 for any
float constant with a bit set (-0.0 and NaN included) and 0.0 for +0.0,
null or undefined; float_nonzero is true for any bit set. A body that reads
the constant itself (if (s)) still reads -0.0 as false: Metal's kernel
variant wrote its sentinel there, and the body's compare is not this path.

SEMANTICS_VERSION 2307: the outcome for a -0.0 float or half predicate
moved again under 2306 (never published).

Tests: the specialization tests' -0.0 rows (float and half, normalized and
unnormalized) now expect the argument kept.
2026-11-26 17:18:49 -08:00
..