-
Notifications
You must be signed in to change notification settings - Fork 14.9k
AMDGPU: Handle true16 disassembly of ds_write_b8/b16 #156406
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
AMDGPU: Handle true16 disassembly of ds_write_b8/b16 #156406
Conversation
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
@llvm/pr-subscribers-backend-amdgpu Author: Matt Arsenault (arsenm) ChangesThis avoids an inconsistency in pseudo definitions I Patch is 25.26 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/156406.diff 5 Files Affected:
diff --git a/llvm/lib/Target/AMDGPU/DSInstructions.td b/llvm/lib/Target/AMDGPU/DSInstructions.td
index a9376250931b6..5e4c19e389cf6 100644
--- a/llvm/lib/Target/AMDGPU/DSInstructions.td
+++ b/llvm/lib/Target/AMDGPU/DSInstructions.td
@@ -1380,6 +1380,21 @@ multiclass DS_Real_gfx12_with_name<bits<8> op, string name> {
defm "" : DS_Real_gfx12<op, !cast<DS_Pseudo>(NAME), name>;
}
+multiclass DS_Real_gfx12_with_t16<bits<8> op,
+ string name = !tolower(NAME)> {
+ let DecoderNamespace = "GFX12_FAKE16" in {
+ defm "" : DS_Real_gfx12<op, !cast<DS_Pseudo>(NAME#"_gfx9"), name>;
+ }
+
+ let DecoderNamespace = "GFX12" in {
+ def _gfx12_t16 :
+ Base_DS_Real_gfx6_gfx7_gfx10_gfx11_gfx12<op,
+ !cast<DS_Pseudo>(NAME#"_t16"),
+ SIEncodingFamily.GFX12, name>,
+ True16D16Table<NAME#"_D16_HI", NAME>;
+ }
+}
+
defm DS_MIN_F32 : DS_Real_gfx12_with_name<0x012, "ds_min_num_f32">;
defm DS_MAX_F32 : DS_Real_gfx12_with_name<0x013, "ds_max_num_f32">;
defm DS_MIN_RTN_F32 : DS_Real_gfx12_with_name<0x032, "ds_min_num_rtn_f32">;
@@ -1444,17 +1459,37 @@ multiclass DS_Real_gfx11<bits<8> op, DS_Pseudo ps = !cast<DS_Pseudo>(NAME),
} // End AssemblerPredicate
}
+multiclass DS_Real_gfx11_with_t16<bits<8> op,
+ string name = !tolower(NAME)> {
+ let DecoderNamespace = "GFX11_FAKE16" in {
+ defm "" : DS_Real_gfx11<op, !cast<DS_Pseudo>(NAME#"_gfx9"), name>;
+ }
+
+ let DecoderNamespace = "GFX11" in {
+ def _gfx11_t16 :
+ Base_DS_Real_gfx6_gfx7_gfx10_gfx11_gfx12<op,
+ !cast<DS_Pseudo>(NAME#"_t16"),
+ SIEncodingFamily.GFX11, name>,
+ True16D16Table<NAME#"_D16_HI", NAME#"_gfx9">;
+ }
+}
+
multiclass DS_Real_gfx11_gfx12<bits<8> op,
string name = !tolower(NAME),
DS_Pseudo ps = !cast<DS_Pseudo>(NAME)>
: DS_Real_gfx11<op, ps, name>,
DS_Real_gfx12<op, ps, name>;
+multiclass DS_Real_gfx11_gfx12_with_t16<bits<8> op,
+ string name = !tolower(NAME)>
+ : DS_Real_gfx11_with_t16<op, name>,
+ DS_Real_gfx12_with_t16<op, name>;
+
defm DS_WRITE_B32 : DS_Real_gfx11_gfx12<0x00d, "ds_store_b32">;
defm DS_WRITE2_B32 : DS_Real_gfx11_gfx12<0x00e, "ds_store_2addr_b32">;
defm DS_WRITE2ST64_B32 : DS_Real_gfx11_gfx12<0x00f, "ds_store_2addr_stride64_b32">;
-defm DS_WRITE_B8 : DS_Real_gfx11_gfx12<0x01e, "ds_store_b8">;
-defm DS_WRITE_B16 : DS_Real_gfx11_gfx12<0x01f, "ds_store_b16">;
+defm DS_WRITE_B8 : DS_Real_gfx11_gfx12_with_t16<0x01e, "ds_store_b8">;
+defm DS_WRITE_B16 : DS_Real_gfx11_gfx12_with_t16<0x01f, "ds_store_b16">;
defm DS_WRXCHG_RTN_B32 : DS_Real_gfx11_gfx12<0x02d, "ds_storexchg_rtn_b32">;
defm DS_WRXCHG2_RTN_B32 : DS_Real_gfx11_gfx12<0x02e, "ds_storexchg_2addr_rtn_b32">;
defm DS_WRXCHG2ST64_RTN_B32 : DS_Real_gfx11_gfx12<0x02f, "ds_storexchg_2addr_stride64_rtn_b32">;
diff --git a/llvm/lib/Target/AMDGPU/SIInstrInfo.td b/llvm/lib/Target/AMDGPU/SIInstrInfo.td
index 63c938b259f35..cf9fe74f977ea 100644
--- a/llvm/lib/Target/AMDGPU/SIInstrInfo.td
+++ b/llvm/lib/Target/AMDGPU/SIInstrInfo.td
@@ -12,7 +12,9 @@ def isWave64 : Predicate<"Subtarget->isWave64()">,
AssemblerPredicate <(all_of FeatureWavefrontSize64)>;
class AMDGPUMnemonicAlias<string From, string To, string VariantName = "">
- : MnemonicAlias<From, To, VariantName>, PredicateControl;
+ : MnemonicAlias<From, To, VariantName>, PredicateControl {
+ string DecoderNamespace = ?; // Dummy field
+}
// Except for the NONE field, this must be kept in sync with the
// SIEncodingFamily enum in SIInstrInfo.cpp and the columns of the
diff --git a/llvm/test/MC/Disassembler/AMDGPU/gfx11_dasm_ds.txt b/llvm/test/MC/Disassembler/AMDGPU/gfx11_dasm_ds.txt
index 448cfc95de095..2730b5be92f58 100644
--- a/llvm/test/MC/Disassembler/AMDGPU/gfx11_dasm_ds.txt
+++ b/llvm/test/MC/Disassembler/AMDGPU/gfx11_dasm_ds.txt
@@ -4447,76 +4447,76 @@
# GFX11: ds_store_b128 v255, v[2:5] offset:65535 ; encoding: [0xff,0xff,0x7c,0xdb,0xff,0x02,0x00,0x00]
0xff,0xff,0x7c,0xdb,0xff,0x02,0x00,0x00
-# GFX11: ds_store_b16 v0, v1 ; encoding: [0x00,0x00,0x7c,0xd8,0x00,0x01,0x00,0x00]
+# GFX11: ds_store_b16 v0, v1.l ; encoding: [0x00,0x00,0x7c,0xd8,0x00,0x01,0x00,0x00]
0x00,0x00,0x7c,0xd8,0x00,0x01,0x00,0x00
-# GFX11: ds_store_b16 v0, v1 gds ; encoding: [0x00,0x00,0x7e,0xd8,0x00,0x01,0x00,0x00]
+# GFX11: ds_store_b16 v0, v1.l gds ; encoding: [0x00,0x00,0x7e,0xd8,0x00,0x01,0x00,0x00]
0x00,0x00,0x7e,0xd8,0x00,0x01,0x00,0x00
-# GFX11: ds_store_b16 v0, v1 offset:4660 ; encoding: [0x34,0x12,0x7c,0xd8,0x00,0x01,0x00,0x00]
+# GFX11: ds_store_b16 v0, v1.l offset:4660 ; encoding: [0x34,0x12,0x7c,0xd8,0x00,0x01,0x00,0x00]
0x34,0x12,0x7c,0xd8,0x00,0x01,0x00,0x00
-# GFX11: ds_store_b16 v0, v1 offset:4660 gds ; encoding: [0x34,0x12,0x7e,0xd8,0x00,0x01,0x00,0x00]
+# GFX11: ds_store_b16 v0, v1.l offset:4660 gds ; encoding: [0x34,0x12,0x7e,0xd8,0x00,0x01,0x00,0x00]
0x34,0x12,0x7e,0xd8,0x00,0x01,0x00,0x00
-# GFX11: ds_store_b16 v0, v1 offset:65535 ; encoding: [0xff,0xff,0x7c,0xd8,0x00,0x01,0x00,0x00]
+# GFX11: ds_store_b16 v0, v1.l offset:65535 ; encoding: [0xff,0xff,0x7c,0xd8,0x00,0x01,0x00,0x00]
0xff,0xff,0x7c,0xd8,0x00,0x01,0x00,0x00
-# GFX11: ds_store_b16 v0, v1 offset:65535 gds ; encoding: [0xff,0xff,0x7e,0xd8,0x00,0x01,0x00,0x00]
+# GFX11: ds_store_b16 v0, v1.l offset:65535 gds ; encoding: [0xff,0xff,0x7e,0xd8,0x00,0x01,0x00,0x00]
0xff,0xff,0x7e,0xd8,0x00,0x01,0x00,0x00
-# GFX11: ds_store_b16 v0, v254 ; encoding: [0x00,0x00,0x7c,0xd8,0x00,0xfe,0x00,0x00]
+# GFX11: ds_store_b16 v0, v254.l ; encoding: [0x00,0x00,0x7c,0xd8,0x00,0xfe,0x00,0x00]
0x00,0x00,0x7c,0xd8,0x00,0xfe,0x00,0x00
-# GFX11: ds_store_b16 v0, v254 gds ; encoding: [0x00,0x00,0x7e,0xd8,0x00,0xfe,0x00,0x00]
+# GFX11: ds_store_b16 v0, v254.l gds ; encoding: [0x00,0x00,0x7e,0xd8,0x00,0xfe,0x00,0x00]
0x00,0x00,0x7e,0xd8,0x00,0xfe,0x00,0x00
-# GFX11: ds_store_b16 v0, v254 offset:4660 ; encoding: [0x34,0x12,0x7c,0xd8,0x00,0xfe,0x00,0x00]
+# GFX11: ds_store_b16 v0, v254.l offset:4660 ; encoding: [0x34,0x12,0x7c,0xd8,0x00,0xfe,0x00,0x00]
0x34,0x12,0x7c,0xd8,0x00,0xfe,0x00,0x00
-# GFX11: ds_store_b16 v0, v254 offset:4660 gds ; encoding: [0x34,0x12,0x7e,0xd8,0x00,0xfe,0x00,0x00]
+# GFX11: ds_store_b16 v0, v254.l offset:4660 gds ; encoding: [0x34,0x12,0x7e,0xd8,0x00,0xfe,0x00,0x00]
0x34,0x12,0x7e,0xd8,0x00,0xfe,0x00,0x00
-# GFX11: ds_store_b16 v0, v254 offset:65535 ; encoding: [0xff,0xff,0x7c,0xd8,0x00,0xfe,0x00,0x00]
+# GFX11: ds_store_b16 v0, v254.l offset:65535 ; encoding: [0xff,0xff,0x7c,0xd8,0x00,0xfe,0x00,0x00]
0xff,0xff,0x7c,0xd8,0x00,0xfe,0x00,0x00
-# GFX11: ds_store_b16 v0, v254 offset:65535 gds ; encoding: [0xff,0xff,0x7e,0xd8,0x00,0xfe,0x00,0x00]
+# GFX11: ds_store_b16 v0, v254.l offset:65535 gds ; encoding: [0xff,0xff,0x7e,0xd8,0x00,0xfe,0x00,0x00]
0xff,0xff,0x7e,0xd8,0x00,0xfe,0x00,0x00
-# GFX11: ds_store_b16 v255, v1 ; encoding: [0x00,0x00,0x7c,0xd8,0xff,0x01,0x00,0x00]
+# GFX11: ds_store_b16 v255, v1.l ; encoding: [0x00,0x00,0x7c,0xd8,0xff,0x01,0x00,0x00]
0x00,0x00,0x7c,0xd8,0xff,0x01,0x00,0x00
-# GFX11: ds_store_b16 v255, v1 gds ; encoding: [0x00,0x00,0x7e,0xd8,0xff,0x01,0x00,0x00]
+# GFX11: ds_store_b16 v255, v1.l gds ; encoding: [0x00,0x00,0x7e,0xd8,0xff,0x01,0x00,0x00]
0x00,0x00,0x7e,0xd8,0xff,0x01,0x00,0x00
-# GFX11: ds_store_b16 v255, v1 offset:4660 ; encoding: [0x34,0x12,0x7c,0xd8,0xff,0x01,0x00,0x00]
+# GFX11: ds_store_b16 v255, v1.l offset:4660 ; encoding: [0x34,0x12,0x7c,0xd8,0xff,0x01,0x00,0x00]
0x34,0x12,0x7c,0xd8,0xff,0x01,0x00,0x00
-# GFX11: ds_store_b16 v255, v1 offset:4660 gds ; encoding: [0x34,0x12,0x7e,0xd8,0xff,0x01,0x00,0x00]
+# GFX11: ds_store_b16 v255, v1.l offset:4660 gds ; encoding: [0x34,0x12,0x7e,0xd8,0xff,0x01,0x00,0x00]
0x34,0x12,0x7e,0xd8,0xff,0x01,0x00,0x00
-# GFX11: ds_store_b16 v255, v1 offset:65535 ; encoding: [0xff,0xff,0x7c,0xd8,0xff,0x01,0x00,0x00]
+# GFX11: ds_store_b16 v255, v1.l offset:65535 ; encoding: [0xff,0xff,0x7c,0xd8,0xff,0x01,0x00,0x00]
0xff,0xff,0x7c,0xd8,0xff,0x01,0x00,0x00
-# GFX11: ds_store_b16 v255, v1 offset:65535 gds ; encoding: [0xff,0xff,0x7e,0xd8,0xff,0x01,0x00,0x00]
+# GFX11: ds_store_b16 v255, v1.l offset:65535 gds ; encoding: [0xff,0xff,0x7e,0xd8,0xff,0x01,0x00,0x00]
0xff,0xff,0x7e,0xd8,0xff,0x01,0x00,0x00
-# GFX11: ds_store_b16 v255, v254 ; encoding: [0x00,0x00,0x7c,0xd8,0xff,0xfe,0x00,0x00]
+# GFX11: ds_store_b16 v255, v254.l ; encoding: [0x00,0x00,0x7c,0xd8,0xff,0xfe,0x00,0x00]
0x00,0x00,0x7c,0xd8,0xff,0xfe,0x00,0x00
-# GFX11: ds_store_b16 v255, v254 gds ; encoding: [0x00,0x00,0x7e,0xd8,0xff,0xfe,0x00,0x00]
+# GFX11: ds_store_b16 v255, v254.l gds ; encoding: [0x00,0x00,0x7e,0xd8,0xff,0xfe,0x00,0x00]
0x00,0x00,0x7e,0xd8,0xff,0xfe,0x00,0x00
-# GFX11: ds_store_b16 v255, v254 offset:4660 ; encoding: [0x34,0x12,0x7c,0xd8,0xff,0xfe,0x00,0x00]
+# GFX11: ds_store_b16 v255, v254.l offset:4660 ; encoding: [0x34,0x12,0x7c,0xd8,0xff,0xfe,0x00,0x00]
0x34,0x12,0x7c,0xd8,0xff,0xfe,0x00,0x00
-# GFX11: ds_store_b16 v255, v254 offset:4660 gds ; encoding: [0x34,0x12,0x7e,0xd8,0xff,0xfe,0x00,0x00]
+# GFX11: ds_store_b16 v255, v254.l offset:4660 gds ; encoding: [0x34,0x12,0x7e,0xd8,0xff,0xfe,0x00,0x00]
0x34,0x12,0x7e,0xd8,0xff,0xfe,0x00,0x00
-# GFX11: ds_store_b16 v255, v254 offset:65535 ; encoding: [0xff,0xff,0x7c,0xd8,0xff,0xfe,0x00,0x00]
+# GFX11: ds_store_b16 v255, v254.l offset:65535 ; encoding: [0xff,0xff,0x7c,0xd8,0xff,0xfe,0x00,0x00]
0xff,0xff,0x7c,0xd8,0xff,0xfe,0x00,0x00
-# GFX11: ds_store_b16 v255, v254 offset:65535 gds ; encoding: [0xff,0xff,0x7e,0xd8,0xff,0xfe,0x00,0x00]
+# GFX11: ds_store_b16 v255, v254.l offset:65535 gds ; encoding: [0xff,0xff,0x7e,0xd8,0xff,0xfe,0x00,0x00]
0xff,0xff,0x7e,0xd8,0xff,0xfe,0x00,0x00
# GFX11: ds_store_b16_d16_hi v1, v2 ; encoding: [0x00,0x00,0x84,0xda,0x01,0x02,0x00,0x00]
@@ -4627,76 +4627,76 @@
# GFX11: ds_store_b64 v255, v[2:3] offset:65535 ; encoding: [0xff,0xff,0x34,0xd9,0xff,0x02,0x00,0x00]
0xff,0xff,0x34,0xd9,0xff,0x02,0x00,0x00
-# GFX11: ds_store_b8 v0, v1 ; encoding: [0x00,0x00,0x78,0xd8,0x00,0x01,0x00,0x00]
+# GFX11: ds_store_b8 v0, v1.l ; encoding: [0x00,0x00,0x78,0xd8,0x00,0x01,0x00,0x00]
0x00,0x00,0x78,0xd8,0x00,0x01,0x00,0x00
-# GFX11: ds_store_b8 v0, v1 gds ; encoding: [0x00,0x00,0x7a,0xd8,0x00,0x01,0x00,0x00]
+# GFX11: ds_store_b8 v0, v1.l gds ; encoding: [0x00,0x00,0x7a,0xd8,0x00,0x01,0x00,0x00]
0x00,0x00,0x7a,0xd8,0x00,0x01,0x00,0x00
-# GFX11: ds_store_b8 v0, v1 offset:4660 ; encoding: [0x34,0x12,0x78,0xd8,0x00,0x01,0x00,0x00]
+# GFX11: ds_store_b8 v0, v1.l offset:4660 ; encoding: [0x34,0x12,0x78,0xd8,0x00,0x01,0x00,0x00]
0x34,0x12,0x78,0xd8,0x00,0x01,0x00,0x00
-# GFX11: ds_store_b8 v0, v1 offset:4660 gds ; encoding: [0x34,0x12,0x7a,0xd8,0x00,0x01,0x00,0x00]
+# GFX11: ds_store_b8 v0, v1.l offset:4660 gds ; encoding: [0x34,0x12,0x7a,0xd8,0x00,0x01,0x00,0x00]
0x34,0x12,0x7a,0xd8,0x00,0x01,0x00,0x00
-# GFX11: ds_store_b8 v0, v1 offset:65535 ; encoding: [0xff,0xff,0x78,0xd8,0x00,0x01,0x00,0x00]
+# GFX11: ds_store_b8 v0, v1.l offset:65535 ; encoding: [0xff,0xff,0x78,0xd8,0x00,0x01,0x00,0x00]
0xff,0xff,0x78,0xd8,0x00,0x01,0x00,0x00
-# GFX11: ds_store_b8 v0, v1 offset:65535 gds ; encoding: [0xff,0xff,0x7a,0xd8,0x00,0x01,0x00,0x00]
+# GFX11: ds_store_b8 v0, v1.l offset:65535 gds ; encoding: [0xff,0xff,0x7a,0xd8,0x00,0x01,0x00,0x00]
0xff,0xff,0x7a,0xd8,0x00,0x01,0x00,0x00
-# GFX11: ds_store_b8 v0, v254 ; encoding: [0x00,0x00,0x78,0xd8,0x00,0xfe,0x00,0x00]
+# GFX11: ds_store_b8 v0, v254.l ; encoding: [0x00,0x00,0x78,0xd8,0x00,0xfe,0x00,0x00]
0x00,0x00,0x78,0xd8,0x00,0xfe,0x00,0x00
-# GFX11: ds_store_b8 v0, v254 gds ; encoding: [0x00,0x00,0x7a,0xd8,0x00,0xfe,0x00,0x00]
+# GFX11: ds_store_b8 v0, v254.l gds ; encoding: [0x00,0x00,0x7a,0xd8,0x00,0xfe,0x00,0x00]
0x00,0x00,0x7a,0xd8,0x00,0xfe,0x00,0x00
-# GFX11: ds_store_b8 v0, v254 offset:4660 ; encoding: [0x34,0x12,0x78,0xd8,0x00,0xfe,0x00,0x00]
+# GFX11: ds_store_b8 v0, v254.l offset:4660 ; encoding: [0x34,0x12,0x78,0xd8,0x00,0xfe,0x00,0x00]
0x34,0x12,0x78,0xd8,0x00,0xfe,0x00,0x00
-# GFX11: ds_store_b8 v0, v254 offset:4660 gds ; encoding: [0x34,0x12,0x7a,0xd8,0x00,0xfe,0x00,0x00]
+# GFX11: ds_store_b8 v0, v254.l offset:4660 gds ; encoding: [0x34,0x12,0x7a,0xd8,0x00,0xfe,0x00,0x00]
0x34,0x12,0x7a,0xd8,0x00,0xfe,0x00,0x00
-# GFX11: ds_store_b8 v0, v254 offset:65535 ; encoding: [0xff,0xff,0x78,0xd8,0x00,0xfe,0x00,0x00]
+# GFX11: ds_store_b8 v0, v254.l offset:65535 ; encoding: [0xff,0xff,0x78,0xd8,0x00,0xfe,0x00,0x00]
0xff,0xff,0x78,0xd8,0x00,0xfe,0x00,0x00
-# GFX11: ds_store_b8 v0, v254 offset:65535 gds ; encoding: [0xff,0xff,0x7a,0xd8,0x00,0xfe,0x00,0x00]
+# GFX11: ds_store_b8 v0, v254.l offset:65535 gds ; encoding: [0xff,0xff,0x7a,0xd8,0x00,0xfe,0x00,0x00]
0xff,0xff,0x7a,0xd8,0x00,0xfe,0x00,0x00
-# GFX11: ds_store_b8 v255, v1 ; encoding: [0x00,0x00,0x78,0xd8,0xff,0x01,0x00,0x00]
+# GFX11: ds_store_b8 v255, v1.l ; encoding: [0x00,0x00,0x78,0xd8,0xff,0x01,0x00,0x00]
0x00,0x00,0x78,0xd8,0xff,0x01,0x00,0x00
-# GFX11: ds_store_b8 v255, v1 gds ; encoding: [0x00,0x00,0x7a,0xd8,0xff,0x01,0x00,0x00]
+# GFX11: ds_store_b8 v255, v1.l gds ; encoding: [0x00,0x00,0x7a,0xd8,0xff,0x01,0x00,0x00]
0x00,0x00,0x7a,0xd8,0xff,0x01,0x00,0x00
-# GFX11: ds_store_b8 v255, v1 offset:4660 ; encoding: [0x34,0x12,0x78,0xd8,0xff,0x01,0x00,0x00]
+# GFX11: ds_store_b8 v255, v1.l offset:4660 ; encoding: [0x34,0x12,0x78,0xd8,0xff,0x01,0x00,0x00]
0x34,0x12,0x78,0xd8,0xff,0x01,0x00,0x00
-# GFX11: ds_store_b8 v255, v1 offset:4660 gds ; encoding: [0x34,0x12,0x7a,0xd8,0xff,0x01,0x00,0x00]
+# GFX11: ds_store_b8 v255, v1.l offset:4660 gds ; encoding: [0x34,0x12,0x7a,0xd8,0xff,0x01,0x00,0x00]
0x34,0x12,0x7a,0xd8,0xff,0x01,0x00,0x00
-# GFX11: ds_store_b8 v255, v1 offset:65535 ; encoding: [0xff,0xff,0x78,0xd8,0xff,0x01,0x00,0x00]
+# GFX11: ds_store_b8 v255, v1.l offset:65535 ; encoding: [0xff,0xff,0x78,0xd8,0xff,0x01,0x00,0x00]
0xff,0xff,0x78,0xd8,0xff,0x01,0x00,0x00
-# GFX11: ds_store_b8 v255, v1 offset:65535 gds ; encoding: [0xff,0xff,0x7a,0xd8,0xff,0x01,0x00,0x00]
+# GFX11: ds_store_b8 v255, v1.l offset:65535 gds ; encoding: [0xff,0xff,0x7a,0xd8,0xff,0x01,0x00,0x00]
0xff,0xff,0x7a,0xd8,0xff,0x01,0x00,0x00
-# GFX11: ds_store_b8 v255, v254 ; encoding: [0x00,0x00,0x78,0xd8,0xff,0xfe,0x00,0x00]
+# GFX11: ds_store_b8 v255, v254.l ; encoding: [0x00,0x00,0x78,0xd8,0xff,0xfe,0x00,0x00]
0x00,0x00,0x78,0xd8,0xff,0xfe,0x00,0x00
-# GFX11: ds_store_b8 v255, v254 gds ; encoding: [0x00,0x00,0x7a,0xd8,0xff,0xfe,0x00,0x00]
+# GFX11: ds_store_b8 v255, v254.l gds ; encoding: [0x00,0x00,0x7a,0xd8,0xff,0xfe,0x00,0x00]
0x00,0x00,0x7a,0xd8,0xff,0xfe,0x00,0x00
-# GFX11: ds_store_b8 v255, v254 offset:4660 ; encoding: [0x34,0x12,0x78,0xd8,0xff,0xfe,0x00,0x00]
+# GFX11: ds_store_b8 v255, v254.l offset:4660 ; encoding: [0x34,0x12,0x78,0xd8,0xff,0xfe,0x00,0x00]
0x34,0x12,0x78,0xd8,0xff,0xfe,0x00,0x00
-# GFX11: ds_store_b8 v255, v254 offset:4660 gds ; encoding: [0x34,0x12,0x7a,0xd8,0xff,0xfe,0x00,0x00]
+# GFX11: ds_store_b8 v255, v254.l offset:4660 gds ; encoding: [0x34,0x12,0x7a,0xd8,0xff,0xfe,0x00,0x00]
0x34,0x12,0x7a,0xd8,0xff,0xfe,0x00,0x00
-# GFX11: ds_store_b8 v255, v254 offset:65535 ; encoding: [0xff,0xff,0x78,0xd8,0xff,0xfe,0x00,0x00]
+# GFX11: ds_store_b8 v255, v254.l offset:65535 ; encoding: [0xff,0xff,0x78,0xd8,0xff,0xfe,0x00,0x00]
0xff,0xff,0x78,0xd8,0xff,0xfe,0x00,0x00
-# GFX11: ds_store_b8 v255, v254 offset:65535 gds ; encoding: [0xff,0xff,0x7a,0xd8,0xff,0xfe,0x00,0x00]
+# GFX11: ds_store_b8 v255, v254.l offset:65535 gds ; encoding: [0xff,0xff,0x7a,0xd8,0xff,0xfe,0x00,0x00]
0xff,0xff,0x7a,0xd8,0xff,0xfe,0x00,0x00
# GFX11: ds_store_b8_d16_hi v1, v2 ; encoding: [0x00,0x00,0x80,0xda,0x01,0x02,0x00,0x00]
diff --git a/llvm/test/MC/Disassembler/AMDGPU/gfx1250_dasm_ds.txt b/llvm/test/MC/Disassembler/AMDGPU/gfx1250_dasm_ds.txt
index 13440a06032be..6e4b6f051b39d 100644
--- a/llvm/test/MC/Disassembler/AMDGPU/gfx1250_dasm_ds.txt
+++ b/llvm/test/MC/Disassembler/AMDGPU/gfx1250_dasm_ds.txt
@@ -873,13 +873,13 @@
# GFX1250: ds_store_b128 v255, v[252:255] offset:4 ; encoding: [0x04,0x00,0x7c,0xdb,0xff,0xfc,0x00,0x00]
0x04,0x00,0x7c,0xdb,0xff,0xfc,0x00,0x00
-# GFX1250: ds_store_b16 v1, v2 ; encoding: [0x00,0x00,0x7c,0xd8,0x01,0x02,0x00,0x00]
+# GFX1250: ds_store_b16 v1, v2.l ; encoding: [0x00,0x00,0x7c,0xd8,0x01,0x02,0x00,0x00]
0x00,0x00,0x7c,0xd8,0x01,0x02,0x00,0x00
-# GFX1250: ds_store_b16 v1, v2 offset:65535 ; encoding: [0xff,0xff,0x7c,0xd8,0x01,0x02,0x00,0x00]
+# GFX1250: ds_store_b16 v1, v2.l offset:65535 ; encoding: [0xff,0xff,0x7c,0xd8,0x01,0x02,0x00,0x00]
0xff,0xff,0x7c,0xd8,0x01,0x02,0x00,0x00
-# GFX1250: ds_store_b16 v255, v255 offset:4 ; encoding: [0x04,0x00,0x7c,0xd8,0xff,0xff,0x00,0x00]
+# GFX1250: ds_store_b16 v255, v255.l offset:4 ; encoding: [0x04,0x00,0x7c,0xd8,0xff,0xff,0x00,0x00]
0x04,0x00,0x7c,0xd8,0xff,0xff,0x00,0x00
# GFX1250: ds_store_b16_d16_hi v1, v2 ; encoding: [0x00,0x00,0x84,0xda,0x01,0x02,0x00,0x00]
@@ -909,13 +909,13 @@
# GFX1250: ds_store_b64 v255, v[254:255] offset:4 ; encoding: [0x04,0x00,0x34,0xd9,0xff,0xfe,0x00,0x00]
0x04,0x00,0x34,0xd9,0xff,0xfe,0x00,0x00
-# GFX1250: ds_store_b8 v1, v2 ; encoding: [0x00,0x00,0x78,0xd8,0x01,0x02,0x00,0x00]
+# GFX1250: ds_store_b8 v1, v2.l ; encoding: [0x00,0x00,0x78,0xd8,0x01,0x02,0x00,0x00]
0x00,0x00,0x78,0xd8,0x01,0x02,0x00,0x00
-# GFX1250: ds_store_b8 v1, v2 offset:65535 ; encoding: [0xff,0xff,0x78,0xd8,0x01,0x02,0x00,0x00]
+# GFX1250: ds_store_b8 v1, v2.l offset:65535 ; encoding: [0xff,0xff,0x78,0xd8,0x01,0x02,0x00,0x00]
0xff,0xff,0x78,0xd8,0x01,0x02,0x00,0x00
-# GFX1250: ds_store_b8 v255, v255 offset:4 ; encoding: [0x04,0x00,0x78,0xd8,0xff,0xff,0x00,0x00]
+# GFX1250: ds_store_b8 v255, v255.l offset:4 ; encoding: [0x04,0x00,0x78,0xd8,0xff,0xff,0x00,0x00]
0x04,0x00,0x78,0xd8,0xff,0xff,0x00,0x00
# GFX1250: ds_store_b8_d16_hi v1, v2 ; encoding: [0x00,0x00,0x80,0xda,0x01,0x02,0x00,0x00]
diff --git a/llvm/test/MC/Disassembler/AMDGPU/gfx12_dasm_ds.txt b/llvm/test/MC/Disassembler/AMDGPU/gfx12_dasm_ds.txt
index d9381b50ca29f..8f75458419202 100644
--- a/llvm/test/MC/Disassembler/AMDGPU/gfx12_dasm_ds.txt
+++ b/llvm/test/MC/Disassembler/AMDGPU/gfx12_dasm_ds.txt
@@ -2781,40 +2781,40 @@
# GFX12: ds_store_b128 v255, v[2:5] offset:65535 ; encoding: [0xff,0xff,0x7c,0xdb,0xff,0x02,0x00,0x00]
0xff,0xff,0x7c,0xdb,0xff,0x02,0x00,0x00
-# GFX12: ds_store_b16 v0, v1 ; encoding: [0x00,0x00,0x7c,0xd8,0x00,0x01,0x00,0x00]
+# GFX12: ds_store_b16 v0, v1.l ; encoding: [0x00,0x00,0x7c,0xd8,0x00,0x01,0x00,0x00]
0x00,0x00,0x7c,0xd8,0x00,0x01,0x00,0x00
-# GFX12: ds_store_b16 v0, v1 offset:4660 ; encoding: [0x34,0x12,0x7c,0xd8,0x00,0x01,0x00,0x00]
+# GFX12: ds_store_b16 v0, v1.l offset:4660 ; encoding: [0x34,0x12,0x7c,0xd8,0x00,0x01,0x00,0x00]
0x34,0x12,0x7c,0xd8,0x00,0x01,0x00,0x00
-# GFX12: ds_store_b16 v0, v1 offset:65535 ; encoding: [0xff,0xff,0x7c,0xd8,0x00,0x01,0x00,0x00]
+# GFX12: ds_store_b16 v0, v1.l offset:65535 ; encoding: [0xff,0xff,0x7c,0xd8,0x00,0x01,0x00,0x00]
0xff,0xff,0x7c,0xd8,0x00,0x01,0x00,0x00
-# GFX12: ds_store_b16 v0, v254 ; encoding: [0x00,0x00,0x7c,0xd8,0x00,0xfe,0x00,0x00]
+# GFX12: ds_store_b16 v0, v254.l ; encoding: [0x00,0x00,0x7c,0xd8,0x00,0xfe,0x00,0x00]
0x00,0x00,0x7c,0xd8,0x00,0xfe,0x00,0x00
-# GFX12: ds...
[truncated]
|
This avoids an inconsistency in pseudo definitions I ran into for a later patch.
6ae597b
to
5892af7
Compare
@@ -4447,76 +4447,76 @@ | |||
# GFX11: ds_store_b128 v255, v[2:5] offset:65535 ; encoding: [0xff,0xff,0x7c,0xdb,0xff,0x02,0x00,0x00] | |||
0xff,0xff,0x7c,0xdb,0xff,0x02,0x00,0x00 | |||
|
|||
# GFX11: ds_store_b16 v0, v1 ; encoding: [0x00,0x00,0x7c,0xd8,0x00,0x01,0x00,0x00] | |||
# GFX11: ds_store_b16 v0, v1.l ; encoding: [0x00,0x00,0x7c,0xd8,0x00,0x01,0x00,0x00] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using the .l
syntax is not right here. This is not a true16 operand, cos you can't specify v0.h but you can specify v255.l (with an 8-bit instruction field). So it's a normal 32-bit operand but the instruction happens to only use the low 16 bits of data from it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I think Jay is right, though the docs here are somewhat misleading. The operand is labeled as a vgpr with 16 bits. However, there is no way to encode the swizzle (ie v0.h) in DS. At least I can't find any reference that these would use the hi bit of the operand field the way vop1/2/C does.
Seems #156419 is sufficient to fix the issue |
This avoids an inconsistency in pseudo definitions I
ran into for a later patch.