r236325 - R600: Report fp64 on all capable asics
Jan Vesely
jan.vesely at rutgers.edu
Fri May 1 10:38:13 PDT 2015
Author: jvesely
Date: Fri May 1 12:38:13 2015
New Revision: 236325
URL: http://llvm.org/viewvc/llvm-project?rev=236325&view=rev
Log:
R600: Report fp64 on all capable asics
Signed-off-by: Jan Vesely <jan.vesely at rutgers.edu>
Reviewed-by: Tom Stellard <thomas.stellard at amd.com>
Modified:
cfe/trunk/lib/Basic/Targets.cpp
Modified: cfe/trunk/lib/Basic/Targets.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Targets.cpp?rev=236325&r1=236324&r2=236325&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/Targets.cpp (original)
+++ cfe/trunk/lib/Basic/Targets.cpp Fri May 1 12:38:13 2015
@@ -1695,6 +1695,8 @@ class R600TargetInfo : public TargetInfo
GK_SEA_ISLANDS
} GPU;
+ bool hasFP64;
+
public:
R600TargetInfo(const llvm::Triple &Triple)
: TargetInfo(Triple) {
@@ -1702,9 +1704,11 @@ public:
if (Triple.getArch() == llvm::Triple::amdgcn) {
DescriptionString = DescriptionStringSI;
GPU = GK_SOUTHERN_ISLANDS;
+ hasFP64 = true;
} else {
DescriptionString = DescriptionStringR600;
GPU = GK_R600;
+ hasFP64 = false;
}
AddrSpaceMap = &R600AddrSpaceMap;
UseAddrSpaceMapMangling = true;
@@ -1751,8 +1755,9 @@ public:
void getTargetDefines(const LangOptions &Opts,
MacroBuilder &Builder) const override {
Builder.defineMacro("__R600__");
- if (GPU >= GK_SOUTHERN_ISLANDS && Opts.OpenCL)
+ if (hasFP64 && Opts.OpenCL) {
Builder.defineMacro("cl_khr_fp64");
+ }
}
BuiltinVaListKind getBuiltinVaListKind() const override {
@@ -1810,16 +1815,19 @@ public:
case GK_EVERGREEN:
case GK_NORTHERN_ISLANDS:
DescriptionString = DescriptionStringR600;
+ hasFP64 = false;
break;
case GK_R600_DOUBLE_OPS:
case GK_R700_DOUBLE_OPS:
case GK_EVERGREEN_DOUBLE_OPS:
case GK_CAYMAN:
DescriptionString = DescriptionStringR600DoubleOps;
+ hasFP64 = true;
break;
case GK_SOUTHERN_ISLANDS:
case GK_SEA_ISLANDS:
DescriptionString = DescriptionStringSI;
+ hasFP64 = true;
break;
}
More information about the cfe-commits
mailing list