feat(shader): VOP3 v_max/min_f16, v_cvt_f32_f16/ubyte and abs/neg on f16 binaries #252
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/252"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-01T19:42:10Z.
What
The VOP1/VOP2 forms of these already translate, but their VOP3 encodings threw "VOP3 opcode is not implemented":
v_max_f16_e64,v_min_f16_e64(were explicitly excluded as VOP3 aliases)v_cvt_f32_f16_e64,v_cvt_f32_ubyte0..3_e64(missing from the VOP3-encoded VOP1 table)VOP3 f16 binaries (
add/sub/subrev/mul/min/max_f16) also rejectedabs/neg("VOP3 source modifiers are not implemented") althoughreadF16AsF32already applies them, so they are now accepted.clamp/omodstay rejected for f16 results:writeF16does not apply result modifiers (separate fix).Found with an ISA sweep: every gfx1013 opcode from
llvm-mcfed toDecodeRdnaInstruction+TranslateInstruction; these were the VOP3 forms whose short form already works.Test
agc_driver_vop3_aliases: hand-assembled compute shader (words fromllvm-mc -mcpu=gfx1013 -show-encoding, same harness asMixPrecision), 64 lanes compared with a CPU model:v_max_f16 -a,|b|,v_min_f16 |a|,-b,v_mul_f16 -|a|,b,v_cvt_f32_f16 b mul:4,v_cvt_f32_f16 -|a|,v_cvt_f32_ubyte0..3withmul:2,div:2,clamp. Only the written f16 half is checked.Tested
Linux: test passes on RADV (Radeon 660M) and lavapipe; without the decoder change it fails with "VOP3 opcode is not implemented". CI runs it on lavapipe through #251.
Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)VulkanTestDevice.hpp+ lavapipe in CI); review only the last commit