Skip to content

Commit 72711d4

Browse files
committed
[AMDGPU][MC] Correct definition of aliases
Differential Revision: https://reviews.llvm.org/D136370
1 parent 52f3985 commit 72711d4

18 files changed

+6955
-715
lines changed

llvm/lib/Target/AMDGPU/VOP2Instructions.td

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,8 @@ class VOP2bInstAlias <VOP2_Pseudo ps, Instruction inst,
269269
string OpName, string opnd> :
270270
InstAlias <OpName#" "#!subst("vcc", opnd, ps.Pfl.Asm32),
271271
(inst ps.Pfl.DstRC:$vdst, ps.Pfl.Src0RC32:$src0,
272-
ps.Pfl.Src1RC32:$src1)>,
272+
ps.Pfl.Src1RC32:$src1),
273+
1, inst.AsmVariantName>,
273274
PredicateControl {
274275
}
275276

@@ -331,12 +332,15 @@ multiclass
331332
class VOP2eInstAlias <VOP2_Pseudo ps, Instruction inst, string opnd = ""> :
332333
InstAlias <ps.OpName#" "#ps.Pfl.Asm32#", "#opnd,
333334
(inst ps.Pfl.DstRC:$vdst, ps.Pfl.Src0RC32:$src0,
334-
ps.Pfl.Src1RC32:$src1)>, PredicateControl;
335+
ps.Pfl.Src1RC32:$src1),
336+
1, inst.AsmVariantName>,
337+
PredicateControl;
335338

336339
class VOP2e64InstAlias <VOP3_Pseudo ps, Instruction inst> :
337340
InstAlias <ps.OpName#" "#ps.Pfl.Asm64,
338341
(inst ps.Pfl.DstRC:$vdst, VOPDstS64orS32:$sdst,
339-
ps.Pfl.Src0RC32:$src0, ps.Pfl.Src1RC32:$src1, clampmod:$clamp)>,
342+
ps.Pfl.Src0RC32:$src0, ps.Pfl.Src1RC32:$src1, clampmod:$clamp),
343+
1, inst.AsmVariantName>,
340344
PredicateControl;
341345

342346
multiclass VOP2eInstAliases<VOP2_Pseudo ps, VOP2_Real inst> {

llvm/lib/Target/AMDGPU/VOPCInstructions.td

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1404,14 +1404,14 @@ let AssemblerPredicate = isGFX11Only in {
14041404
VOPCe<op{7-0}>,
14051405
MnemonicAlias<!if(!empty(pseudo_mnemonic), ps32.Mnemonic,
14061406
pseudo_mnemonic),
1407-
asm_name>,
1407+
asm_name, ps32.AsmVariantName>,
14081408
Requires<[isGFX11Plus]>;
14091409
def _e64_gfx11 :
14101410
VOP3_Real<ps64, SIEncodingFamily.GFX11, asm_name>,
14111411
VOP3a_gfx11<{0, op}, ps64.Pfl>,
14121412
MnemonicAlias<!if(!empty(pseudo_mnemonic), ps64.Mnemonic,
14131413
pseudo_mnemonic),
1414-
asm_name>,
1414+
asm_name, ps64.AsmVariantName>,
14151415
Requires<[isGFX11Plus]> {
14161416
// Encoding used for VOPC instructions encoded as VOP3 differs from
14171417
// VOP3e by destination name (sdst) as VOPC doesn't have vector dst.
@@ -1568,7 +1568,7 @@ let AssemblerPredicate = isGFX11Only in {
15681568
: VOPC_Real<ps32, SIEncodingFamily.GFX11, asm_name>,
15691569
MnemonicAlias<!if(!empty(pseudo_mnemonic), !subst("_nosdst", "", ps32.Mnemonic),
15701570
pseudo_mnemonic),
1571-
asm_name>,
1571+
asm_name, ps32.AsmVariantName>,
15721572
Requires<[isGFX11Plus]>,
15731573
VOPCe<op{7-0}> {
15741574
let AsmString = asm_name # "{_e32} " # ps32.AsmOperands;
@@ -1577,7 +1577,7 @@ let AssemblerPredicate = isGFX11Only in {
15771577
: VOP3_Real<ps64, SIEncodingFamily.GFX11, asm_name>,
15781578
MnemonicAlias<!if(!empty(pseudo_mnemonic), !subst("_nosdst", "", ps64.Mnemonic),
15791579
pseudo_mnemonic),
1580-
asm_name>,
1580+
asm_name, ps64.AsmVariantName>,
15811581
Requires<[isGFX11Plus]>,
15821582
VOP3a_gfx11<{0, op}, ps64.Pfl> {
15831583
let Inst{7-0} = ? ; // sdst

llvm/test/MC/AMDGPU/gfx10_asm_vop2.s

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ v_cndmask_b32_e64 v5, v1, v2, s[100:101]
101101

102102
v_cndmask_b32_e64 v5, v1, v2, vcc
103103
// W64: encoding: [0x05,0x00,0x01,0xd5,0x01,0x05,0xaa,0x01]
104-
// W32-ERR: :[[@LINE-2]]:{{[0-9]+}}: error: operands are not valid for this GPU or mode
104+
// W32-ERR: :[[@LINE-2]]:{{[0-9]+}}: error: invalid operand for instruction
105105

106106
v_cndmask_b32_e64 v5, -v1, |v2|, vcc
107107
// W64: encoding: [0x05,0x02,0x01,0xd5,0x01,0x05,0xaa,0x21]
@@ -229,7 +229,7 @@ v_cndmask_b32_e64 v5, v1, v2, s100
229229

230230
v_cndmask_b32_e64 v5, v1, v2, vcc_lo
231231
// W32: encoding: [0x05,0x00,0x01,0xd5,0x01,0x05,0xaa,0x01]
232-
// W64-ERR: :[[@LINE-2]]:{{[0-9]+}}: error: operands are not valid for this GPU or mode
232+
// W64-ERR: :[[@LINE-2]]:{{[0-9]+}}: error: invalid operand for instruction
233233

234234
v_cndmask_b32_e64 v5, -v1, |v2|, vcc_lo
235235
// W32: encoding: [0x05,0x02,0x01,0xd5,0x01,0x05,0xaa,0x21]

0 commit comments

Comments
 (0)