From 9d82ee7526db4bcc79ef74e767a54155301a972f Mon Sep 17 00:00:00 2001 From: Matt Arsenault Date: Sat, 27 Feb 2016 08:53:55 +0000 Subject: [PATCH] AMDGPU: Split vi-insts subtarget feature This will be more useful for marking builtins acceptable for which subtargets. llvm-svn: 262121 --- llvm/lib/Target/AMDGPU/AMDGPU.td | 16 ++++++++++++---- llvm/lib/Target/AMDGPU/AMDGPUSubtarget.cpp | 3 ++- llvm/lib/Target/AMDGPU/AMDGPUSubtarget.h | 11 ++++++++++- 3 files changed, 24 insertions(+), 6 deletions(-) diff --git a/llvm/lib/Target/AMDGPU/AMDGPU.td b/llvm/lib/Target/AMDGPU/AMDGPU.td index 145fadc..0975f97 100644 --- a/llvm/lib/Target/AMDGPU/AMDGPU.td +++ b/llvm/lib/Target/AMDGPU/AMDGPU.td @@ -149,10 +149,16 @@ def FeatureCIInsts : SubtargetFeature<"ci-insts", "Additional intstructions for CI+" >; -def FeatureVIInsts : SubtargetFeature<"vi-insts", - "VIInsts", +def FeatureSMemRealTime : SubtargetFeature<"s-memrealtime", + "HasSMemRealTime", "true", - "Additional intstructions for VI+" + "Has s_memrealtime instruction" +>; + +def Feature16BitInsts : SubtargetFeature<"16-bit-insts", + "Has16BitInsts", + "true", + "Has i16/f16 instructions" >; //===------------------------------------------------------------===// @@ -314,7 +320,9 @@ def FeatureSeaIslands : SubtargetFeatureGeneration<"SEA_ISLANDS", def FeatureVolcanicIslands : SubtargetFeatureGeneration<"VOLCANIC_ISLANDS", [FeatureFP64, FeatureLocalMemorySize65536, FeatureWavefrontSize64, FeatureFlatAddressSpace, FeatureGCN, - FeatureGCN3Encoding, FeatureCIInsts, FeatureVIInsts] + FeatureGCN3Encoding, FeatureCIInsts, Feature16BitInsts, + FeatureSMemRealTime + ] >; //===----------------------------------------------------------------------===// diff --git a/llvm/lib/Target/AMDGPU/AMDGPUSubtarget.cpp b/llvm/lib/Target/AMDGPU/AMDGPUSubtarget.cpp index 91d1aec..fed46fe 100644 --- a/llvm/lib/Target/AMDGPU/AMDGPUSubtarget.cpp +++ b/llvm/lib/Target/AMDGPU/AMDGPUSubtarget.cpp @@ -81,7 +81,8 @@ AMDGPUSubtarget::AMDGPUSubtarget(const Triple &TT, StringRef GPU, StringRef FS, WavefrontSize(0), CFALUBug(false), LocalMemorySize(0), MaxPrivateElementSize(0), EnableVGPRSpilling(false), SGPRInitBug(false), IsGCN(false), - GCN1Encoding(false), GCN3Encoding(false), CIInsts(false), VIInsts(false), + GCN1Encoding(false), GCN3Encoding(false), CIInsts(false), + HasSMemRealTime(false), Has16BitInsts(false), LDSBankCount(0), IsaVersion(ISAVersion0_0_0), EnableHugeScratchBuffer(false), EnableSIScheduler(false), FrameLowering(nullptr), diff --git a/llvm/lib/Target/AMDGPU/AMDGPUSubtarget.h b/llvm/lib/Target/AMDGPU/AMDGPUSubtarget.h index 787c04a..b9874f8 100644 --- a/llvm/lib/Target/AMDGPU/AMDGPUSubtarget.h +++ b/llvm/lib/Target/AMDGPU/AMDGPUSubtarget.h @@ -88,7 +88,8 @@ private: bool GCN1Encoding; bool GCN3Encoding; bool CIInsts; - bool VIInsts; + bool HasSMemRealTime; + bool Has16BitInsts; bool FeatureDisable; int LDSBankCount; unsigned IsaVersion; @@ -169,6 +170,14 @@ public: return FlatAddressSpace; } + bool hasSMemRealTime() const { + return HasSMemRealTime; + } + + bool has16BitInsts() const { + return Has16BitInsts; + } + bool useFlatForGlobal() const { return FlatForGlobal; } -- 2.7.4