You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
cpp-migration: direct-path v_add/sub/subrev/mul_f16 zero D[31:16], where gfx10 keeps it #3019
Target branch `cpp-migration`. Part of #2935. Refs #669, #2964.`tests/native_f16_alu_check.py` (from #2964) puts `0xabcd` in the high half of every destination, then runs `v_add_f16`, `v_sub_f16`, `v_subrev_f16` and `v_mul_f16` in their VOP2 and VOP3 forms. Its model, IR interpreter and readback require the stored high half to be zero:
ctest --preset dev --no-tests=error -R '^native_f16_alu_' -V
The lowering in`src/gfx1013_direct_compute.inl` writes `and rounded, 65535`for the non-SDWA forms.
Expected behavior
D[15:0] = the binary16 result, and D[31:16] keeps its value (0xabcd here).
LLVM:GCNSubtarget::zeroesHigh16BitsOfDest lists exactly these four ops, V_ADD/SUB/SUBREV/MUL_F16 in _e32 and _e64, under "On gfx10, all 16-bit instructions preserve the high bits", and returns false from GFX10 on.
The same path: its v_cvt_f16_f32 already keeps the high half.
D[31:16] is written as zero. The fixture accepts this, because its model and comparator require a zero high half, and one of its mutants rejects a kept high half.
#2964 says the zeroing matches RDNA 2 but gives no source. As far as I know, nobody has measured these four f16 ops on silicon; the RDNA 2 evidence above is LLVM's rule and the integer measurement.
@SimSalabimse, if you had a measurement behind the zeroing, please say so and I'll drop this.
Environment
Windows 10 build 19045, MSVC 19.44, SDK and DXC 10.0.26100.0, NVIDIA GeForce RTX 3080 (driver 32.0.15.9174), debug layer on. The readback needs shader model 6.6. I ran it with a local copy of native_store_replay linked with the app-local Agility SDK exports, because the inbox Windows 10 runtime reports a skip (77).
AI-assisted.
Checklist
I reproduced this on a source-built input.
I did not include game files, dumps, distribution links or credentials.
#3020 (Fixes #3019 on cpp-migration) keeps D[31:16] for these four ops. It merged into cpp-migration, so this issue did not close on its own; its commit f6cdee10 is now on main8ecd30fe (through #3039). Can it be closed?
Activity
Leyukaka commentedon Nov 28, 2026
#3020 (
Fixes #3019 on cpp-migration) keeps D[31:16] for these four ops. It merged intocpp-migration, so this issue did not close on its own; its commitf6cdee10is now onmain8ecd30fe(through #3039). Can it be closed?