Skip to content

Conversation

@jayfoad
Copy link
Contributor

@jayfoad jayfoad commented Dec 8, 2025

No description provided.

@jayfoad jayfoad added the skip-precommit-approval PR for CI feedback, not intended for review label Dec 8, 2025
@llvmbot llvmbot added backend:AMDGPU and removed skip-precommit-approval PR for CI feedback, not intended for review labels Dec 8, 2025
@llvmbot
Copy link
Member

llvmbot commented Dec 8, 2025

@llvm/pr-subscribers-backend-amdgpu

Author: Jay Foad (jayfoad)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/171108.diff

1 Files Affected:

  • (modified) llvm/test/CodeGen/AMDGPU/llvm.amdgcn.fma.legacy.ll (+36-4)
diff --git a/llvm/test/CodeGen/AMDGPU/llvm.amdgcn.fma.legacy.ll b/llvm/test/CodeGen/AMDGPU/llvm.amdgcn.fma.legacy.ll
index 4b27208935633..dab67cde215f4 100644
--- a/llvm/test/CodeGen/AMDGPU/llvm.amdgcn.fma.legacy.ll
+++ b/llvm/test/CodeGen/AMDGPU/llvm.amdgcn.fma.legacy.ll
@@ -1,8 +1,8 @@
 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
-; RUN: llc -mtriple=amdgcn-mesa-mesa3d -mcpu=gfx1030 < %s | FileCheck -check-prefix=GFX10 %s
-; RUN: llc -global-isel -mtriple=amdgcn-mesa-mesa3d -mcpu=gfx1030 < %s | FileCheck -check-prefix=GFX10 %s
-; RUN: llc -mtriple=amdgcn-mesa-mesa3d -mcpu=gfx1100 < %s | FileCheck -check-prefix=GFX11 %s
-; RUN: llc -global-isel -mtriple=amdgcn-mesa-mesa3d -mcpu=gfx1100 < %s | FileCheck -check-prefix=GFX11 %s
+; RUN: llc -global-isel=0 -mtriple=amdgcn-mesa-mesa3d -mcpu=gfx1030 < %s | FileCheck -check-prefix=GFX10 %s
+; RUN: llc -global-isel=1 -mtriple=amdgcn-mesa-mesa3d -mcpu=gfx1030 < %s | FileCheck -check-prefix=GFX10 %s
+; RUN: llc -global-isel=0 -mtriple=amdgcn-mesa-mesa3d -mcpu=gfx1100 < %s | FileCheck -check-prefix=GFX11 %s
+; RUN: llc -global-isel=1 -mtriple=amdgcn-mesa-mesa3d -mcpu=gfx1100 < %s | FileCheck -check-prefix=GFX11 %s
 
 define float @v_fma(float %a, float %b, float %c)  {
 ; GFX10-LABEL: v_fma:
@@ -20,6 +20,22 @@ define float @v_fma(float %a, float %b, float %c)  {
   ret float %fma
 }
 
+define float @v_fmac(float %a, float %b, float %c)  {
+; GFX10-LABEL: v_fmac:
+; GFX10:       ; %bb.0:
+; GFX10-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
+; GFX10-NEXT:    v_fmac_legacy_f32_e32 v0, v1, v2
+; GFX10-NEXT:    s_setpc_b64 s[30:31]
+;
+; GFX11-LABEL: v_fmac:
+; GFX11:       ; %bb.0:
+; GFX11-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
+; GFX11-NEXT:    v_fmac_dx9_zero_f32_e32 v0, v1, v2
+; GFX11-NEXT:    s_setpc_b64 s[30:31]
+  %fma = call float @llvm.amdgcn.fma.legacy(float %b, float %c, float %a)
+  ret float %fma
+}
+
 define float @v_fma_imm(float %a, float %c)  {
 ; GFX10-LABEL: v_fma_imm:
 ; GFX10:       ; %bb.0:
@@ -36,6 +52,22 @@ define float @v_fma_imm(float %a, float %c)  {
   ret float %fma
 }
 
+define float @v_fmac_imm(float %a, float %c)  {
+; GFX10-LABEL: v_fmac_imm:
+; GFX10:       ; %bb.0:
+; GFX10-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
+; GFX10-NEXT:    v_fmac_legacy_f32_e32 v0, 0x41200000, v1
+; GFX10-NEXT:    s_setpc_b64 s[30:31]
+;
+; GFX11-LABEL: v_fmac_imm:
+; GFX11:       ; %bb.0:
+; GFX11-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
+; GFX11-NEXT:    v_fmac_dx9_zero_f32_e32 v0, 0x41200000, v1
+; GFX11-NEXT:    s_setpc_b64 s[30:31]
+  %fma = call float @llvm.amdgcn.fma.legacy(float 10.0, float %c, float %a)
+  ret float %fma
+}
+
 define float @v_fabs_fma(float %a, float %b, float %c)  {
 ; GFX10-LABEL: v_fabs_fma:
 ; GFX10:       ; %bb.0:

@jayfoad jayfoad merged commit f41edb3 into llvm:main Dec 8, 2025
12 of 13 checks passed
@jayfoad jayfoad deleted the test-fmac-legacy branch December 8, 2025 11:42
honeygoyal pushed a commit to honeygoyal/llvm-project that referenced this pull request Dec 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants