MAJOR CHANGE--- STOP WITH THIS BRANCH--

This commit is contained in:
Evghenii
2014-01-06 13:51:02 +01:00
parent 77113fbffd
commit 546f9cb409
13 changed files with 710 additions and 1151 deletions

View File

@@ -174,7 +174,7 @@ static const char *supportedCPUs[] = {
#endif // LLVM 3.4+
};
Target::Target(const char *arch, const char *cpu, const char *isa, bool pic, bool isPTX) :
Target::Target(const char *arch, const char *cpu, const char *isa, bool pic) :
m_target(NULL),
m_targetMachine(NULL),
#if defined(LLVM_3_1)
@@ -184,7 +184,6 @@ Target::Target(const char *arch, const char *cpu, const char *isa, bool pic, boo
#endif
m_valid(false),
m_isa(SSE2),
m_isPTX(isPTX),
m_arch(""),
m_is32Bit(true),
m_cpu(""),
@@ -212,7 +211,7 @@ Target::Target(const char *arch, const char *cpu, const char *isa, bool pic, boo
if (!strcmp(cpu, "core-avx2"))
isa = "avx2-i32x8";
else if (!strcmp(cpu, "sm_35"))
isa = "nvptx64";
isa = "nvptx";
#ifdef ISPC_ARM_ENABLED
else if (!strcmp(cpu, "cortex-a9") ||
!strcmp(cpu, "cortex-a15"))
@@ -249,7 +248,7 @@ Target::Target(const char *arch, const char *cpu, const char *isa, bool pic, boo
cpu = "cortex-a9";
#endif
if (cpu == NULL && !strcmp(isa, "nvptx64"))
if (cpu == NULL && !strcmp(isa, "nvptx"))
cpu = "sm_35";
if (cpu == NULL) {
@@ -280,8 +279,8 @@ Target::Target(const char *arch, const char *cpu, const char *isa, bool pic, boo
this->m_cpu = cpu;
if (arch == NULL) {
if (!strcmp(isa, "nvptx64"))
arch = "nvptx64";
if (!strcmp(isa, "nvptx"))
arch = "nvptx";
#ifdef ISPC_ARM_ENABLED
else if (!strncmp(isa, "neon", 4))
arch = "arm";
@@ -709,10 +708,9 @@ Target::Target(const char *arch, const char *cpu, const char *isa, bool pic, boo
this->m_maskBitCount = 32;
}
#endif
else if (!strcasecmp(isa, "nvptx64"))
else if (!strcasecmp(isa, "nvptx"))
{
this->m_isa = Target::NVPTX64;
this->m_isPTX = true;
this->m_isa = Target::NVPTX;
this->m_nativeVectorWidth = 32;
this->m_nativeVectorAlignment = 32;
this->m_vectorWidth = 1;
@@ -780,7 +778,7 @@ Target::Target(const char *arch, const char *cpu, const char *isa, bool pic, boo
dl_string = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-"
"i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-"
"f80:128:128-n8:16:32:64-S128-v16:16:16-v32:32:32-v4:128:128";
} else if (m_isa == Target::NVPTX64)
} else if (m_isa == Target::NVPTX)
{
dl_string = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v16:16:16-v32:32:32-v64:64:64-v128:128:128-n16:32:64";
}
@@ -803,7 +801,7 @@ Target::Target(const char *arch, const char *cpu, const char *isa, bool pic, boo
// Initialize target-specific "target-feature" attribute.
if (!m_attributes.empty()) {
llvm::AttrBuilder attrBuilder;
if (m_isa != Target::NVPTX64)
if (m_isa != Target::NVPTX)
attrBuilder.addAttribute("target-cpu", this->m_cpu);
attrBuilder.addAttribute("target-features", this->m_attributes);
this->m_tf_attributes = new llvm::AttributeSet(
@@ -838,7 +836,7 @@ Target::SupportedCPUs() {
const char *
Target::SupportedArchs() {
return "nvptx64, "
return "nvptx, "
#ifdef ISPC_ARM_ENABLED
"arm, "
#endif
@@ -848,7 +846,7 @@ Target::SupportedArchs() {
const char *
Target::SupportedTargets() {
return "nvptx64, "
return "nvptx, "
#ifdef ISPC_ARM_ENABLED
"neon-i8x16, neon-i16x8, neon-i32x4, "
#endif
@@ -866,9 +864,9 @@ Target::SupportedTargets() {
std::string
Target::GetTripleString() const {
llvm::Triple triple;
if (m_arch == "nvptx64")
if (m_arch == "nvptx")
{
triple.setTriple("nvptx64");
triple.setTriple("nvptx");
}
#ifdef ISPC_ARM_ENABLED
else if (m_arch == "arm") {
@@ -902,8 +900,8 @@ Target::GetTripleString() const {
const char *
Target::ISAToString(ISA isa) {
switch (isa) {
case Target::NVPTX64:
return "nvptx64";
case Target::NVPTX:
return "nvptx";
#ifdef ISPC_ARM_ENABLED
case Target::NEON8:
return "neon-8";