From e0eac74f83d2f79264956d593ccc4d8e6253fcb2 Mon Sep 17 00:00:00 2001 From: Anton Mitrokhin Date: Thu, 30 Apr 2015 14:46:09 +0300 Subject: [PATCH] [AVX512]: separated knl from avx2 --- ispc.cpp | 15 ++++----------- module.cpp | 2 +- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/ispc.cpp b/ispc.cpp index 9e89b6cf..a6d6d2f5 100644 --- a/ispc.cpp +++ b/ispc.cpp @@ -347,7 +347,7 @@ public: #endif #if !defined(LLVM_3_2) && !defined(LLVM_3_3) && !defined(LLVM_3_4) && !defined(LLVM_3_5) && !defined(LLVM_3_6)// LLVM 3.7+ - compat[CPU_KNL] = Set(CPU_Generic, CPU_Bonnell, CPU_Penryn, + compat[CPU_KNL] = Set(CPU_Generic, CPU_Bonnell, CPU_Penryn, CPU_Core2, CPU_Nehalem, CPU_Silvermont, CPU_SandyBridge, CPU_IvyBridge, CPU_Haswell, CPU_Broadwell, CPU_None); @@ -841,11 +841,7 @@ Target::Target(const char *arch, const char *cpu, const char *isa, bool pic, boo CPUfromISA = CPU_IvyBridge; } else if (!strcasecmp(isa, "avx2") || - !strcasecmp(isa, "avx2-i32x8") || - // TODO: enable knl and skx support - // They are downconverted to avx2 for code generation. - !strcasecmp(isa, "skx") || - !strcasecmp(isa, "knl-avx512")) { + !strcasecmp(isa, "avx2-i32x8")) { this->m_isa = Target::AVX2; this->m_nativeVectorWidth = 8; this->m_nativeVectorAlignment = 32; @@ -943,8 +939,7 @@ Target::Target(const char *arch, const char *cpu, const char *isa, bool pic, boo } #endif #ifdef ISPC_NVPTX_ENABLED - else if (!strcasecmp(isa, "nvptx")) - { + else if (!strcasecmp(isa, "nvptx")) { this->m_isa = Target::NVPTX; this->m_cpu = "sm_35"; this->m_nativeVectorWidth = 32; @@ -1245,10 +1240,8 @@ Target::ISAToTargetString(ISA isa) { return "avx1.1-i32x8"; case Target::AVX2: return "avx2-i32x8"; - // TODO: enable knl and skx support. - // They are downconverted to avx2 for code generation. case Target::KNL_AVX512: - return "avx2"; + return "knl-avx512"; case Target::SKX: return "avx2"; case Target::GENERIC: diff --git a/module.cpp b/module.cpp index 6dc80747..112f66a1 100644 --- a/module.cpp +++ b/module.cpp @@ -2896,7 +2896,7 @@ lCreateDispatchFunction(llvm::Module *module, llvm::Function *setISAFunc, if ((Target::ISA)(i == Target::GENERIC) && !g->target->getTreatGenericAsSmth().empty()) { if (g->target->getTreatGenericAsSmth() == "knl_generic") - dispatchNum = Target::KNL; + dispatchNum = Target::KNL_AVX512; else if (g->target->getTreatGenericAsSmth() == "skx_generic") dispatchNum = Target::SKX; else {