[llvm] [AMDGPU] Clean up and share SOP Real instruction definitions (PR #80990)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 7 05:44:48 PST 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-backend-amdgpu
Author: Jay Foad (jayfoad)
<details>
<summary>Changes</summary>
- [AMDGPU] Remove unused SOP multiclasses
- [AMDGPU] Swap arguments of multiclasses for Renamed SOP instructions
- [AMDGPU] Remove Renamed multiclasses for SOP Real instructions
- [AMDGPU] Share all SOP Real instruction definitions with the same opcode
---
Patch is 31.25 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/80990.diff
1 Files Affected:
- (modified) llvm/lib/Target/AMDGPU/SOPInstructions.td (+146-207)
``````````diff
diff --git a/llvm/lib/Target/AMDGPU/SOPInstructions.td b/llvm/lib/Target/AMDGPU/SOPInstructions.td
index 61cfe321df059..c8e8ad2034dc9 100644
--- a/llvm/lib/Target/AMDGPU/SOPInstructions.td
+++ b/llvm/lib/Target/AMDGPU/SOPInstructions.td
@@ -547,9 +547,9 @@ class SOP2_Pseudo<string opName, dag outs, dag ins,
// field bits<7> sdst = 0;
}
-class SOP2_Real<SOP_Pseudo ps, string real_name = ps.Mnemonic> :
+class SOP2_Real<SOP_Pseudo ps, string name = ps.Mnemonic> :
InstSI <ps.OutOperandList, ps.InOperandList,
- real_name # ps.AsmOperands> {
+ name # ps.AsmOperands> {
let SALU = 1;
let SOP2 = 1;
let isPseudo = 0;
@@ -573,8 +573,8 @@ class SOP2_Real<SOP_Pseudo ps, string real_name = ps.Mnemonic> :
bits<32> imm;
}
-class SOP2_Real32<bits<7> op, SOP_Pseudo ps, string real_name = ps.Mnemonic> :
- SOP2_Real<ps, real_name>, Enc32 {
+class SOP2_Real32<bits<7> op, SOP_Pseudo ps, string name = ps.Mnemonic> :
+ SOP2_Real<ps, name>, Enc32 {
let Inst{7-0} = src0;
let Inst{15-8} = src1;
let Inst{22-16} = !if(ps.has_sdst, sdst, ?);
@@ -582,8 +582,8 @@ class SOP2_Real32<bits<7> op, SOP_Pseudo ps, string real_name = ps.Mnemonic> :
let Inst{31-30} = 0x2; // encoding
}
-class SOP2_Real64<bits<7> op, SOP_Pseudo ps, string real_name = ps.Mnemonic> :
- SOP2_Real<ps, real_name>, Enc64 {
+class SOP2_Real64<bits<7> op, SOP_Pseudo ps, string name = ps.Mnemonic> :
+ SOP2_Real<ps, name>, Enc64 {
let Inst{7-0} = src0;
let Inst{15-8} = src1;
let Inst{22-16} = !if(ps.has_sdst, sdst, ?);
@@ -958,9 +958,9 @@ class SOPK_Pseudo <string opName, dag outs, dag ins,
let has_sdst = 1;
}
-class SOPK_Real<SOPK_Pseudo ps, string real_name = ps.Mnemonic> :
+class SOPK_Real<SOPK_Pseudo ps, string name = ps.Mnemonic> :
InstSI <ps.OutOperandList, ps.InOperandList,
- real_name # ps.AsmOperands> {
+ name # ps.AsmOperands> {
let SALU = 1;
let SOPK = 1;
let isPseudo = 0;
@@ -984,8 +984,8 @@ class SOPK_Real<SOPK_Pseudo ps, string real_name = ps.Mnemonic> :
bits<32> imm;
}
-class SOPK_Real32<bits<5> op, SOPK_Pseudo ps, string real_name = ps.Mnemonic> :
- SOPK_Real <ps, real_name>,
+class SOPK_Real32<bits<5> op, SOPK_Pseudo ps, string name = ps.Mnemonic> :
+ SOPK_Real <ps, name>,
Enc32 {
let Inst{15-0} = simm16;
let Inst{22-16} = !if(ps.has_sdst, sdst, ?);
@@ -1412,9 +1412,9 @@ class SOPPRelaxTable <bit isRelaxed, string keyName, string gfxip> {
string KeyName = keyName # gfxip;
}
-class SOPP_Real<SOPP_Pseudo ps, string real_name = ps.Mnemonic> :
+class SOPP_Real<SOPP_Pseudo ps, string name = ps.Mnemonic> :
InstSI <ps.OutOperandList, ps.InOperandList,
- real_name # ps.AsmOperands> {
+ name # ps.AsmOperands> {
let SALU = 1;
let SOPP = 1;
let isPseudo = 0;
@@ -1432,14 +1432,14 @@ class SOPP_Real<SOPP_Pseudo ps, string real_name = ps.Mnemonic> :
bits <16> simm16;
}
-class SOPP_Real_32 <bits<7> op, SOPP_Pseudo ps, string real_name = ps.Mnemonic> : SOPP_Real<ps, real_name>,
+class SOPP_Real_32 <bits<7> op, SOPP_Pseudo ps, string name = ps.Mnemonic> : SOPP_Real<ps, name>,
Enc32 {
let Inst{15-0} = !if(ps.fixed_imm, ps.simm16, simm16);
let Inst{22-16} = op;
let Inst{31-23} = 0x17f;
}
-class SOPP_Real_64 <bits<7> op, SOPP_Pseudo ps, string real_name = ps.Mnemonic> : SOPP_Real<ps, real_name>,
+class SOPP_Real_64 <bits<7> op, SOPP_Pseudo ps, string name = ps.Mnemonic> : SOPP_Real<ps, name>,
Enc64 {
// encoding
let Inst{15-0} = !if(ps.fixed_imm, ps.simm16, simm16);
@@ -1953,9 +1953,20 @@ class Select_gfx6_gfx7<string opName> : SIMCInstr<opName, SIEncodingFamily.SI> {
// SOP1 - GFX11, GFX12
//===----------------------------------------------------------------------===//
-multiclass SOP1_Real_gfx12<bits<8> op> {
- def _gfx12 : SOP1_Real<op, !cast<SOP1_Pseudo>(NAME)>,
- Select_gfx12<!cast<SOP1_Pseudo>(NAME).Mnemonic>;
+multiclass SOP1_Real_gfx11<bits<8> op, string name = !tolower(NAME)> {
+ defvar ps = !cast<SOP1_Pseudo>(NAME);
+ def _gfx11 : SOP1_Real<op, ps, name>,
+ Select_gfx11<ps.Mnemonic>;
+ if !ne(ps.Mnemonic, name) then
+ def : MnemonicAlias<ps.Mnemonic, name>, Requires<[isGFX11Only]>;
+}
+
+multiclass SOP1_Real_gfx12<bits<8> op, string name = !tolower(NAME)> {
+ defvar ps = !cast<SOP1_Pseudo>(NAME);
+ def _gfx12 : SOP1_Real<op, ps, name>,
+ Select_gfx12<ps.Mnemonic>;
+ if !ne(ps.Mnemonic, name) then
+ def : MnemonicAlias<ps.Mnemonic, name>, Requires<[isGFX12Plus]>;
}
multiclass SOP1_M0_Real_gfx12<bits<8> op> {
@@ -1965,31 +1976,14 @@ multiclass SOP1_M0_Real_gfx12<bits<8> op> {
}
}
-multiclass SOP1_Real_gfx11<bits<8> op> {
- def _gfx11 : SOP1_Real<op, !cast<SOP1_Pseudo>(NAME)>,
- Select_gfx11<!cast<SOP1_Pseudo>(NAME).Mnemonic>;
-}
-
-multiclass SOP1_Real_Renamed_gfx12<bits<8> op, SOP1_Pseudo backing_pseudo> {
- defvar real_name = !tolower(NAME);
- def _gfx12 : SOP1_Real<op, backing_pseudo, real_name>,
- Select_gfx12<backing_pseudo.Mnemonic>,
- MnemonicAlias<backing_pseudo.Mnemonic, real_name>, Requires<[isGFX12Plus]>;
-}
-
-multiclass SOP1_Real_Renamed_gfx11<bits<8> op, SOP1_Pseudo backing_pseudo> {
- defvar real_name = !tolower(NAME);
- def _gfx11 : SOP1_Real<op, backing_pseudo, real_name>,
- Select_gfx11<backing_pseudo.Mnemonic>,
- MnemonicAlias<backing_pseudo.Mnemonic, real_name>, Requires<[isGFX11Only]>;
+multiclass SOP1_IMM_Real_gfx12<bits<8> op> {
+ defvar ps = !cast<SOP1_Pseudo>(NAME);
+ def _gfx12 : SOP1_Real<op, ps>,
+ Select_gfx12<ps.Mnemonic>;
}
-multiclass SOP1_Real_gfx11_gfx12<bits<8> op> :
- SOP1_Real_gfx11<op>, SOP1_Real_gfx12<op>;
-
-multiclass SOP1_Real_Renamed_gfx11_gfx12<bits<8> op, SOP1_Pseudo backing_pseudo> :
- SOP1_Real_Renamed_gfx11<op, backing_pseudo>,
- SOP1_Real_Renamed_gfx12<op, backing_pseudo>;
+multiclass SOP1_Real_gfx11_gfx12<bits<8> op, string name = !tolower(NAME)> :
+ SOP1_Real_gfx11<op, name>, SOP1_Real_gfx12<op, name>;
defm S_MOV_B32 : SOP1_Real_gfx11_gfx12<0x000>;
defm S_MOV_B64 : SOP1_Real_gfx11_gfx12<0x001>;
@@ -1997,12 +1991,12 @@ defm S_CMOV_B32 : SOP1_Real_gfx11_gfx12<0x002>;
defm S_CMOV_B64 : SOP1_Real_gfx11_gfx12<0x003>;
defm S_BREV_B32 : SOP1_Real_gfx11_gfx12<0x004>;
defm S_BREV_B64 : SOP1_Real_gfx11_gfx12<0x005>;
-defm S_CTZ_I32_B32 : SOP1_Real_Renamed_gfx11_gfx12<0x008, S_FF1_I32_B32>;
-defm S_CTZ_I32_B64 : SOP1_Real_Renamed_gfx11_gfx12<0x009, S_FF1_I32_B64>;
-defm S_CLZ_I32_U32 : SOP1_Real_Renamed_gfx11_gfx12<0x00a, S_FLBIT_I32_B32>;
-defm S_CLZ_I32_U64 : SOP1_Real_Renamed_gfx11_gfx12<0x00b, S_FLBIT_I32_B64>;
-defm S_CLS_I32 : SOP1_Real_Renamed_gfx11_gfx12<0x00c, S_FLBIT_I32>;
-defm S_CLS_I32_I64 : SOP1_Real_Renamed_gfx11_gfx12<0x00d, S_FLBIT_I32_I64>;
+defm S_FF1_I32_B32 : SOP1_Real_gfx11_gfx12<0x008, "s_ctz_i32_b32">;
+defm S_FF1_I32_B64 : SOP1_Real_gfx11_gfx12<0x009, "s_ctz_i32_b64">;
+defm S_FLBIT_I32_B32 : SOP1_Real_gfx11_gfx12<0x00a, "s_clz_i32_u32">;
+defm S_FLBIT_I32_B64 : SOP1_Real_gfx11_gfx12<0x00b, "s_clz_i32_u64">;
+defm S_FLBIT_I32 : SOP1_Real_gfx11_gfx12<0x00c, "s_cls_i32">;
+defm S_FLBIT_I32_I64 : SOP1_Real_gfx11_gfx12<0x00d, "s_cls_i32_i64">;
defm S_SEXT_I32_I8 : SOP1_Real_gfx11_gfx12<0x00e>;
defm S_SEXT_I32_I16 : SOP1_Real_gfx11_gfx12<0x00f>;
defm S_BITSET0_B32 : SOP1_Real_gfx11_gfx12<0x010>;
@@ -2032,19 +2026,18 @@ defm S_NAND_SAVEEXEC_B64 : SOP1_Real_gfx11_gfx12<0x027>;
defm S_NOR_SAVEEXEC_B32 : SOP1_Real_gfx11_gfx12<0x028>;
defm S_NOR_SAVEEXEC_B64 : SOP1_Real_gfx11_gfx12<0x029>;
defm S_XNOR_SAVEEXEC_B32 : SOP1_Real_gfx11_gfx12<0x02a>;
-/*defm S_XNOR_SAVEEXEC_B64 : SOP1_Real_gfx11_gfx12<0x02b>; //same as older arch, handled there*/
-defm S_AND_NOT0_SAVEEXEC_B32 : SOP1_Real_Renamed_gfx11_gfx12<0x02c, S_ANDN1_SAVEEXEC_B32>;
-defm S_AND_NOT0_SAVEEXEC_B64 : SOP1_Real_Renamed_gfx11_gfx12<0x02d, S_ANDN1_SAVEEXEC_B64>;
-defm S_OR_NOT0_SAVEEXEC_B32 : SOP1_Real_Renamed_gfx11_gfx12<0x02e, S_ORN1_SAVEEXEC_B32>;
-defm S_OR_NOT0_SAVEEXEC_B64 : SOP1_Real_Renamed_gfx11_gfx12<0x02f, S_ORN1_SAVEEXEC_B64>;
-defm S_AND_NOT1_SAVEEXEC_B32 : SOP1_Real_Renamed_gfx11_gfx12<0x030, S_ANDN2_SAVEEXEC_B32>;
-defm S_AND_NOT1_SAVEEXEC_B64 : SOP1_Real_Renamed_gfx11_gfx12<0x031, S_ANDN2_SAVEEXEC_B64>;
-defm S_OR_NOT1_SAVEEXEC_B32 : SOP1_Real_Renamed_gfx11_gfx12<0x032, S_ORN2_SAVEEXEC_B32>;
-defm S_OR_NOT1_SAVEEXEC_B64 : SOP1_Real_Renamed_gfx11_gfx12<0x033, S_ORN2_SAVEEXEC_B64>;
-defm S_AND_NOT0_WREXEC_B32 : SOP1_Real_Renamed_gfx11_gfx12<0x034, S_ANDN1_WREXEC_B32>;
-defm S_AND_NOT0_WREXEC_B64 : SOP1_Real_Renamed_gfx11_gfx12<0x035, S_ANDN1_WREXEC_B64>;
-defm S_AND_NOT1_WREXEC_B32 : SOP1_Real_Renamed_gfx11_gfx12<0x036, S_ANDN2_WREXEC_B32>;
-defm S_AND_NOT1_WREXEC_B64 : SOP1_Real_Renamed_gfx11_gfx12<0x037, S_ANDN2_WREXEC_B64>;
+defm S_ANDN1_SAVEEXEC_B32 : SOP1_Real_gfx11_gfx12<0x02c, "s_and_not0_saveexec_b32">;
+defm S_ANDN1_SAVEEXEC_B64 : SOP1_Real_gfx11_gfx12<0x02d, "s_and_not0_saveexec_b64">;
+defm S_ORN1_SAVEEXEC_B32 : SOP1_Real_gfx11_gfx12<0x02e, "s_or_not0_saveexec_b32">;
+defm S_ORN1_SAVEEXEC_B64 : SOP1_Real_gfx11_gfx12<0x02f, "s_or_not0_saveexec_b64">;
+defm S_ANDN2_SAVEEXEC_B32 : SOP1_Real_gfx11_gfx12<0x030, "s_and_not1_saveexec_b32">;
+defm S_ANDN2_SAVEEXEC_B64 : SOP1_Real_gfx11_gfx12<0x031, "s_and_not1_saveexec_b64">;
+defm S_ORN2_SAVEEXEC_B32 : SOP1_Real_gfx11_gfx12<0x032, "s_or_not1_saveexec_b32">;
+defm S_ORN2_SAVEEXEC_B64 : SOP1_Real_gfx11_gfx12<0x033, "s_or_not1_saveexec_b64">;
+defm S_ANDN1_WREXEC_B32 : SOP1_Real_gfx11_gfx12<0x034, "s_and_not0_wrexec_b32">;
+defm S_ANDN1_WREXEC_B64 : SOP1_Real_gfx11_gfx12<0x035, "s_and_not0_wrexec_b64">;
+defm S_ANDN2_WREXEC_B32 : SOP1_Real_gfx11_gfx12<0x036, "s_and_not1_wrexec_b32">;
+defm S_ANDN2_WREXEC_B64 : SOP1_Real_gfx11_gfx12<0x037, "s_and_not1_wrexec_b64">;
defm S_MOVRELS_B32 : SOP1_Real_gfx11_gfx12<0x040>;
defm S_MOVRELS_B64 : SOP1_Real_gfx11_gfx12<0x041>;
defm S_MOVRELD_B32 : SOP1_Real_gfx11_gfx12<0x042>;
@@ -2062,13 +2055,13 @@ defm S_GET_BARRIER_STATE_M0 : SOP1_M0_Real_gfx12<0x050>;
defm S_BARRIER_INIT_M0 : SOP1_M0_Real_gfx12<0x051>;
defm S_BARRIER_JOIN_M0 : SOP1_M0_Real_gfx12<0x052>;
defm S_WAKEUP_BARRIER_M0 : SOP1_M0_Real_gfx12<0x057>;
-defm S_BARRIER_SIGNAL_IMM : SOP1_Real_gfx12<0x04e>;
-defm S_BARRIER_SIGNAL_ISFIRST_IMM : SOP1_Real_gfx12<0x04f>;
-defm S_GET_BARRIER_STATE_IMM : SOP1_Real_gfx12<0x050>;
-defm S_BARRIER_INIT_IMM : SOP1_Real_gfx12<0x051>;
-defm S_BARRIER_JOIN_IMM : SOP1_Real_gfx12<0x052>;
-defm S_WAKEUP_BARRIER_IMM : SOP1_Real_gfx12<0x057>;
-defm S_SLEEP_VAR : SOP1_Real_gfx12<0x058>;
+defm S_BARRIER_SIGNAL_IMM : SOP1_IMM_Real_gfx12<0x04e>;
+defm S_BARRIER_SIGNAL_ISFIRST_IMM : SOP1_IMM_Real_gfx12<0x04f>;
+defm S_GET_BARRIER_STATE_IMM : SOP1_IMM_Real_gfx12<0x050>;
+defm S_BARRIER_INIT_IMM : SOP1_IMM_Real_gfx12<0x051>;
+defm S_BARRIER_JOIN_IMM : SOP1_IMM_Real_gfx12<0x052>;
+defm S_WAKEUP_BARRIER_IMM : SOP1_IMM_Real_gfx12<0x057>;
+defm S_SLEEP_VAR : SOP1_IMM_Real_gfx12<0x058>;
//===----------------------------------------------------------------------===//
// SOP1 - GFX1150, GFX12
@@ -2193,56 +2186,33 @@ defm S_ABS_I32 : SOP1_Real_gfx6_gfx7_gfx10<0x034>;
// SOP2 - GFX12
//===----------------------------------------------------------------------===//
-multiclass SOP2_Real_gfx12<bits<7> op> {
- def _gfx12 : SOP2_Real32<op, !cast<SOP2_Pseudo>(NAME)>,
- Select_gfx12<!cast<SOP2_Pseudo>(NAME).Mnemonic>;
-}
-
-multiclass SOP2_Real_Renamed_gfx12<bits<7> op, SOP2_Pseudo backing_pseudo> {
- defvar real_name = !tolower(NAME);
- def _gfx12 : SOP2_Real32<op, backing_pseudo, real_name>,
- Select_gfx12<backing_pseudo.Mnemonic>,
- MnemonicAlias<backing_pseudo.Mnemonic, real_name>, Requires<[isGFX12Plus]>;
+multiclass SOP2_Real_gfx12<bits<7> op, string name = !tolower(NAME)> {
+ defvar ps = !cast<SOP2_Pseudo>(NAME);
+ def _gfx12 : SOP2_Real32<op, ps, name>,
+ Select_gfx12<ps.Mnemonic>;
+ if !ne(ps.Mnemonic, name) then
+ def : MnemonicAlias<ps.Mnemonic, name>, Requires<[isGFX12Plus]>;
}
-defm S_MIN_NUM_F32 : SOP2_Real_Renamed_gfx12<0x042, S_MIN_F32>;
-defm S_MAX_NUM_F32 : SOP2_Real_Renamed_gfx12<0x043, S_MAX_F32>;
-defm S_MIN_NUM_F16 : SOP2_Real_Renamed_gfx12<0x04b, S_MIN_F16>;
-defm S_MAX_NUM_F16 : SOP2_Real_Renamed_gfx12<0x04c, S_MAX_F16>;
defm S_MINIMUM_F32 : SOP2_Real_gfx12<0x04f>;
defm S_MAXIMUM_F32 : SOP2_Real_gfx12<0x050>;
defm S_MINIMUM_F16 : SOP2_Real_gfx12<0x051>;
defm S_MAXIMUM_F16 : SOP2_Real_gfx12<0x052>;
-defm S_ADD_CO_U32 : SOP2_Real_Renamed_gfx12<0x000, S_ADD_U32>;
-defm S_SUB_CO_U32 : SOP2_Real_Renamed_gfx12<0x001, S_SUB_U32>;
-defm S_ADD_CO_I32 : SOP2_Real_Renamed_gfx12<0x002, S_ADD_I32>;
-defm S_SUB_CO_I32 : SOP2_Real_Renamed_gfx12<0x003, S_SUB_I32>;
-defm S_ADD_CO_CI_U32 : SOP2_Real_Renamed_gfx12<0x004, S_ADDC_U32>;
-defm S_SUB_CO_CI_U32 : SOP2_Real_Renamed_gfx12<0x005, S_SUBB_U32>;
-
//===----------------------------------------------------------------------===//
// SOP2 - GFX11, GFX12.
//===----------------------------------------------------------------------===//
-multiclass SOP2_Real_gfx11<bits<7> op> {
- def _gfx11 : SOP2_Real32<op, !cast<SOP2_Pseudo>(NAME)>,
- Select_gfx11<!cast<SOP2_Pseudo>(NAME).Mnemonic>;
-}
-
-multiclass SOP2_Real_Renamed_gfx11<bits<7> op, SOP2_Pseudo backing_pseudo> {
- defvar real_name = !tolower(NAME);
- def _gfx11 : SOP2_Real32<op, backing_pseudo, real_name>,
- Select_gfx11<backing_pseudo.Mnemonic>,
- MnemonicAlias<backing_pseudo.Mnemonic, real_name>, Requires<[isGFX11Only]>;
+multiclass SOP2_Real_gfx11<bits<7> op, string name = !tolower(NAME)> {
+ defvar ps = !cast<SOP2_Pseudo>(NAME);
+ def _gfx11 : SOP2_Real32<op, ps, name>,
+ Select_gfx11<ps.Mnemonic>;
+ if !ne(ps.Mnemonic, name) then
+ def : MnemonicAlias<ps.Mnemonic, name>, Requires<[isGFX11Only]>;
}
-multiclass SOP2_Real_gfx11_gfx12<bits<7> op> :
- SOP2_Real_gfx11<op>, SOP2_Real_gfx12<op>;
-
-multiclass SOP2_Real_Renamed_gfx11_gfx12<bits<8> op, SOP2_Pseudo backing_pseudo> :
- SOP2_Real_Renamed_gfx11<op, backing_pseudo>,
- SOP2_Real_Renamed_gfx12<op, backing_pseudo>;
+multiclass SOP2_Real_gfx11_gfx12<bits<7> op, string name = !tolower(NAME)> :
+ SOP2_Real_gfx11<op, name>, SOP2_Real_gfx12<op, name>;
defm S_ABSDIFF_I32 : SOP2_Real_gfx11_gfx12<0x006>;
defm S_LSHL_B32 : SOP2_Real_gfx11_gfx12<0x008>;
@@ -2271,10 +2241,10 @@ defm S_NOR_B32 : SOP2_Real_gfx11_gfx12<0x01e>;
defm S_NOR_B64 : SOP2_Real_gfx11_gfx12<0x01f>;
defm S_XNOR_B32 : SOP2_Real_gfx11_gfx12<0x020>;
defm S_XNOR_B64 : SOP2_Real_gfx11_gfx12<0x021>;
-defm S_AND_NOT1_B32 : SOP2_Real_Renamed_gfx11_gfx12<0x022, S_ANDN2_B32>;
-defm S_AND_NOT1_B64 : SOP2_Real_Renamed_gfx11_gfx12<0x023, S_ANDN2_B64>;
-defm S_OR_NOT1_B32 : SOP2_Real_Renamed_gfx11_gfx12<0x024, S_ORN2_B32>;
-defm S_OR_NOT1_B64 : SOP2_Real_Renamed_gfx11_gfx12<0x025, S_ORN2_B64>;
+defm S_ANDN2_B32 : SOP2_Real_gfx11_gfx12<0x022, "s_and_not1_b32">;
+defm S_ANDN2_B64 : SOP2_Real_gfx11_gfx12<0x023, "s_and_not1_b64">;
+defm S_ORN2_B32 : SOP2_Real_gfx11_gfx12<0x024, "s_or_not1_b32">;
+defm S_ORN2_B64 : SOP2_Real_gfx11_gfx12<0x025, "s_or_not1_b64">;
defm S_BFE_U32 : SOP2_Real_gfx11_gfx12<0x026>;
defm S_BFE_I32 : SOP2_Real_gfx11_gfx12<0x027>;
defm S_BFE_U64 : SOP2_Real_gfx11_gfx12<0x028>;
@@ -2287,8 +2257,8 @@ defm S_MUL_HI_I32 : SOP2_Real_gfx11_gfx12<0x02e>;
defm S_CSELECT_B32 : SOP2_Real_gfx11_gfx12<0x030>;
defm S_CSELECT_B64 : SOP2_Real_gfx11_gfx12<0x031>;
defm S_PACK_HL_B32_B16 : SOP2_Real_gfx11_gfx12<0x035>;
-defm S_ADD_NC_U64 : SOP2_Real_Renamed_gfx12<0x053, S_ADD_U64>;
-defm S_SUB_NC_U64 : SOP2_Real_Renamed_gfx12<0x054, S_SUB_U64>;
+defm S_ADD_U64 : SOP2_Real_gfx12<0x053, "s_add_nc_u64">;
+defm S_SUB_U64 : SOP2_Real_gfx12<0x054, "s_sub_nc_u64">;
defm S_MUL_U64 : SOP2_Real_gfx12<0x055>;
//===----------------------------------------------------------------------===//
@@ -2324,10 +2294,13 @@ defm S_FMAC_F16 : SOP2_Real_gfx11_gfx12<0x04e>;
// SOP2 - GFX1150
//===----------------------------------------------------------------------===//
-defm S_MIN_F32 : SOP2_Real_gfx11<0x042>;
-defm S_MAX_F32 : SOP2_Real_gfx11<0x043>;
-defm S_MIN_F16 : SOP2_Real_gfx11<0x04b>;
-defm S_MAX_F16 : SOP2_Real_gfx11<0x04c>;
+multiclass SOP2_Real_gfx11_Renamed_gfx12<bits<7> op, string gfx12_name> :
+ SOP2_Real_gfx11<op>, SOP2_Real_gfx12<op, gfx12_name>;
+
+defm S_MIN_F32 : SOP2_Real_gfx11_Renamed_gfx12<0x042, "s_min_num_f32">;
+defm S_MAX_F32 : SOP2_Real_gfx11_Renamed_gfx12<0x043, "s_max_num_f32">;
+defm S_MIN_F16 : SOP2_Real_gfx11_Renamed_gfx12<0x04b, "s_min_num_f16">;
+defm S_MAX_F16 : SOP2_Real_gfx11_Renamed_gfx12<0x04c, "s_max_num_f16">;
//===----------------------------------------------------------------------===//
// SOP2 - GFX10.
@@ -2357,7 +2330,7 @@ defm S_MUL_HI_I32 : SOP2_Real_gfx10<0x036>;
//===----------------------------------------------------------------------===//
multiclass SOP2_Real_gfx6_gfx7<bits<7> op> {
- defvar ps = !cast<SOP_Pseudo>(NAME);
+ defvar ps = !cast<SOP2_Pseudo>(NAME);
def _gfx6_gfx7 : SOP2_Real32<op, ps>,
Select_gfx6_gfx7<ps.Mnemonic>;
}
@@ -2365,20 +2338,18 @@ multiclass SOP2_Real_gfx6_gfx7<bits<7> op> {
multiclass SOP2_Real_gfx6_gfx7_gfx10<bits<7> op> :
SOP2_Real_gfx6_gfx7<op>, SOP2_Real_gfx10<op>;
-multiclass SOP2_Real_gfx6_gfx7_gfx10_gfx11<bits<7> op> :
- SOP2_Real_gfx6_gfx7<op>, SOP2_Real_gfx10<op>, SOP2_Real_gfx11<op>;
-
-multiclass SOP2_Real_gfx6_gfx7_gfx10_gfx11_gfx12<bits<7> op> :
- SOP2_Real_gfx6_gfx7<op>, SOP2_Real_gfx10_gfx11_gfx12<op>;
+multiclass SOP2_Real_gfx6_gfx7_gfx10_gfx11_Renamed_gfx12<bits<7> op, string gfx12_name> :
+ SOP2_Real_gfx6_gfx7<op>, SOP2_Real_gfx10<op>, SOP2_Real_gfx11<op>,
+ SOP2_Real_gfx12<op, gfx12_name>;
defm S_CBRANCH_G_FORK : SOP2_Real_gfx6_gfx7<0x02b>;
-defm S_ADD_U32 : SOP2_Real_gfx6_gfx7_gfx10_gfx11<0x000>;
-defm S_SUB_U32 : SOP2_Real_gfx6_gfx7_gfx10_gfx11<0x001>;
-defm S_ADD_I32 : SOP2_Real_gfx6_gfx7_gfx10_gfx11<0x002>;
-defm S_SUB_I32 : SOP2_Real_gfx6_gfx7_gfx10_gfx11<0x003>;
-defm S_ADDC_U32 : SOP2_Real_gfx6_gfx7_gfx10_gfx11<0x004>;
-defm S_SUBB_U32 : SOP2_Real_gfx6_gfx7_gfx10_gfx11<0x005>;
+defm S_ADD_U32 : SOP2_Real_gfx6_gfx7_gfx10_gfx11_Renamed_gfx12<0x000, "s_add_co_u32">;
+defm S_SUB_U32 : SOP2_Real_gfx6_gfx7_gfx10_gfx11_Renamed_gfx12<0x001, "s_sub_co_u32">;
+defm S_ADD_I32 : SOP2_Real_gfx6_gfx7_gfx10_gfx11_Renamed_gfx12<0x002, "s_add_co_i32">;
+defm S_SUB_I32 : SOP2_Real_gfx6_gfx7_gfx10_gfx11_Renamed_gfx12<0x003, "s_sub_co_i32">;
+defm S_ADDC_U32 : SOP2_Real_gfx6_gfx7_gfx10_gfx11_Renamed_gfx12<0x004, "s_add_co_ci_u32">;
+defm S_SUBB_U32 : SOP2_Real_gfx6_gfx7_gfx10_gfx11_Renamed_gfx12<0x005, "s_sub_co_ci_u32">;
defm S_MIN_I32 : SOP2_Real_gfx6_gfx7_gfx10<0x006>;
defm S_MIN_U32 : SOP2_Real_gfx6_gfx7_gfx10<0x007>;
defm S_MAX_I32 : SOP2_Real_gfx6_gfx7_gfx10<0x008>;
@@ -2420,16 +2391,12 @@ defm S_ABSDIFF_I32 : SOP2_Real_gfx6_gfx7_gfx10<0x02c>;
// SOPK - GFX11, GFX12.
//===----------------------------------------------------------------------===//
-multiclass SOPK_Real32_gfx12<bits<5> op> {
- def _gfx12 : SOPK_Real32<op, !cast<SOPK_Pseudo>(NAME)>,
- Select_gfx12<!cast<SOPK_Pseudo>(NAME).Mnemonic>;
-}
-
-multiclass SOPK_Real32_Renamed_gfx12<bits<5> op, SOPK_Pseudo backing_pseudo> {
- defvar real_name = !tolower(NAME);
- def _gfx12 : SOPK_Real32<op, backing_pseudo, real_name>,
- S...
[truncated]
``````````
</details>
https://github.com/llvm/llvm-project/pull/80990
More information about the llvm-commits
mailing list