diff options
author | Guy Benyei <guy.benyei@intel.com> | 2012-11-15 21:24:48 +0000 |
---|---|---|
committer | Guy Benyei <guy.benyei@intel.com> | 2012-11-15 21:24:48 +0000 |
commit | 3481efbe83bbd775b609ea02ee426fb956b9c43a (patch) | |
tree | a447fdfe5c07f4f7c3e736ba51383d661512c59e /lib | |
parent | d0e51c6d1974636579f687f9454c85ebeacc7cd2 (diff) | |
download | llvm-3481efbe83bbd775b609ea02ee426fb956b9c43a.tar.gz llvm-3481efbe83bbd775b609ea02ee426fb956b9c43a.tar.bz2 llvm-3481efbe83bbd775b609ea02ee426fb956b9c43a.tar.xz |
Bugzilla bug 14357
Merge SPIR64 target from trunk - the 64bit counterpart of SPIR.
The new OpenCL SPIR extension spec will define separate SPIR for 32 and 64 bit architectures.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_32@168092 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Support/Triple.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/Support/Triple.cpp b/lib/Support/Triple.cpp index c59ec19ecb..c058c05595 100644 --- a/lib/Support/Triple.cpp +++ b/lib/Support/Triple.cpp @@ -43,6 +43,7 @@ const char *Triple::getArchTypeName(ArchType Kind) { case le32: return "le32"; case amdil: return "amdil"; case spir: return "spir"; + case spir64: return "spir64"; } llvm_unreachable("Invalid ArchType!"); @@ -85,6 +86,7 @@ const char *Triple::getArchTypePrefix(ArchType Kind) { case le32: return "le32"; case amdil: return "amdil"; case spir: return "spir"; + case spir64: return "spir"; } } @@ -177,6 +179,7 @@ Triple::ArchType Triple::getArchTypeForLLVMName(StringRef Name) { .Case("le32", le32) .Case("amdil", amdil) .Case("spir", spir) + .Case("spir64", spir64) .Default(UnknownArch); } @@ -202,6 +205,7 @@ const char *Triple::getArchNameForAssembler() { .Case("le32", "le32") .Case("amdil", "amdil") .Case("spir", "spir") + .Case("spir64", "spir64") .Default(NULL); } @@ -237,6 +241,7 @@ static Triple::ArchType parseArch(StringRef ArchName) { .Case("le32", Triple::le32) .Case("amdil", Triple::amdil) .Case("spir", Triple::spir) + .Case("spir64", Triple::spir64) .Default(Triple::UnknownArch); } @@ -650,7 +655,6 @@ void Triple::setOSAndEnvironmentName(StringRef Str) { static unsigned getArchPointerBitWidth(llvm::Triple::ArchType Arch) { switch (Arch) { - case llvm::Triple::spir: case llvm::Triple::UnknownArch: return 0; @@ -673,6 +677,7 @@ static unsigned getArchPointerBitWidth(llvm::Triple::ArchType Arch) { case llvm::Triple::thumb: case llvm::Triple::x86: case llvm::Triple::xcore: + case llvm::Triple::spir: return 32; case llvm::Triple::mips64: @@ -681,6 +686,7 @@ static unsigned getArchPointerBitWidth(llvm::Triple::ArchType Arch) { case llvm::Triple::ppc64: case llvm::Triple::sparcv9: case llvm::Triple::x86_64: + case llvm::Triple::spir64: return 64; } llvm_unreachable("Invalid architecture value"); @@ -732,6 +738,7 @@ Triple Triple::get32BitArchVariant() const { 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; } @@ -754,7 +761,7 @@ Triple Triple::get64BitArchVariant() const { T.setArch(UnknownArch); break; - case Triple::spir: + case Triple::spir64: case Triple::mips64: case Triple::mips64el: case Triple::nvptx64: @@ -770,6 +777,7 @@ Triple Triple::get64BitArchVariant() const { 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; } |