forked from OSchip/llvm-project
[AMDGPU] gfx1010 clang target
Differential Revision: https://reviews.llvm.org/D61875 llvm-svn: 360634
This commit is contained in:
parent
42d65c572b
commit
91792f1b93
|
@ -2396,6 +2396,11 @@ Generate code which only uses the general purpose registers (AArch64 only)
|
|||
|
||||
AMDGPU
|
||||
------
|
||||
.. option:: -mcumode, -mno-cumode
|
||||
|
||||
CU wavefront execution mode is used if enabled and WGP wavefront execution mode
|
||||
is used if disabled (AMDGPU only)
|
||||
|
||||
.. option:: -mxnack, -mno-xnack
|
||||
|
||||
Enable XNACK (AMDGPU only)
|
||||
|
|
|
@ -2202,6 +2202,11 @@ def msram_ecc : Flag<["-"], "msram-ecc">, Group<m_amdgpu_Features_Group>,
|
|||
def mno_sram_ecc : Flag<["-"], "mno-sram-ecc">, Group<m_amdgpu_Features_Group>,
|
||||
HelpText<"Disable SRAM ECC (AMDGPU only)">;
|
||||
|
||||
def mcumode : Flag<["-"], "mcumode">, Group<m_amdgpu_Features_Group>,
|
||||
HelpText<"CU wavefront execution mode is used (AMDGPU only)">;
|
||||
def mno_cumode : Flag<["-"], "mno-cumode">, Group<m_amdgpu_Features_Group>,
|
||||
HelpText<"WGP wavefront execution mode is used (AMDGPU only)">;
|
||||
|
||||
def faltivec : Flag<["-"], "faltivec">, Group<f_Group>, Flags<[DriverOption]>;
|
||||
def fno_altivec : Flag<["-"], "fno-altivec">, Group<f_Group>, Flags<[DriverOption]>;
|
||||
def maltivec : Flag<["-"], "maltivec">, Group<m_ppc_Features_Group>;
|
||||
|
|
|
@ -135,6 +135,14 @@ bool AMDGPUTargetInfo::initFeatureMap(
|
|||
CPU = "gfx600";
|
||||
|
||||
switch (llvm::AMDGPU::parseArchAMDGCN(CPU)) {
|
||||
case GK_GFX1010:
|
||||
Features["dl-insts"] = true;
|
||||
Features["16-bit-insts"] = true;
|
||||
Features["dpp"] = true;
|
||||
Features["gfx9-insts"] = true;
|
||||
Features["gfx10-insts"] = true;
|
||||
Features["s-memrealtime"] = true;
|
||||
break;
|
||||
case GK_GFX906:
|
||||
Features["dl-insts"] = true;
|
||||
Features["dot1-insts"] = true;
|
||||
|
|
|
@ -41,7 +41,6 @@ class LLVM_LIBRARY_VISIBILITY AMDGPUTargetInfo final : public TargetInfo {
|
|||
llvm::AMDGPU::GPUKind GPUKind;
|
||||
unsigned GPUFeatures;
|
||||
|
||||
|
||||
bool hasFP64() const {
|
||||
return getTriple().getArch() == llvm::Triple::amdgcn ||
|
||||
!!(GPUFeatures & llvm::AMDGPU::FEATURE_FP64);
|
||||
|
|
|
@ -307,8 +307,8 @@ void HIPToolChain::addClangTargetOptions(
|
|||
if (BCLibs.empty()) {
|
||||
// Get the bc lib file name for ISA version. For example,
|
||||
// gfx803 => oclc_isa_version_803.amdgcn.bc.
|
||||
std::string ISAVerBC =
|
||||
"oclc_isa_version_" + GpuArch.drop_front(3).str() + ".amdgcn.bc";
|
||||
std::string GFXVersion = GpuArch.drop_front(3).str();
|
||||
std::string ISAVerBC = "oclc_isa_version_" + GFXVersion + ".amdgcn.bc";
|
||||
|
||||
llvm::StringRef FlushDenormalControlBC;
|
||||
if (DriverArgs.hasArg(options::OPT_fcuda_flush_denormals_to_zero))
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
|
||||
// RUN: %clang_cc1 -triple amdgcn -target-cpu gfx904 -S -emit-llvm -o - %s | FileCheck --check-prefix=GFX904 %s
|
||||
// RUN: %clang_cc1 -triple amdgcn -target-cpu gfx906 -S -emit-llvm -o - %s | FileCheck --check-prefix=GFX906 %s
|
||||
// RUN: %clang_cc1 -triple amdgcn -target-cpu gfx1010 -S -emit-llvm -o - %s | FileCheck --check-prefix=GFX1010 %s
|
||||
// RUN: %clang_cc1 -triple amdgcn -target-cpu gfx801 -S -emit-llvm -o - %s | FileCheck --check-prefix=GFX801 %s
|
||||
// RUN: %clang_cc1 -triple amdgcn -target-cpu gfx700 -S -emit-llvm -o - %s | FileCheck --check-prefix=GFX700 %s
|
||||
// RUN: %clang_cc1 -triple amdgcn -target-cpu gfx600 -S -emit-llvm -o - %s | FileCheck --check-prefix=GFX600 %s
|
||||
|
@ -12,6 +13,7 @@
|
|||
|
||||
// GFX904: "target-features"="+16-bit-insts,+ci-insts,+dpp,+fp32-denormals,+fp64-fp16-denormals,+gfx8-insts,+gfx9-insts,+s-memrealtime"
|
||||
// GFX906: "target-features"="+16-bit-insts,+ci-insts,+dl-insts,+dot1-insts,+dot2-insts,+dpp,+fp32-denormals,+fp64-fp16-denormals,+gfx8-insts,+gfx9-insts,+s-memrealtime"
|
||||
// GFX1010: "target-features"="+16-bit-insts,+dl-insts,+dpp,+fp32-denormals,+fp64-fp16-denormals,+gfx10-insts,+gfx9-insts,+s-memrealtime"
|
||||
// GFX801: "target-features"="+16-bit-insts,+ci-insts,+dpp,+fp32-denormals,+fp64-fp16-denormals,+gfx8-insts,+s-memrealtime"
|
||||
// GFX700: "target-features"="+ci-insts,+fp64-fp16-denormals,-fp32-denormals"
|
||||
// GFX600: "target-features"="+fp64-fp16-denormals,-fp32-denormals"
|
||||
|
|
|
@ -23,3 +23,9 @@
|
|||
|
||||
// RUN: %clang -### -target amdgcn -mcpu=gfx700 -mno-sram-ecc %s 2>&1 | FileCheck --check-prefix=NO-SRAM-ECC %s
|
||||
// NO-SRAM-ECC: "-target-feature" "-sram-ecc"
|
||||
|
||||
// RUN: %clang -### -target amdgcn -mcpu=gfx1010 -mcumode %s 2>&1 | FileCheck --check-prefix=CUMODE %s
|
||||
// CUMODE: "-target-feature" "+cumode"
|
||||
|
||||
// RUN: %clang -### -target amdgcn -mcpu=gfx1010 -mno-cumode %s 2>&1 | FileCheck --check-prefix=NO-CUMODE %s
|
||||
// NO-CUMODE: "-target-feature" "-cumode"
|
||||
|
|
|
@ -176,6 +176,7 @@
|
|||
// RUN: %clang -E -dM -target amdgcn -mcpu=gfx904 %s 2>&1 | FileCheck --check-prefixes=ARCH-GCN,GFX904 %s
|
||||
// RUN: %clang -E -dM -target amdgcn -mcpu=gfx906 %s 2>&1 | FileCheck --check-prefixes=ARCH-GCN,GFX906 %s
|
||||
// RUN: %clang -E -dM -target amdgcn -mcpu=gfx909 %s 2>&1 | FileCheck --check-prefixes=ARCH-GCN,GFX909 %s
|
||||
// RUN: %clang -E -dM -target amdgcn -mcpu=gfx1010 %s 2>&1 | FileCheck --check-prefixes=ARCH-GCN,GFX1010 %s
|
||||
|
||||
// GFX600-DAG: #define FP_FAST_FMA 1
|
||||
// GFX601-DAG: #define FP_FAST_FMA 1
|
||||
|
@ -193,6 +194,7 @@
|
|||
// GFX904-DAG: #define FP_FAST_FMA 1
|
||||
// GFX906-DAG: #define FP_FAST_FMA 1
|
||||
// GFX909-DAG: #define FP_FAST_FMA 1
|
||||
// GFX1010-DAG: #define FP_FAST_FMA 1
|
||||
|
||||
// GFX600-DAG: #define FP_FAST_FMAF 1
|
||||
// GFX601-NOT: #define FP_FAST_FMAF 1
|
||||
|
@ -210,6 +212,7 @@
|
|||
// GFX904-DAG: #define FP_FAST_FMAF 1
|
||||
// GFX906-DAG: #define FP_FAST_FMAF 1
|
||||
// GFX909-DAG: #define FP_FAST_FMAF 1
|
||||
// GFX1010-DAG: #define FP_FAST_FMAF 1
|
||||
|
||||
// ARCH-GCN-DAG: #define __AMDGCN__ 1
|
||||
// ARCH-GCN-DAG: #define __AMDGPU__ 1
|
||||
|
@ -231,6 +234,7 @@
|
|||
// GFX904-DAG: #define __HAS_FMAF__ 1
|
||||
// GFX906-DAG: #define __HAS_FMAF__ 1
|
||||
// GFX909-DAG: #define __HAS_FMAF__ 1
|
||||
// GFX1010-DAG: #define __HAS_FMAF__ 1
|
||||
|
||||
// GFX600-DAG: #define __HAS_FP64__ 1
|
||||
// GFX601-DAG: #define __HAS_FP64__ 1
|
||||
|
@ -248,6 +252,7 @@
|
|||
// GFX904-DAG: #define __HAS_FP64__ 1
|
||||
// GFX906-DAG: #define __HAS_FP64__ 1
|
||||
// GFX909-DAG: #define __HAS_FP64__ 1
|
||||
// GFX1010-DAG: #define __HAS_FP64__ 1
|
||||
|
||||
// GFX600-DAG: #define __HAS_LDEXPF__ 1
|
||||
// GFX601-DAG: #define __HAS_LDEXPF__ 1
|
||||
|
@ -265,6 +270,7 @@
|
|||
// GFX904-DAG: #define __HAS_LDEXPF__ 1
|
||||
// GFX906-DAG: #define __HAS_LDEXPF__ 1
|
||||
// GFX909-DAG: #define __HAS_LDEXPF__ 1
|
||||
// GFX1010-DAG: #define __HAS_LDEXPF__ 1
|
||||
|
||||
// GFX600-DAG: #define __gfx600__ 1
|
||||
// GFX601-DAG: #define __gfx601__ 1
|
||||
|
@ -282,3 +288,4 @@
|
|||
// GFX904-DAG: #define __gfx904__ 1
|
||||
// GFX906-DAG: #define __gfx906__ 1
|
||||
// GFX909-DAG: #define __gfx909__ 1
|
||||
// GFX1010-DAG: #define __gfx1010__ 1
|
||||
|
|
|
@ -85,6 +85,7 @@
|
|||
// RUN: %clang -### -target amdgcn -mcpu=gfx904 %s 2>&1 | FileCheck --check-prefix=GFX904 %s
|
||||
// RUN: %clang -### -target amdgcn -mcpu=gfx906 %s 2>&1 | FileCheck --check-prefix=GFX906 %s
|
||||
// RUN: %clang -### -target amdgcn -mcpu=gfx909 %s 2>&1 | FileCheck --check-prefix=GFX909 %s
|
||||
// RUN: %clang -### -target amdgcn -mcpu=gfx1010 %s 2>&1 | FileCheck --check-prefix=GFX1010 %s
|
||||
|
||||
// GFX600: "-target-cpu" "gfx600"
|
||||
// TAHITI: "-target-cpu" "tahiti"
|
||||
|
@ -119,3 +120,4 @@
|
|||
// GFX904: "-target-cpu" "gfx904"
|
||||
// GFX906: "-target-cpu" "gfx906"
|
||||
// GFX909: "-target-cpu" "gfx909"
|
||||
// GFX1010: "-target-cpu" "gfx1010"
|
||||
|
|
Loading…
Reference in New Issue