[llvm] [AMDGPU][True16][MC][CodeGen] true16 mode for v_cvt_pk_bf8/fp8_f32 (PR #141881)

Stanislav Mekhanoshin via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 3 11:13:51 PDT 2025


================
@@ -570,6 +570,36 @@ def VOP3_CVT_PK_F8_F32_Profile : VOP3_Profile<VOP_I32_F32_F32, VOP3_OPSEL> {
   let HasExtVOP3DPP = 1;
 }
 
+def VOP3_CVT_PK_F8_F32_Profile_fake16 : VOP3_Profile_Fake16<VOP_I16_F32_F32, VOP3_OPSEL> {
----------------
rampitec wrote:

No, I mean this does define InsVOP3Opsel and InsVOP3Base in a custom way. Probably getInsVOP3Base and getInsVOP3Opsel helpers can already do this for you and you just need to set right flags? What it does is fakes HasOpsel to false and readds it back with the Tail. I'd expect the helpers to handle it, and then it shall be possible to do just something like:
```
let HasOpSel = 1, HasClamp = 0, HasExtVOP3DPP = 1 in {
def VOP3_CVT_PK_F8_F32_Profile : VOP3_Profile<VOP_I32_F32_F32, VOP3_OPSEL>;
def VOP3_CVT_PK_F8_F32_Profile_fake16 : VOP3_Profile_Fake16<VOP3_CVT_PK_F8_F32_Profile>;
def VOP3_CVT_PK_F8_F32_Profile_t16 : VOP3_Profile_True16<VOP3_CVT_PK_F8_F32_Profile>;
}
```
I have recently added some code in these helpers, both here and downstream, so it might be able to do it already.

https://github.com/llvm/llvm-project/pull/141881


More information about the llvm-commits mailing list