[llvm] [AMDGPU] Add v_fma_mix_f32_f16 as an alias of v_fma_mix_f32 on gfx1250 (PR #150502)

Changpeng Fang via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 24 12:11:52 PDT 2025


https://github.com/changpeng created https://github.com/llvm/llvm-project/pull/150502

None

>From 6b208735d86584c3071613c5b8b6d9d0ea024aee Mon Sep 17 00:00:00 2001
From: Changpeng Fang <changpeng.fang at amd.com>
Date: Thu, 24 Jul 2025 12:04:58 -0700
Subject: [PATCH] [AMDGPU] Add v_fma_mix_f32_f16 as an alias of v_fma_mix_f32
 on gfx1250

Co-Authored-by: Jay Foad <Jay.Foad at amd.com>
---
 llvm/lib/Target/AMDGPU/VOP3PInstructions.td   | 3 +++
 llvm/test/MC/AMDGPU/gfx1250_asm_vop3p_alias.s | 5 +++++
 2 files changed, 8 insertions(+)
 create mode 100644 llvm/test/MC/AMDGPU/gfx1250_asm_vop3p_alias.s

diff --git a/llvm/lib/Target/AMDGPU/VOP3PInstructions.td b/llvm/lib/Target/AMDGPU/VOP3PInstructions.td
index 7017da9dc3521..c812dc9850514 100644
--- a/llvm/lib/Target/AMDGPU/VOP3PInstructions.td
+++ b/llvm/lib/Target/AMDGPU/VOP3PInstructions.td
@@ -2277,6 +2277,9 @@ defm V_FMA_MIX_F32_BF16 : VOP3P_Realtriple<GFX1250Gen, 0x3d>;
 defm V_FMA_MIXLO_BF16   : VOP3P_Realtriple<GFX1250Gen, 0x3e>;
 defm V_FMA_MIXHI_BF16   : VOP3P_Realtriple<GFX1250Gen, 0x3f>;
 
+let AssemblerPredicate = isGFX1250Plus in
+def : AMDGPUMnemonicAlias<"v_fma_mix_f32_f16",  "v_fma_mix_f32">;
+
 defm V_PK_MINIMUM_F16 : VOP3P_Real_gfx12<0x1d>;
 defm V_PK_MAXIMUM_F16 : VOP3P_Real_gfx12<0x1e>;
 
diff --git a/llvm/test/MC/AMDGPU/gfx1250_asm_vop3p_alias.s b/llvm/test/MC/AMDGPU/gfx1250_asm_vop3p_alias.s
new file mode 100644
index 0000000000000..8d5c11482f909
--- /dev/null
+++ b/llvm/test/MC/AMDGPU/gfx1250_asm_vop3p_alias.s
@@ -0,0 +1,5 @@
+// NOTE: Assertions have been autogenerated by utils/update_mc_test_checks.py UTC_ARGS: --version 5
+// RUN: llvm-mc -triple=amdgcn -mcpu=gfx1250 -show-encoding < %s | FileCheck --check-prefix=GFX1250 %s
+
+v_fma_mix_f32_f16 v5, v1, v2, s3
+// GFX1250: v_fma_mix_f32 v5, v1, v2, s3            ; encoding: [0x05,0x00,0x20,0xcc,0x01,0x05,0x0e,0x00]



More information about the llvm-commits mailing list