summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorJan Vesely <jan.vesely@rutgers.edu>2017-12-04 22:57:29 +0000
committerJan Vesely <jan.vesely@rutgers.edu>2017-12-04 22:57:29 +0000
commitd1c9b61e2be5f00cf84bbf4a5c9fed5c21cce2f2 (patch)
tree3907a458ee100aa09051c3bb049bcf059f2db548 /llvm/lib
parent4a8d15198644a5e01498c77e9c48d9b3c4e44009 (diff)
downloadbcm5719-llvm-d1c9b61e2be5f00cf84bbf4a5c9fed5c21cce2f2.tar.gz
bcm5719-llvm-d1c9b61e2be5f00cf84bbf4a5c9fed5c21cce2f2.zip
AMDGPU: Disable fp64 support on pre GCN asics
It's not implemented. Passing +fp64-fp16-denormal feature enables fp64 even on asics that don't support it v2: fix hasFP64 query Differential Revision: https://reviews.llvm.org/D39931 llvm-svn: 319709
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/AMDGPU/AMDGPUSubtarget.cpp23
-rw-r--r--llvm/lib/Target/AMDGPU/AMDGPUSubtarget.h2
-rw-r--r--llvm/lib/Target/AMDGPU/R600Processors.td8
3 files changed, 19 insertions, 14 deletions
diff --git a/llvm/lib/Target/AMDGPU/AMDGPUSubtarget.cpp b/llvm/lib/Target/AMDGPU/AMDGPUSubtarget.cpp
index 8e5a432e068..22d72462837 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUSubtarget.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPUSubtarget.cpp
@@ -48,14 +48,27 @@ AMDGPUSubtarget::initializeSubtargetDependencies(const Triple &TT,
// for SI has the unhelpful behavior that it unsets everything else if you
// disable it.
- SmallString<256> FullFS("+promote-alloca,+fp64-fp16-denormals,+dx10-clamp,+load-store-opt,");
+ SmallString<256> FullFS("+promote-alloca,+dx10-clamp,+load-store-opt,");
+
if (isAmdHsaOS()) // Turn on FlatForGlobal for HSA.
FullFS += "+flat-address-space,+flat-for-global,+unaligned-buffer-access,+trap-handler,";
+ // FIXME: I don't think think Evergreen has any useful support for
+ // denormals, but should be checked. Should we issue a warning somewhere
+ // if someone tries to enable these?
+ if (getGeneration() >= AMDGPUSubtarget::SOUTHERN_ISLANDS) {
+ FullFS += "+fp64-fp16-denormals,";
+ } else {
+ FullFS += "-fp32-denormals,";
+ }
+
FullFS += FS;
ParseSubtargetFeatures(GPU, FullFS);
+ // We don't support FP64 for EG/NI atm.
+ assert(!hasFP64() || (getGeneration() >= AMDGPUSubtarget::SOUTHERN_ISLANDS));
+
// Unless +-flat-for-global is specified, turn on FlatForGlobal for all OS-es
// on VI and newer hardware to avoid assertion failures due to missing ADDR64
// variants of MUBUF instructions.
@@ -63,14 +76,6 @@ AMDGPUSubtarget::initializeSubtargetDependencies(const Triple &TT,
FlatForGlobal = true;
}
- // FIXME: I don't think think Evergreen has any useful support for
- // denormals, but should be checked. Should we issue a warning somewhere
- // if someone tries to enable these?
- if (getGeneration() <= AMDGPUSubtarget::NORTHERN_ISLANDS) {
- FP64FP16Denormals = false;
- FP32Denormals = false;
- }
-
// Set defaults if needed.
if (MaxPrivateElementSize == 0)
MaxPrivateElementSize = 4;
diff --git a/llvm/lib/Target/AMDGPU/AMDGPUSubtarget.h b/llvm/lib/Target/AMDGPU/AMDGPUSubtarget.h
index c1518dd3d4c..99d0e191dd7 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUSubtarget.h
+++ b/llvm/lib/Target/AMDGPU/AMDGPUSubtarget.h
@@ -261,7 +261,7 @@ public:
return HasVOP3PInsts;
}
- bool hasHWFP64() const {
+ bool hasFP64() const {
return FP64;
}
diff --git a/llvm/lib/Target/AMDGPU/R600Processors.td b/llvm/lib/Target/AMDGPU/R600Processors.td
index 8ef1fe191c3..aaca7a1b183 100644
--- a/llvm/lib/Target/AMDGPU/R600Processors.td
+++ b/llvm/lib/Target/AMDGPU/R600Processors.td
@@ -24,7 +24,7 @@ def : Processor<"rs880", R600_VLIW5_Itin,
>;
def : Processor<"rv670", R600_VLIW5_Itin,
- [FeatureR600, FeatureWavefrontSize64, FeatureVertexCache, FeatureFP64]
+ [FeatureR600, FeatureWavefrontSize64, FeatureVertexCache]
>;
//===----------------------------------------------------------------------===//
@@ -40,7 +40,7 @@ def : Processor<"rv730", R600_VLIW5_Itin,
>;
def : Processor<"rv770", R600_VLIW5_Itin,
- [FeatureR700, FeatureWavefrontSize64, FeatureVertexCache, FeatureFP64]
+ [FeatureR700, FeatureWavefrontSize64, FeatureVertexCache]
>;
//===----------------------------------------------------------------------===//
@@ -53,7 +53,7 @@ def : Processor<"cedar", R600_VLIW5_Itin,
>;
def : Processor<"cypress", R600_VLIW5_Itin,
- [FeatureEvergreen, FeatureWavefrontSize64, FeatureVertexCache, FeatureFP64]
+ [FeatureEvergreen, FeatureWavefrontSize64, FeatureVertexCache]
>;
def : Processor<"juniper", R600_VLIW5_Itin,
@@ -82,7 +82,7 @@ def : Processor<"caicos", R600_VLIW5_Itin,
>;
def : Processor<"cayman", R600_VLIW4_Itin,
- [FeatureNorthernIslands, FeatureFP64, FeatureCaymanISA]
+ [FeatureNorthernIslands, FeatureCaymanISA]
>;
def : Processor<"turks", R600_VLIW5_Itin,
OpenPOWER on IntegriCloud