Skip to content

Commit 2d945ef

Browse files
committed
[AMDGPU][NFC] Rename GFX10A16 operands.
They do not seem to be GFX10-specific anymore. Also renames the corresponding feature. Reviewed By: dp Differential Revision: https://reviews.llvm.org/D141069
1 parent fdc3dd7 commit 2d945ef

10 files changed

+62
-68
lines changed

llvm/lib/Target/AMDGPU/AMDGPU.td

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -476,10 +476,10 @@ def FeatureR128A16 : SubtargetFeature<"r128-a16",
476476
"Support gfx9-style A16 for 16-bit coordinates/gradients/lod/clamp/mip image operands, where a16 is aliased with r128"
477477
>;
478478

479-
def FeatureGFX10A16 : SubtargetFeature<"a16",
480-
"HasGFX10A16",
479+
def FeatureA16 : SubtargetFeature<"a16",
480+
"HasA16",
481481
"true",
482-
"Support gfx10-style A16 for 16-bit coordinates/gradients/lod/clamp/mip image operands"
482+
"Support A16 for 16-bit coordinates/gradients/lod/clamp/mip image operands"
483483
>;
484484

485485
def FeatureG16 : SubtargetFeature<"g16",
@@ -907,7 +907,7 @@ def FeatureGFX9 : GCNSubtargetFeatureGeneration<"GFX9",
907907
FeatureFlatInstOffsets, FeatureFlatGlobalInsts, FeatureFlatScratchInsts,
908908
FeatureAddNoCarryInsts, FeatureGFX8Insts, FeatureGFX7GFX8GFX9Insts,
909909
FeatureScalarFlatScratchInsts, FeatureScalarAtomics, FeatureR128A16,
910-
FeatureSMemTimeInst, FeatureFastDenormalF32, FeatureSupportsXNACK,
910+
FeatureA16, FeatureSMemTimeInst, FeatureFastDenormalF32, FeatureSupportsXNACK,
911911
FeatureUnalignedBufferAccess, FeatureUnalignedDSAccess,
912912
FeatureNegativeScratchOffsetBug
913913
]
@@ -927,7 +927,7 @@ def FeatureGFX10 : GCNSubtargetFeatureGeneration<"GFX10",
927927
FeatureNoSdstCMPX, FeatureVscnt,
928928
FeatureVOP3Literal, FeatureDPP8, FeatureExtendedImageInsts,
929929
FeatureNoDataDepHazard, FeaturePkFmacF16Inst,
930-
FeatureGFX10A16, FeatureSMemTimeInst, FeatureFastDenormalF32, FeatureG16,
930+
FeatureA16, FeatureSMemTimeInst, FeatureFastDenormalF32, FeatureG16,
931931
FeatureUnalignedBufferAccess, FeatureUnalignedDSAccess, FeatureImageInsts
932932
]
933933
>;
@@ -946,7 +946,7 @@ def FeatureGFX11 : GCNSubtargetFeatureGeneration<"GFX11",
946946
FeatureNoSdstCMPX, FeatureVscnt,
947947
FeatureVOP3Literal, FeatureDPP8, FeatureExtendedImageInsts,
948948
FeatureNoDataDepHazard, FeaturePkFmacF16Inst,
949-
FeatureGFX10A16, FeatureFastDenormalF32, FeatureG16,
949+
FeatureA16, FeatureFastDenormalF32, FeatureG16,
950950
FeatureUnalignedBufferAccess, FeatureUnalignedDSAccess
951951
]
952952
>;
@@ -1683,8 +1683,8 @@ def HasExtendedImageInsts : Predicate<"Subtarget->hasExtendedImageInsts()">,
16831683
def HasR128A16 : Predicate<"Subtarget->hasR128A16()">,
16841684
AssemblerPredicate<(all_of FeatureR128A16)>;
16851685

1686-
def HasGFX10A16 : Predicate<"Subtarget->hasGFX10A16()">,
1687-
AssemblerPredicate<(all_of FeatureGFX10A16)>;
1686+
def HasA16 : Predicate<"Subtarget->hasA16()">,
1687+
AssemblerPredicate<(all_of FeatureA16)>;
16881688

16891689
def HasG16 : Predicate<"Subtarget->hasG16()">,
16901690
AssemblerPredicate<(all_of FeatureG16)>;

llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ class AMDGPUOperand : public MCParsedAsmOperand {
358358
bool isUNorm() const { return isImmTy(ImmTyUNorm); }
359359
bool isDA() const { return isImmTy(ImmTyDA); }
360360
bool isR128A16() const { return isImmTy(ImmTyR128A16); }
361-
bool isGFX10A16() const { return isImmTy(ImmTyA16); }
361+
bool isA16() const { return isImmTy(ImmTyA16); }
362362
bool isLWE() const { return isImmTy(ImmTyLWE); }
363363
bool isOff() const { return isImmTy(ImmTyOff); }
364364
bool isExpTgt() const { return isImmTy(ImmTyExpTgt); }
@@ -1406,9 +1406,7 @@ class AMDGPUAsmParser : public MCTargetAsmParser {
14061406
return AMDGPU::hasPackedD16(getSTI());
14071407
}
14081408

1409-
bool hasGFX10A16() const {
1410-
return AMDGPU::hasGFX10A16(getSTI());
1411-
}
1409+
bool hasA16() const { return AMDGPU::hasA16(getSTI()); }
14121410

14131411
bool hasG16() const { return AMDGPU::hasG16(getSTI()); }
14141412

@@ -5999,7 +5997,7 @@ AMDGPUAsmParser::parseNamedBit(StringRef Name, OperandVector &Operands,
59995997
Error(S, "r128 modifier is not supported on this GPU");
60005998
return MatchOperand_ParseFail;
60015999
}
6002-
if (Name == "a16" && !isGFX9() && !hasGFX10A16()) {
6000+
if (Name == "a16" && !hasA16()) {
60036001
Error(S, "a16 modifier is not supported on this GPU");
60046002
return MatchOperand_ParseFail;
60056003
}
@@ -9125,7 +9123,7 @@ AMDGPUAsmParser::parseCustomOperand(OperandVector &Operands, unsigned MCK) {
91259123
case MCK_gds:
91269124
case MCK_ImmGDS:
91279125
return parseNamedBit("gds", Operands, AMDGPUOperand::ImmTyGDS);
9128-
case MCK_ImmGFX10A16:
9126+
case MCK_ImmA16:
91299127
return parseNamedBit("a16", Operands, AMDGPUOperand::ImmTyA16);
91309128
case MCK_ImmHigh:
91319129
return parseNamedBit("high", Operands, AMDGPUOperand::ImmTyHigh);

llvm/lib/Target/AMDGPU/GCNSubtarget.h

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ class GCNSubtarget final : public AMDGPUGenSubtargetInfo,
129129
bool HasImageInsts = false;
130130
bool HasExtendedImageInsts = false;
131131
bool HasR128A16 = false;
132-
bool HasGFX10A16 = false;
132+
bool HasA16 = false;
133133
bool HasG16 = false;
134134
bool HasNSAEncoding = false;
135135
unsigned NSAMaxSize = 0;
@@ -900,11 +900,7 @@ class GCNSubtarget final : public AMDGPUGenSubtargetInfo,
900900
return HasR128A16;
901901
}
902902

903-
bool hasGFX10A16() const {
904-
return HasGFX10A16;
905-
}
906-
907-
bool hasA16() const { return hasR128A16() || hasGFX10A16(); }
903+
bool hasA16() const { return HasA16; }
908904

909905
bool hasG16() const { return HasG16; }
910906

llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUInstPrinter.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,8 +265,8 @@ void AMDGPUInstPrinter::printR128A16(const MCInst *MI, unsigned OpNo,
265265
printNamedBit(MI, OpNo, O, "r128");
266266
}
267267

268-
void AMDGPUInstPrinter::printGFX10A16(const MCInst *MI, unsigned OpNo,
269-
const MCSubtargetInfo &STI, raw_ostream &O) {
268+
void AMDGPUInstPrinter::printA16(const MCInst *MI, unsigned OpNo,
269+
const MCSubtargetInfo &STI, raw_ostream &O) {
270270
printNamedBit(MI, OpNo, O, "a16");
271271
}
272272

llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUInstPrinter.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ class AMDGPUInstPrinter : public MCInstPrinter {
8686
raw_ostream &O);
8787
void printR128A16(const MCInst *MI, unsigned OpNo, const MCSubtargetInfo &STI,
8888
raw_ostream &O);
89-
void printGFX10A16(const MCInst *MI, unsigned OpNo, const MCSubtargetInfo &STI,
89+
void printA16(const MCInst *MI, unsigned OpNo, const MCSubtargetInfo &STI,
9090
raw_ostream &O);
9191
void printLWE(const MCInst *MI, unsigned OpNo,
9292
const MCSubtargetInfo &STI, raw_ostream &O);

0 commit comments

Comments
 (0)