Skip to content

Commit d1c9b61

Browse files
committed
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
1 parent 4a8d151 commit d1c9b61

File tree

4 files changed

+20
-15
lines changed

4 files changed

+20
-15
lines changed

llvm/lib/Target/AMDGPU/AMDGPUSubtarget.cpp

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -48,29 +48,34 @@ AMDGPUSubtarget::initializeSubtargetDependencies(const Triple &TT,
4848
// for SI has the unhelpful behavior that it unsets everything else if you
4949
// disable it.
5050

51-
SmallString<256> FullFS("+promote-alloca,+fp64-fp16-denormals,+dx10-clamp,+load-store-opt,");
51+
SmallString<256> FullFS("+promote-alloca,+dx10-clamp,+load-store-opt,");
52+
5253
if (isAmdHsaOS()) // Turn on FlatForGlobal for HSA.
5354
FullFS += "+flat-address-space,+flat-for-global,+unaligned-buffer-access,+trap-handler,";
5455

56+
// FIXME: I don't think think Evergreen has any useful support for
57+
// denormals, but should be checked. Should we issue a warning somewhere
58+
// if someone tries to enable these?
59+
if (getGeneration() >= AMDGPUSubtarget::SOUTHERN_ISLANDS) {
60+
FullFS += "+fp64-fp16-denormals,";
61+
} else {
62+
FullFS += "-fp32-denormals,";
63+
}
64+
5565
FullFS += FS;
5666

5767
ParseSubtargetFeatures(GPU, FullFS);
5868

69+
// We don't support FP64 for EG/NI atm.
70+
assert(!hasFP64() || (getGeneration() >= AMDGPUSubtarget::SOUTHERN_ISLANDS));
71+
5972
// Unless +-flat-for-global is specified, turn on FlatForGlobal for all OS-es
6073
// on VI and newer hardware to avoid assertion failures due to missing ADDR64
6174
// variants of MUBUF instructions.
6275
if (!hasAddr64() && !FS.contains("flat-for-global")) {
6376
FlatForGlobal = true;
6477
}
6578

66-
// FIXME: I don't think think Evergreen has any useful support for
67-
// denormals, but should be checked. Should we issue a warning somewhere
68-
// if someone tries to enable these?
69-
if (getGeneration() <= AMDGPUSubtarget::NORTHERN_ISLANDS) {
70-
FP64FP16Denormals = false;
71-
FP32Denormals = false;
72-
}
73-
7479
// Set defaults if needed.
7580
if (MaxPrivateElementSize == 0)
7681
MaxPrivateElementSize = 4;

llvm/lib/Target/AMDGPU/AMDGPUSubtarget.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ class AMDGPUSubtarget : public AMDGPUGenSubtargetInfo {
261261
return HasVOP3PInsts;
262262
}
263263

264-
bool hasHWFP64() const {
264+
bool hasFP64() const {
265265
return FP64;
266266
}
267267

llvm/lib/Target/AMDGPU/R600Processors.td

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def : Processor<"rs880", R600_VLIW5_Itin,
2424
>;
2525

2626
def : Processor<"rv670", R600_VLIW5_Itin,
27-
[FeatureR600, FeatureWavefrontSize64, FeatureVertexCache, FeatureFP64]
27+
[FeatureR600, FeatureWavefrontSize64, FeatureVertexCache]
2828
>;
2929

3030
//===----------------------------------------------------------------------===//
@@ -40,7 +40,7 @@ def : Processor<"rv730", R600_VLIW5_Itin,
4040
>;
4141

4242
def : Processor<"rv770", R600_VLIW5_Itin,
43-
[FeatureR700, FeatureWavefrontSize64, FeatureVertexCache, FeatureFP64]
43+
[FeatureR700, FeatureWavefrontSize64, FeatureVertexCache]
4444
>;
4545

4646
//===----------------------------------------------------------------------===//
@@ -53,7 +53,7 @@ def : Processor<"cedar", R600_VLIW5_Itin,
5353
>;
5454

5555
def : Processor<"cypress", R600_VLIW5_Itin,
56-
[FeatureEvergreen, FeatureWavefrontSize64, FeatureVertexCache, FeatureFP64]
56+
[FeatureEvergreen, FeatureWavefrontSize64, FeatureVertexCache]
5757
>;
5858

5959
def : Processor<"juniper", R600_VLIW5_Itin,
@@ -82,7 +82,7 @@ def : Processor<"caicos", R600_VLIW5_Itin,
8282
>;
8383

8484
def : Processor<"cayman", R600_VLIW4_Itin,
85-
[FeatureNorthernIslands, FeatureFP64, FeatureCaymanISA]
85+
[FeatureNorthernIslands, FeatureCaymanISA]
8686
>;
8787

8888
def : Processor<"turks", R600_VLIW5_Itin,

llvm/test/CodeGen/AMDGPU/fma.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
; RUN: llc -amdgpu-scalarize-global-loads=false -march=amdgcn -mcpu=tahiti -verify-machineinstrs < %s | FileCheck -check-prefix=SI -check-prefix=FUNC %s
2-
; RUN: llc -amdgpu-scalarize-global-loads=false -march=r600 -mcpu=cypress -verify-machineinstrs < %s | FileCheck -check-prefix=EG -check-prefix=FUNC %s
2+
; XUN: llc -amdgpu-scalarize-global-loads=false -march=r600 -mcpu=cypress -verify-machineinstrs < %s | FileCheck -check-prefix=EG -check-prefix=FUNC %s
33

44
declare float @llvm.fma.f32(float, float, float) nounwind readnone
55
declare <2 x float> @llvm.fma.v2f32(<2 x float>, <2 x float>, <2 x float>) nounwind readnone

0 commit comments

Comments
 (0)