Skip to content

cpp-migration: direct-path v_add/sub/subrev/mul_f16 zero D[31:16], where gfx10 keeps it #3019

Backlog

Description

@archielcqp-a11y

Commit or build

cpp-migration 999e17c

Reproduction

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.
  • pixel_aot: non-packed 16-bit integer VOP3 ops – high-half behaviour before lowering #669: recorded the same rule for the non-packed 16-bit integer ops, from an inline-assembly measurement on RDNA 2 silicon.

Observed behavior

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.

Activity

  1. added
    bug
    on Nov 27, 2026
  2. Leyukaka commented on Nov 28, 2026

    @Leyukaka
    Collaborator

    #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 main 8ecd30fe (through #3039). Can it be closed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions