shader: lower v_xad_u32 and v_log_f32 in the mesh frontend #3905

Closed
opened 2026-12-03 00:35:51 +00:00 by github-bot · 0 comments
Owner

@⁠lambirou on GitHub · 2026-12-03 00:35 UTC · original

Problem

The 3 December work split on #3705 leaves A1 (small ALU) open: v_xad_u32 is the first refusal for 66 mesh programs, v_log_f32 for 37, and ds_swizzle_b32 for 17. The two former already have lowerings in the shared compute ALU; the native mesh frontend simply did not admit them.

Change

  • Add v_xad_u32 (VOP3 0x345) to the mesh vector list. It takes three sources and lowers to (S0 ^ S1) + S2 modulo 2^32, matching the compute frontend.
  • Add v_log_f32 (VOP1 0x27) to the same list. It evaluates DXIL Log (dx.op.unary.f32, opcode 23) through the shared float ALU.
  • Keep ds_swizzle_b32 refused for now; a general lane-swizzle exchange is a separate design.

Tests

tests/native_direct_mesh_check.py adds source-built programs:

  • v_xad_u32 v1, v0, s20, s21 with s20 = 0x0000ffff and s21 = 0x00ff0000 emits xor i32 %v0, 65535 then add i32 %xor, 16711680, exported through POS0.x. An unbound third source keeps unbound numeric SGPR s24.
  • v_log_f32 v1, v0 emits call float @dx.op.unary.f32(i32 23, ...) and exports the bitcast result.
python -B tests/native_direct_mesh_check.py out/build/release/compile_dxil.exe "C:/Program Files (x86)/Windows Kits/10/bin/10.0.26100.0/x64"
mesh allocation, indexed outputs, group exchange and negative controls passed

tests/docs_links_check.py passed (258 files, 969 links).

Coverage

On the issue census, the two forms clear the first refusal for 103 of the 120 A1 programs. ds_swizzle_b32 (17) stays in the bucket and will show the next refusal. This PR does not claim a new total; the census owner can rerun the capture.

Refs #3705

Pull request details or commits were not available from GitHub; kept as an issue.

**@⁠lambirou** on GitHub · 2026-12-03 00:35 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3903) ## Problem The 3 December work split on #3705 leaves A1 (small ALU) open: `v_xad_u32` is the first refusal for 66 mesh programs, `v_log_f32` for 37, and `ds_swizzle_b32` for 17. The two former already have lowerings in the shared compute ALU; the native mesh frontend simply did not admit them. ## Change - Add `v_xad_u32` (VOP3 `0x345`) to the mesh vector list. It takes three sources and lowers to `(S0 ^ S1) + S2` modulo 2^32, matching the compute frontend. - Add `v_log_f32` (VOP1 `0x27`) to the same list. It evaluates DXIL Log (`dx.op.unary.f32`, opcode 23) through the shared float ALU. - Keep `ds_swizzle_b32` refused for now; a general lane-swizzle exchange is a separate design. ## Tests `tests/native_direct_mesh_check.py` adds source-built programs: - `v_xad_u32 v1, v0, s20, s21` with `s20 = 0x0000ffff` and `s21 = 0x00ff0000` emits `xor i32 %v0, 65535` then `add i32 %xor, 16711680`, exported through POS0.x. An unbound third source keeps `unbound numeric SGPR s24`. - `v_log_f32 v1, v0` emits `call float @dx.op.unary.f32(i32 23, ...)` and exports the bitcast result. ``` python -B tests/native_direct_mesh_check.py out/build/release/compile_dxil.exe "C:/Program Files (x86)/Windows Kits/10/bin/10.0.26100.0/x64" mesh allocation, indexed outputs, group exchange and negative controls passed ``` `tests/docs_links_check.py` passed (258 files, 969 links). ## Coverage On the issue census, the two forms clear the first refusal for 103 of the 120 A1 programs. `ds_swizzle_b32` (17) stays in the bucket and will show the next refusal. This PR does not claim a new total; the census owner can rerun the capture. Refs #3705 *Pull request details or commits were not available from GitHub; kept as an issue.*
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-03 00:35:53 +00:00
This discussion has been locked. Commenting is limited to contributors.
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.

Dependencies

No dependencies set

Reference
github/R0Y00--Xbox2Windows#3905
No description provided.