Skip to content

Commit 9be7b0d

Browse files
committed
AMDGPU: Add VOP3P instruction format
Add a few non-VOP3P but instructions related to packed. Includes hack with dummy operands for the benefit of the assembler llvm-svn: 296368
1 parent 10c7fb4 commit 9be7b0d

27 files changed

+1342
-86
lines changed

llvm/lib/Target/AMDGPU/AMDGPU.td

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,12 @@ def Feature16BitInsts : SubtargetFeature<"16-bit-insts",
190190
"Has i16/f16 instructions"
191191
>;
192192

193+
def FeatureVOP3P : SubtargetFeature<"vop3p",
194+
"HasVOP3PInsts",
195+
"true",
196+
"Has VOP3P packed instructions"
197+
>;
198+
193199
def FeatureMovrel : SubtargetFeature<"movrel",
194200
"HasMovrel",
195201
"true",
@@ -400,7 +406,7 @@ def FeatureGFX9 : SubtargetFeatureGeneration<"GFX9",
400406
FeatureWavefrontSize64, FeatureFlatAddressSpace, FeatureGCN,
401407
FeatureGCN3Encoding, FeatureCIInsts, Feature16BitInsts,
402408
FeatureSMemRealTime, FeatureScalarStores, FeatureInv2PiInlineImm,
403-
FeatureApertureRegs, FeatureGFX9Insts
409+
FeatureApertureRegs, FeatureGFX9Insts, FeatureVOP3P
404410
]
405411
>;
406412

@@ -575,7 +581,10 @@ def isCIVI : Predicate <
575581

576582
def HasFlatAddressSpace : Predicate<"Subtarget->hasFlatAddressSpace()">;
577583

578-
def Has16BitInsts : Predicate<"Subtarget->has16BitInsts()">;
584+
def Has16BitInsts : Predicate<"Subtarget->has16BitInsts()">,
585+
AssemblerPredicate<"Feature16BitInsts">;
586+
def HasVOP3PInsts : Predicate<"Subtarget->hasVOP3PInsts()">,
587+
AssemblerPredicate<"FeatureVOP3P">;
579588

580589
def HasSDWA : Predicate<"Subtarget->hasSDWA()">,
581590
AssemblerPredicate<"FeatureSDWA">;

llvm/lib/Target/AMDGPU/AMDGPUSubtarget.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ AMDGPUSubtarget::AMDGPUSubtarget(const Triple &TT, StringRef GPU, StringRef FS,
117117
SGPRInitBug(false),
118118
HasSMemRealTime(false),
119119
Has16BitInsts(false),
120+
HasVOP3PInsts(false),
120121
HasMovrel(false),
121122
HasVGPRIndexMode(false),
122123
HasScalarStores(false),

llvm/lib/Target/AMDGPU/AMDGPUSubtarget.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ class AMDGPUSubtarget : public AMDGPUGenSubtargetInfo {
136136
bool SGPRInitBug;
137137
bool HasSMemRealTime;
138138
bool Has16BitInsts;
139+
bool HasVOP3PInsts;
139140
bool HasMovrel;
140141
bool HasVGPRIndexMode;
141142
bool HasScalarStores;
@@ -216,6 +217,10 @@ class AMDGPUSubtarget : public AMDGPUGenSubtargetInfo {
216217
return Has16BitInsts;
217218
}
218219

220+
bool hasVOP3PInsts() const {
221+
return HasVOP3PInsts;
222+
}
223+
219224
bool hasHWFP64() const {
220225
return FP64;
221226
}

0 commit comments

Comments
 (0)