diff options
Diffstat (limited to 'clang/lib/Basic/Targets/AMDGPU.h')
-rw-r--r-- | clang/lib/Basic/Targets/AMDGPU.h | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/clang/lib/Basic/Targets/AMDGPU.h b/clang/lib/Basic/Targets/AMDGPU.h index 4fc6ff25e26..26d4c7f6368 100644 --- a/clang/lib/Basic/Targets/AMDGPU.h +++ b/clang/lib/Basic/Targets/AMDGPU.h @@ -64,6 +64,58 @@ class LLVM_LIBRARY_VISIBILITY AMDGPUTargetInfo final : public TargetInfo { GK_GFX9 } GPU; + struct NameGPUKind { + llvm::StringLiteral Name; + AMDGPUTargetInfo::GPUKind Kind; + }; + + static constexpr NameGPUKind R600Names[] = { + {{"r600"}, GK_R600}, + {{"rv610"}, GK_R600}, + {{"rv620"}, GK_R600}, + {{"rv630"}, GK_R600}, + {{"rv635"}, GK_R600}, + {{"rs780"}, GK_R600}, + {{"rs880"}, GK_R600}, + {{"rv670"}, GK_R600_DOUBLE_OPS}, + {{"rv710"}, GK_R700}, + {{"rv730"}, GK_R700}, + {{"rv740"}, GK_R700_DOUBLE_OPS}, + {{"rv770"}, GK_R700_DOUBLE_OPS}, + {{"palm"}, GK_EVERGREEN}, + {{"cedar"}, GK_EVERGREEN}, + {{"sumo"}, GK_EVERGREEN}, + {{"sumo2"}, GK_EVERGREEN}, + {{"redwood"}, GK_EVERGREEN}, + {{"juniper"}, GK_EVERGREEN}, + {{"hemlock"}, GK_EVERGREEN_DOUBLE_OPS}, + {{"cypress"}, GK_EVERGREEN_DOUBLE_OPS}, + {{"barts"}, GK_NORTHERN_ISLANDS}, + {{"turks"}, GK_NORTHERN_ISLANDS}, + {{"caicos"}, GK_NORTHERN_ISLANDS}, + {{"cayman"}, GK_CAYMAN}, + {{"aruba"}, GK_CAYMAN}, + }; + static constexpr NameGPUKind AMDGCNNames[] = { + {{"gfx600"}, GK_GFX6}, {{"tahiti"}, GK_GFX6}, + {{"gfx601"}, GK_GFX6}, {{"pitcairn"}, GK_GFX6}, + {{"verde"}, GK_GFX6}, {{"oland"}, GK_GFX6}, + {{"hainan"}, GK_GFX6}, {{"gfx700"}, GK_GFX7}, + {{"bonaire"}, GK_GFX7}, {{"kaveri"}, GK_GFX7}, + {{"gfx701"}, GK_GFX7}, {{"hawaii"}, GK_GFX7}, + {{"gfx702"}, GK_GFX7}, {{"gfx703"}, GK_GFX7}, + {{"kabini"}, GK_GFX7}, {{"mullins"}, GK_GFX7}, + {{"gfx800"}, GK_GFX8}, {{"iceland"}, GK_GFX8}, + {{"gfx801"}, GK_GFX8}, {{"carrizo"}, GK_GFX8}, + {{"gfx802"}, GK_GFX8}, {{"tonga"}, GK_GFX8}, + {{"gfx803"}, GK_GFX8}, {{"fiji"}, GK_GFX8}, + {{"polaris10"}, GK_GFX8}, {{"polaris11"}, GK_GFX8}, + {{"gfx804"}, GK_GFX8}, {{"gfx810"}, GK_GFX8}, + {{"stoney"}, GK_GFX8}, {{"gfx900"}, GK_GFX9}, + {{"gfx901"}, GK_GFX9}, {{"gfx902"}, GK_GFX9}, + {{"gfx903"}, GK_GFX9}, + }; + bool hasFP64 : 1; bool hasFMAF : 1; bool hasLDEXPF : 1; @@ -219,6 +271,8 @@ public: return GK_NONE != parseR600Name(Name); } + void fillValidCPUList(SmallVectorImpl<StringRef> &Values) const override; + bool setCPU(const std::string &Name) override { if (getTriple().getArch() == llvm::Triple::amdgcn) GPU = parseAMDGCNName(Name); |