Repository navigation
docs(design): tidy the f16 frexp/ldexp row - #4797
liang-kai-shui wants to merge 1 commit into
Conversation
PROC-235: the contract row repeated "infinities and NaNs give the input unchanged and exponent 0", said denormals are both read as zero and kept, claimed v_ldexp_f16 produces no denormal results before listing measured denormal results, contradicted itself on clamp (and omod) support, and still called the destination's high half unmeasured despite the gfx1036 measurement. Rewrite those sentences to one self-consistent rule set; the measured words and the current translator behaviour are unchanged.
|
Thanks for taking PROC-235. On the overlap with #2171: its only change to this row is the last sentence, which gains the GPU check. This PR leaves that sentence as
If this one lands first, I'll rebase #2171 onto it the same way. |
Claimed in the coordination issue as: #4683 (comment)
Fixes PROC-235 (found by @Krashgamer): the contract row for
v_frexp_mant_f16,v_frexp_exp_i16_f16andv_ldexp_f16indocs/design.md(line 415 on98fa503f) contradicted itself in four ways, so a reader could not tell which rule the translation follows.What changed (text only)
infinities and NaNs give the input unchanged and exponent 0appeared twice, and the first copy still said denormals are "read as zero" next to "f16 denormals are kept"; now: zero -> signed zero / exponent 0, infinities and NaNs -> input unchanged / exponent 0, f16 denormals kept and normalized (with the measured0x0001,0x03ffwords);v_ldexp_f16claimed "no denormal results" and then listed measured denormal results rounded to nearest even; now one rule: S1 clamped to [-64, 64], overflow -> ?infinity, below the smallest normal -> denormal rounded to nearest even (measured0x0200,0x0002,0x0001,0x0400cases), zero/inf/NaN ignore S1;clampand the output multipliers are rejected as unsupported" contradicted the later measured clamp behaviour; now: VOP3clampacts on the FP16 result ofv_frexp_mant_f16/v_ldexp_f16(hardware-verified on gfx1036, 302 kernels), omod (mul:2/mul:4/div:2) is rejected, and clamp onv_frexp_exp_i16_f16is rejected;v_frexp_exp_i16_f16keeps the high half ... is the translator's choice" contradicted the next sentence's gfx1036 measurement; now the measured paragraph says the high half is kept by all three, and only the NaN payload (and the IEEE 1 signalling-NaN quieting) remain not modelled.The measured words (gfx1036,
tools/hw_oracle, 65,536 inputs per frexp op andv_ldexp_f16under 16 exponents) and the current translator behaviour are unchanged;tests/semantic/test_alu_frexp_ldexp_f16.pystill holds the words quoted.Tested
python -I tests/test_docs_links.py-> 6 tests OK;python -I tests/test_docs_design_rows.py-> 4 tests OK (the row's first cell is unchanged, so it is still one topic per table).git diff --checkclean;docs/design.mdonly, one row (1 insertion / 1 deletion).Overlap: #2171 and #4311 edit this same row and are still open; this can be folded into whichever lands first (the text is the same rule set either way).
AI-assisted.
Checklist
docs/design.md??not applicable (documents already-implemented rules).