diff options
| author | Alex Rosenberg <alexr@leftfield.org> | 2015-01-25 22:46:59 +0000 |
|---|---|---|
| committer | Alex Rosenberg <alexr@leftfield.org> | 2015-01-25 22:46:59 +0000 |
| commit | 38babd1eeb9a74dbda9aa628eb16390a2e5eab44 (patch) | |
| tree | 06913e0af7d4f1b85c02823bde1be69b0eba8e54 | |
| parent | efdbf4c0b78eb3504214f118472dc48ecbdabde1 (diff) | |
| download | bcm5719-llvm-38babd1eeb9a74dbda9aa628eb16390a2e5eab44.tar.gz bcm5719-llvm-38babd1eeb9a74dbda9aa628eb16390a2e5eab44.zip | |
Add the triple for the Sony Playstation®4.
Lots more to follow.
llvm-svn: 227060
| -rw-r--r-- | llvm/include/llvm/ADT/Triple.h | 16 | ||||
| -rw-r--r-- | llvm/lib/Support/Triple.cpp | 2 |
2 files changed, 17 insertions, 1 deletions
diff --git a/llvm/include/llvm/ADT/Triple.h b/llvm/include/llvm/ADT/Triple.h index 48df27e4bb6..55c884f65f0 100644 --- a/llvm/include/llvm/ADT/Triple.h +++ b/llvm/include/llvm/ADT/Triple.h @@ -141,7 +141,8 @@ public: AIX, CUDA, // NVIDIA CUDA NVCL, // NVIDIA OpenCL - AMDHSA // AMD HSA Runtime + AMDHSA, // AMD HSA Runtime + PS4 }; enum EnvironmentType { UnknownEnvironment, @@ -455,6 +456,19 @@ public: return getObjectFormat() == Triple::MachO; } + /// \brief Tests whether the target is the PS4 CPU + bool isPS4CPU() const { + return getArch() == Triple::x86_64 && + getVendor() == Triple::SCEI && + getOS() == Triple::PS4; + } + + /// \brief Tests whether the target is the PS4 platform + bool isPS4() const { + return getVendor() == Triple::SCEI && + getOS() == Triple::PS4; + } + /// @} /// @name Mutators /// @{ diff --git a/llvm/lib/Support/Triple.cpp b/llvm/lib/Support/Triple.cpp index 68548299d34..4032d6d77c9 100644 --- a/llvm/lib/Support/Triple.cpp +++ b/llvm/lib/Support/Triple.cpp @@ -163,6 +163,7 @@ const char *Triple::getOSTypeName(OSType Kind) { case CUDA: return "cuda"; case NVCL: return "nvcl"; case AMDHSA: return "amdhsa"; + case PS4: return "ps4"; } llvm_unreachable("Invalid OSType"); @@ -356,6 +357,7 @@ static Triple::OSType parseOS(StringRef OSName) { .StartsWith("cuda", Triple::CUDA) .StartsWith("nvcl", Triple::NVCL) .StartsWith("amdhsa", Triple::AMDHSA) + .StartsWith("ps4", Triple::PS4) .Default(Triple::UnknownOS); } |

