Skip to content
This repository was archived by the owner on Mar 28, 2020. It is now read-only.

Commit 0fad9cb

Browse files
committed
AMDGPU: Add new subtarget features for gfx9 flat instructions
Flat instructions gain an immediate offset, and 2 new sets of segment specific flat instructions are added. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302729 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent b97a02c commit 0fad9cb

File tree

3 files changed

+38
-1
lines changed

3 files changed

+38
-1
lines changed

lib/Target/AMDGPU/AMDGPU.td

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,24 @@ def FeatureFlatAddressSpace : SubtargetFeature<"flat-address-space",
6161
"Support flat address space"
6262
>;
6363

64+
def FeatureFlatInstOffsets : SubtargetFeature<"flat-inst-offsets",
65+
"FlatInstOffsets",
66+
"true",
67+
"Flat instructions have immediate offset addressing mode"
68+
>;
69+
70+
def FeatureFlatGlobalInsts : SubtargetFeature<"flat-global-insts",
71+
"FlatGlobalInsts",
72+
"true",
73+
"Have global_* flat memory instructions"
74+
>;
75+
76+
def FeatureFlatScratchInsts : SubtargetFeature<"flat-scratch-insts",
77+
"FlatScratchInsts",
78+
"true",
79+
"Have scratch_* flat memory instructions"
80+
>;
81+
6482
def FeatureUnalignedBufferAccess : SubtargetFeature<"unaligned-buffer-access",
6583
"UnalignedBufferAccess",
6684
"true",
@@ -407,7 +425,8 @@ def FeatureGFX9 : SubtargetFeatureGeneration<"GFX9",
407425
FeatureGCN3Encoding, FeatureCIInsts, Feature16BitInsts,
408426
FeatureSMemRealTime, FeatureScalarStores, FeatureInv2PiInlineImm,
409427
FeatureApertureRegs, FeatureGFX9Insts, FeatureVOP3P, FeatureVGPRIndexMode,
410-
FeatureFastFMAF32, FeatureDPP
428+
FeatureFastFMAF32, FeatureDPP,
429+
FeatureFlatInstOffsets, FeatureFlatGlobalInsts, FeatureFlatScratchInsts
411430
]
412431
>;
413432

lib/Target/AMDGPU/AMDGPUSubtarget.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,9 @@ AMDGPUSubtarget::AMDGPUSubtarget(const Triple &TT, StringRef GPU, StringRef FS,
125125
HasSDWA(false),
126126
HasDPP(false),
127127
FlatAddressSpace(false),
128+
FlatInstOffsets(false),
129+
FlatGlobalInsts(false),
130+
FlatScratchInsts(false),
128131

129132
R600ALUInst(false),
130133
CaymanISA(false),

lib/Target/AMDGPU/AMDGPUSubtarget.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,9 @@ class AMDGPUSubtarget : public AMDGPUGenSubtargetInfo {
145145
bool HasSDWA;
146146
bool HasDPP;
147147
bool FlatAddressSpace;
148+
bool FlatInstOffsets;
149+
bool FlatGlobalInsts;
150+
bool FlatScratchInsts;
148151
bool R600ALUInst;
149152
bool CaymanISA;
150153
bool CFALUBug;
@@ -380,6 +383,18 @@ class AMDGPUSubtarget : public AMDGPUGenSubtargetInfo {
380383
return FlatAddressSpace;
381384
}
382385

386+
bool hasFlatInstOffsets() const {
387+
return FlatInstOffsets;
388+
}
389+
390+
bool hasFlatGlobalInsts() const {
391+
return FlatGlobalInsts;
392+
}
393+
394+
bool hasFlatScratchInsts() const {
395+
return FlatScratchInsts;
396+
}
397+
383398
bool isMesaKernel(const MachineFunction &MF) const {
384399
return isMesa3DOS() && !AMDGPU::isShader(MF.getFunction()->getCallingConv());
385400
}

0 commit comments

Comments
 (0)