llvm.org GIT mirror llvm / 3481efb
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 Guy Benyei 6 years ago
2 changed file(s) with 12 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
6565 nvptx64, // NVPTX: 64-bit
6666 le32, // le32: generic little-endian 32-bit CPU (PNaCl / Emscripten)
6767 amdil, // amdil: amd IL
68 spir // SPIR: standard portable IR for OpenCL
68 spir, // SPIR: standard portable IR for OpenCL 32-bit version
69 spir64 // SPIR: standard portable IR for OpenCL 64-bit version
6970 };
7071 enum VendorType {
7172 UnknownVendor,
4242 case le32: return "le32";
4343 case amdil: return "amdil";
4444 case spir: return "spir";
45 case spir64: return "spir64";
4546 }
4647
4748 llvm_unreachable("Invalid ArchType!");
8485 case le32: return "le32";
8586 case amdil: return "amdil";
8687 case spir: return "spir";
88 case spir64: return "spir";
8789 }
8890 }
8991
176178 .Case("le32", le32)
177179 .Case("amdil", amdil)
178180 .Case("spir", spir)
181 .Case("spir64", spir64)
179182 .Default(UnknownArch);
180183 }
181184
201204 .Case("le32", "le32")
202205 .Case("amdil", "amdil")
203206 .Case("spir", "spir")
207 .Case("spir64", "spir64")
204208 .Default(NULL);
205209 }
206210
236240 .Case("le32", Triple::le32)
237241 .Case("amdil", Triple::amdil)
238242 .Case("spir", Triple::spir)
243 .Case("spir64", Triple::spir64)
239244 .Default(Triple::UnknownArch);
240245 }
241246
649654
650655 static unsigned getArchPointerBitWidth(llvm::Triple::ArchType Arch) {
651656 switch (Arch) {
652 case llvm::Triple::spir:
653657 case llvm::Triple::UnknownArch:
654658 return 0;
655659
672676 case llvm::Triple::thumb:
673677 case llvm::Triple::x86:
674678 case llvm::Triple::xcore:
679 case llvm::Triple::spir:
675680 return 32;
676681
677682 case llvm::Triple::mips64:
680685 case llvm::Triple::ppc64:
681686 case llvm::Triple::sparcv9:
682687 case llvm::Triple::x86_64:
688 case llvm::Triple::spir64:
683689 return 64;
684690 }
685691 llvm_unreachable("Invalid architecture value");
731737 case Triple::ppc64: T.setArch(Triple::ppc); break;
732738 case Triple::sparcv9: T.setArch(Triple::sparc); break;
733739 case Triple::x86_64: T.setArch(Triple::x86); break;
740 case Triple::spir64: T.setArch(Triple::spir); break;
734741 }
735742 return T;
736743 }
753760 T.setArch(UnknownArch);
754761 break;
755762
756 case Triple::spir:
763 case Triple::spir64:
757764 case Triple::mips64:
758765 case Triple::mips64el:
759766 case Triple::nvptx64:
769776 case Triple::ppc: T.setArch(Triple::ppc64); break;
770777 case Triple::sparc: T.setArch(Triple::sparcv9); break;
771778 case Triple::x86: T.setArch(Triple::x86_64); break;
779 case Triple::spir: T.setArch(Triple::spir64); break;
772780 }
773781 return T;
774782 }