[llvm-commits] [llvm] r168036 - in /llvm/trunk: include/llvm/ADT/Triple.h lib/Support/Triple.cpp
Guy Benyei
guy.benyei at intel.com
Thu Nov 15 02:35:47 PST 2012
Author: gbenyei
Date: Thu Nov 15 04:35:47 2012
New Revision: 168036
URL: http://llvm.org/viewvc/llvm-project?rev=168036&view=rev
Log:
Add support for SPIR64 target - the 64bit counterpart of SPIR.
The new OpenCL SPIR extension spec will define separate SPIR for 32 and 64 bit architectures.
Modified:
llvm/trunk/include/llvm/ADT/Triple.h
llvm/trunk/lib/Support/Triple.cpp
Modified: llvm/trunk/include/llvm/ADT/Triple.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/Triple.h?rev=168036&r1=168035&r2=168036&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/Triple.h (original)
+++ llvm/trunk/include/llvm/ADT/Triple.h Thu Nov 15 04:35:47 2012
@@ -65,7 +65,8 @@
nvptx64, // NVPTX: 64-bit
le32, // le32: generic little-endian 32-bit CPU (PNaCl / Emscripten)
amdil, // amdil: amd IL
- spir // SPIR: standard portable IR for OpenCL
+ spir, // SPIR: standard portable IR for OpenCL 32-bit version
+ spir64 // SPIR: standard portable IR for OpenCL 64-bit version
};
enum VendorType {
UnknownVendor,
Modified: llvm/trunk/lib/Support/Triple.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Triple.cpp?rev=168036&r1=168035&r2=168036&view=diff
==============================================================================
--- llvm/trunk/lib/Support/Triple.cpp (original)
+++ llvm/trunk/lib/Support/Triple.cpp Thu Nov 15 04:35:47 2012
@@ -42,6 +42,7 @@
case le32: return "le32";
case amdil: return "amdil";
case spir: return "spir";
+ case spir64: return "spir64";
}
llvm_unreachable("Invalid ArchType!");
@@ -82,6 +83,7 @@
case le32: return "le32";
case amdil: return "amdil";
case spir: return "spir";
+ case spir64: return "spir";
}
}
@@ -173,6 +175,7 @@
.Case("le32", le32)
.Case("amdil", amdil)
.Case("spir", spir)
+ .Case("spir64", spir64)
.Default(UnknownArch);
}
@@ -198,6 +201,7 @@
.Case("le32", "le32")
.Case("amdil", "amdil")
.Case("spir", "spir")
+ .Case("spir64", "spir64")
.Default(NULL);
}
@@ -232,6 +236,7 @@
.Case("le32", Triple::le32)
.Case("amdil", Triple::amdil)
.Case("spir", Triple::spir)
+ .Case("spir64", Triple::spir64)
.Default(Triple::UnknownArch);
}
@@ -645,7 +650,6 @@
static unsigned getArchPointerBitWidth(llvm::Triple::ArchType Arch) {
switch (Arch) {
- case llvm::Triple::spir:
case llvm::Triple::UnknownArch:
return 0;
@@ -667,6 +671,7 @@
case llvm::Triple::thumb:
case llvm::Triple::x86:
case llvm::Triple::xcore:
+ case llvm::Triple::spir:
return 32;
case llvm::Triple::mips64:
@@ -675,6 +680,7 @@
case llvm::Triple::ppc64:
case llvm::Triple::sparcv9:
case llvm::Triple::x86_64:
+ case llvm::Triple::spir64:
return 64;
}
llvm_unreachable("Invalid architecture value");
@@ -725,6 +731,7 @@
case Triple::ppc64: T.setArch(Triple::ppc); break;
case Triple::sparcv9: T.setArch(Triple::sparc); break;
case Triple::x86_64: T.setArch(Triple::x86); break;
+ case Triple::spir64: T.setArch(Triple::spir); break;
}
return T;
}
@@ -746,7 +753,7 @@
T.setArch(UnknownArch);
break;
- case Triple::spir:
+ case Triple::spir64:
case Triple::mips64:
case Triple::mips64el:
case Triple::nvptx64:
@@ -762,6 +769,7 @@
case Triple::ppc: T.setArch(Triple::ppc64); break;
case Triple::sparc: T.setArch(Triple::sparcv9); break;
case Triple::x86: T.setArch(Triple::x86_64); break;
+ case Triple::spir: T.setArch(Triple::spir64); break;
}
return T;
}
More information about the llvm-commits
mailing list