[llvm] [AMDGPU] New GFX12 aliases lds_direct_load and lds_param_load (PR #119205)

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 9 05:00:47 PST 2024


https://github.com/jayfoad created https://github.com/llvm/llvm-project/pull/119205

This is for compatibility with SP3.


>From 1e3dc77ce810fb312908e8185343eb80df3750b9 Mon Sep 17 00:00:00 2001
From: Jay Foad <jay.foad at amd.com>
Date: Mon, 9 Dec 2024 12:59:25 +0000
Subject: [PATCH] [AMDGPU] New GFX12 aliases lds_direct_load and lds_param_load

This is for compatibility with SP3.
---
 llvm/lib/Target/AMDGPU/DSDIRInstructions.td  | 5 +++++
 llvm/test/MC/AMDGPU/gfx12_asm_vdsdir_alias.s | 8 ++++++++
 2 files changed, 13 insertions(+)
 create mode 100644 llvm/test/MC/AMDGPU/gfx12_asm_vdsdir_alias.s

diff --git a/llvm/lib/Target/AMDGPU/DSDIRInstructions.td b/llvm/lib/Target/AMDGPU/DSDIRInstructions.td
index 0541f0f656327c..383e3371993d6f 100644
--- a/llvm/lib/Target/AMDGPU/DSDIRInstructions.td
+++ b/llvm/lib/Target/AMDGPU/DSDIRInstructions.td
@@ -193,3 +193,8 @@ multiclass DSDIR_Real_gfx12<bits<2> op> {
 
 defm DS_PARAM_LOAD : DSDIR_Real_gfx12<0x0>;
 defm DS_DIRECT_LOAD : DSDIR_Real_gfx12<0x1>;
+
+let SubtargetPredicate = isGFX12Plus in {
+  def : AMDGPUMnemonicAlias<"lds_param_load", "ds_param_load">;
+  def : AMDGPUMnemonicAlias<"lds_direct_load", "ds_direct_load">;
+}
diff --git a/llvm/test/MC/AMDGPU/gfx12_asm_vdsdir_alias.s b/llvm/test/MC/AMDGPU/gfx12_asm_vdsdir_alias.s
new file mode 100644
index 00000000000000..0d9993afa43e75
--- /dev/null
+++ b/llvm/test/MC/AMDGPU/gfx12_asm_vdsdir_alias.s
@@ -0,0 +1,8 @@
+// NOTE: Assertions have been autogenerated by utils/update_mc_test_checks.py UTC_ARGS: --version 5
+// RUN: llvm-mc -triple=amdgcn -mcpu=gfx1200 -show-encoding %s | FileCheck -check-prefix=GFX12 %s
+
+lds_direct_load v0
+// GFX12: ds_direct_load v0 wait_va_vdst:0 wait_vm_vsrc:0 ; encoding: [0x00,0x00,0x10,0xce]
+
+lds_param_load v0, attr0.x
+// GFX12: ds_param_load v0, attr0.x wait_va_vdst:0 wait_vm_vsrc:0 ; encoding: [0x00,0x00,0x00,0xce]



More information about the llvm-commits mailing list