Support of *-generic-16 target
This commit is contained in:
19
ispc.cpp
19
ispc.cpp
@@ -416,12 +416,13 @@ public:
|
||||
};
|
||||
|
||||
|
||||
Target::Target(const char *arch, const char *cpu, const char *isa, bool pic) :
|
||||
Target::Target(const char *arch, const char *cpu, const char *isa, bool pic, std::string genericAsSmth) :
|
||||
m_target(NULL),
|
||||
m_targetMachine(NULL),
|
||||
m_dataLayout(NULL),
|
||||
m_valid(false),
|
||||
m_isa(SSE2),
|
||||
m_treatGenericAsSmth(genericAsSmth),
|
||||
m_arch(""),
|
||||
m_is32Bit(true),
|
||||
m_cpu(""),
|
||||
@@ -660,8 +661,20 @@ Target::Target(const char *arch, const char *cpu, const char *isa, bool pic) :
|
||||
CPUfromISA = CPU_Generic;
|
||||
}
|
||||
else if (!strcasecmp(isa, "generic-16") ||
|
||||
!strcasecmp(isa, "generic-x16")) {
|
||||
!strcasecmp(isa, "generic-x16") ||
|
||||
// We treat *-generic-16 as generic-16, but with special name mangling
|
||||
strstr(isa, "-generic-16") ||
|
||||
strstr(isa, "-generic-x16")) {
|
||||
this->m_isa = Target::GENERIC;
|
||||
if (strstr(isa, "-generic-16") ||
|
||||
strstr(isa, "-generic-x16")) {
|
||||
// It is used for appropriate name mangling and dispatch function during multitarget compilation
|
||||
this->m_treatGenericAsSmth = isa;
|
||||
// We need to create appropriate name for mangling.
|
||||
// Remove "-x16" or "-16" and replace "-" with "_".
|
||||
this->m_treatGenericAsSmth = this->m_treatGenericAsSmth.substr(0, this->m_treatGenericAsSmth.find_last_of("-"));
|
||||
std::replace(this->m_treatGenericAsSmth.begin(), this->m_treatGenericAsSmth.end(), '-', '_');
|
||||
}
|
||||
this->m_nativeVectorWidth = 16;
|
||||
this->m_nativeVectorAlignment = 64;
|
||||
this->m_vectorWidth = 16;
|
||||
@@ -1065,7 +1078,7 @@ Target::SupportedTargets() {
|
||||
"avx1.1-i32x8, avx1.1-i32x16, avx1.1-i64x4 "
|
||||
"avx2-i32x8, avx2-i32x16, avx2-i64x4, "
|
||||
"generic-x1, generic-x4, generic-x8, generic-x16, "
|
||||
"generic-x32, generic-x64"
|
||||
"generic-x32, generic-x64, *-generic-x16"
|
||||
#ifdef ISPC_ARM_ENABLED
|
||||
", neon-i8x16, neon-i16x8, neon-i32x4"
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user