Skip to content

[AMDGPU] New GFX12 aliases lds_direct_load and lds_param_load #119205

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 9, 2024

Conversation

jayfoad
Copy link
Contributor

@jayfoad jayfoad commented Dec 9, 2024

This is for compatibility with SP3.

@llvmbot llvmbot added backend:AMDGPU mc Machine (object) code labels Dec 9, 2024
@llvmbot
Copy link
Member

llvmbot commented Dec 9, 2024

@llvm/pr-subscribers-mc

@llvm/pr-subscribers-backend-amdgpu

Author: Jay Foad (jayfoad)

Changes

This is for compatibility with SP3.


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

2 Files Affected:

  • (modified) llvm/lib/Target/AMDGPU/DSDIRInstructions.td (+5)
  • (added) llvm/test/MC/AMDGPU/gfx12_asm_vdsdir_alias.s (+8)
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]

@jayfoad jayfoad merged commit 9ddc31d into llvm:main Dec 9, 2024
9 of 11 checks passed
@jayfoad jayfoad deleted the gfx12-lds-aliases branch December 9, 2024 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend:AMDGPU mc Machine (object) code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants