direct compute: lower binary16 VOP1 rcp, sqrt, exp, rsq and log #3219

Closed
opened 2026-11-27 22:18:16 +00:00 by Leyukaka · 1 comment
Leyukaka commented 2026-11-27 22:18:16 +00:00 (Migrated from github.com)
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by Leyukaka on 2026-11-27T22:18:16Z.


Part of #2935 (instruction coverage). Target branch main. I am taking it; the PR follows.

Gap. Direct compute lowers the binary16 VOP2 ALU ops only. The binary16 VOP1 ops v_rcp_f16, v_sqrt_f16, v_exp_f16, v_rsq_f16 and v_log_f16 are refused, plain and SDWA. Captured SDWA forms use dst_sel WORD_0 or WORD_1, with UNUSED_PAD or UNUSED_PRESERVE.

Measured on a local capture of 2,689 compute requests (counts and instruction shape only), with compile_dxil --jobs 8 gfx1013-direct-cs@36 --requests on main c45bf9ab:

  • 9 requests stop first at one of these ops, all through SDWA ("unimplemented direct SDWA operand profile").
  • With the change, 3 of them compile (432 to 435; 445 to 448 in the requests of one start-up run).
  • All 9 have the wave32 bit of #2999 clear. The lowering is per lane, so it does not depend on the wave size.

AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6655341672 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/3219). Originally posted by [Leyukaka](https://github.com/Leyukaka) on 2026-11-27T22:18:16Z. --- Part of #2935 (instruction coverage). Target branch `main`. I am taking it; the PR follows. **Gap.** Direct compute lowers the binary16 VOP2 ALU ops only. The binary16 VOP1 ops `v_rcp_f16`, `v_sqrt_f16`, `v_exp_f16`, `v_rsq_f16` and `v_log_f16` are refused, plain and SDWA. Captured SDWA forms use `dst_sel` WORD_0 or WORD_1, with UNUSED_PAD or UNUSED_PRESERVE. **Measured** on a local capture of 2,689 compute requests (counts and instruction shape only), with `compile_dxil --jobs 8 gfx1013-direct-cs@36 --requests` on `main` `c45bf9ab`: - 9 requests stop first at one of these ops, all through SDWA ("unimplemented direct SDWA operand profile"). - With the change, 3 of them compile (432 to 435; 445 to 448 in the requests of one start-up run). - All 9 have the wave32 bit of #2999 clear. The lowering is per lane, so it does not depend on the wave size. AI-assisted.
Leyukaka commented 2026-11-29 01:08:41 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by Leyukaka on 2026-11-29T01:08:41Z.


v_rcp_f16, v_sqrt_f16, v_exp_f16 and v_rsq_f16 are on main through #3220 (src/gfx1013_compute_native.cpp:32-35).
v_log_f16 is not in that list and is still refused (control at tests/native_f16_alu_check.py:408); #3220 gives the accuracy reason.
Releasing my claim on the log part.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7248589491 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/3219#issuecomment-7248589491). Originally posted by [Leyukaka](https://github.com/Leyukaka) on 2026-11-29T01:08:41Z. --- `v_rcp_f16`, `v_sqrt_f16`, `v_exp_f16` and `v_rsq_f16` are on `main` through #3220 (`src/gfx1013_compute_native.cpp:32-35`). `v_log_f16` is not in that list and is still refused (control at `tests/native_f16_alu_check.py:408`); #3220 gives the accuracy reason. Releasing my claim on the log part.
Sign in to join this conversation.
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
R0Y00/Xbox2Windows#3219
No description provided.