[llvm-branch-commits] [cfe-branch] r319032 - Merging r316181:
Tom Stellard via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Mon Nov 27 06:54:45 PST 2017
Author: tstellar
Date: Mon Nov 27 06:54:45 2017
New Revision: 319032
URL: http://llvm.org/viewvc/llvm-project?rev=319032&view=rev
Log:
Merging r316181:
------------------------------------------------------------------------
r316181 | jvesely | 2017-10-19 13:40:13 -0700 (Thu, 19 Oct 2017) | 4 lines
AMDGPU: Parse r600 CPU name early and expose FMAF capability
Improve amdgcn macro test
Differential Revision: https://reviews.llvm.org/D38667
------------------------------------------------------------------------
Modified:
cfe/branches/release_50/lib/Basic/Targets.cpp
cfe/branches/release_50/test/Preprocessor/predefined-arch-macros.c
Modified: cfe/branches/release_50/lib/Basic/Targets.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_50/lib/Basic/Targets.cpp?rev=319032&r1=319031&r2=319032&view=diff
==============================================================================
--- cfe/branches/release_50/lib/Basic/Targets.cpp (original)
+++ cfe/branches/release_50/lib/Basic/Targets.cpp Mon Nov 27 06:54:45 2017
@@ -2169,7 +2169,7 @@ class AMDGPUTargetInfo final : public Ta
public:
AMDGPUTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
: TargetInfo(Triple) ,
- GPU(isAMDGCN(Triple) ? GK_GFX6 : GK_R600),
+ GPU(isAMDGCN(Triple) ? GK_GFX6 : parseR600Name(Opts.CPU)),
hasFP64(false),
hasFMAF(false),
hasLDEXPF(false),
@@ -2179,6 +2179,12 @@ public:
hasFMAF = true;
hasLDEXPF = true;
}
+ if (getTriple().getArch() == llvm::Triple::r600) {
+ if (GPU == GK_EVERGREEN_DOUBLE_OPS || GPU == GK_CAYMAN) {
+ hasFMAF = true;
+ }
+ }
+
auto IsGenericZero = isGenericZero(Triple);
resetDataLayout(getTriple().getArch() == llvm::Triple::amdgcn ?
(IsGenericZero ? DataLayoutStringSIGenericIsZero :
Modified: cfe/branches/release_50/test/Preprocessor/predefined-arch-macros.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_50/test/Preprocessor/predefined-arch-macros.c?rev=319032&r1=319031&r2=319032&view=diff
==============================================================================
--- cfe/branches/release_50/test/Preprocessor/predefined-arch-macros.c (original)
+++ cfe/branches/release_50/test/Preprocessor/predefined-arch-macros.c Mon Nov 27 06:54:45 2017
@@ -2283,6 +2283,9 @@
// RUN: -target amdgcn-unknown-unknown \
// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_AMDGCN
// CHECK_AMDGCN: #define __AMDGCN__ 1
+// CHECK_AMDGCN: #define __HAS_FMAF__ 1
+// CHECK_AMDGCN: #define __HAS_FP64__ 1
+// CHECK_AMDGCN: #define __HAS_LDEXPF__ 1
// Begin r600 tests ----------------
//
@@ -2290,3 +2293,10 @@
// RUN: -target r600-unknown-unknown \
// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_R600
// CHECK_R600: #define __R600__ 1
+// CHECK_R600-NOT: #define __HAS_FMAF__ 1
+
+// RUN: %clang -march=amdgcn -mcpu=cypress -E -dM %s -o - 2>&1 \
+// RUN: -target r600-unknown-unknown \
+// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_R600_FP64
+// CHECK_R600_FP64-DAG: #define __R600__ 1
+// CHECK_R600_FP64-DAG: #define __HAS_FMAF__ 1
More information about the llvm-branch-commits
mailing list