diff options
| author | Justin Holewinski <justin.holewinski@gmail.com> | 2011-09-15 12:13:38 +0000 |
|---|---|---|
| committer | Justin Holewinski <justin.holewinski@gmail.com> | 2011-09-15 12:13:38 +0000 |
| commit | aa78b235a5f2c3562b482eba7e496c430a07269b (patch) | |
| tree | b9a9e7ad0e34f930ad2c1011afbf7d3fa08105f4 | |
| parent | 99210dc9d158bb306a0d7fb735550971df9925b4 (diff) | |
| download | bcm5719-llvm-aa78b235a5f2c3562b482eba7e496c430a07269b.tar.gz bcm5719-llvm-aa78b235a5f2c3562b482eba7e496c430a07269b.zip | |
PTX: Define target options
llvm-svn: 139789
| -rw-r--r-- | clang/lib/Basic/Targets.cpp | 89 |
1 files changed, 89 insertions, 0 deletions
diff --git a/clang/lib/Basic/Targets.cpp b/clang/lib/Basic/Targets.cpp index 3198b361fb1..efbb1395739 100644 --- a/clang/lib/Basic/Targets.cpp +++ b/clang/lib/Basic/Targets.cpp @@ -916,6 +916,10 @@ namespace { // FIXME: implement return "typedef char* __builtin_va_list;"; } + + virtual bool setFeatureEnabled(llvm::StringMap<bool> &Features, + const std::string &Name, + bool Enabled) const; }; const Builtin::Info PTXTargetInfo::BuiltinInfo[] = { @@ -935,6 +939,91 @@ namespace { NumNames = llvm::array_lengthof(GCCRegNames); } + bool PTXTargetInfo::setFeatureEnabled(llvm::StringMap<bool> &Features, + const std::string &Name, + bool Enabled) const { + if (Enabled) { + if (Name == "double") + Features["double"] = true; + else if (Name == "no-fma") + Features["no-fma"] = true; + else if (Name == "compute10") + Features["compute10"] = true; + else if (Name == "compute11") + Features["compute11"] = true; + else if (Name == "compute12") + Features["compute12"] = true; + else if (Name == "compute13") + Features["compute13"] = true; + else if (Name == "compute20") + Features["compute20"] = true; + else if (Name == "ptx20") + Features["ptx20"] = true; + else if (Name == "ptx21") + Features["ptx21"] = true; + else if (Name == "ptx22") + Features["ptx22"] = true; + else if (Name == "ptx23") + Features["ptx23"] = true; + else if (Name == "sm10") + Features["sm10"] = true; + else if (Name == "sm11") + Features["sm11"] = true; + else if (Name == "sm12") + Features["sm12"] = true; + else if (Name == "sm13") + Features["sm13"] = true; + else if (Name == "sm20") + Features["sm20"] = true; + else if (Name == "sm21") + Features["sm21"] = true; + else if (Name == "sm22") + Features["sm22"] = true; + else if (Name == "sm23") + Features["sm23"] = true; + } else { + if (Name == "double") + Features["double"] = false; + else if (Name == "no-fma") + Features["no-fma"] = false; + else if (Name == "compute10") + Features["compute10"] = false; + else if (Name == "compute11") + Features["compute11"] = false; + else if (Name == "compute12") + Features["compute12"] = false; + else if (Name == "compute13") + Features["compute13"] = false; + else if (Name == "compute20") + Features["compute20"] = false; + else if (Name == "ptx20") + Features["ptx20"] = false; + else if (Name == "ptx21") + Features["ptx21"] = false; + else if (Name == "ptx22") + Features["ptx22"] = false; + else if (Name == "ptx23") + Features["ptx23"] = false; + else if (Name == "sm10") + Features["sm10"] = false; + else if (Name == "sm11") + Features["sm11"] = false; + else if (Name == "sm12") + Features["sm12"] = false; + else if (Name == "sm13") + Features["sm13"] = false; + else if (Name == "sm20") + Features["sm20"] = false; + else if (Name == "sm21") + Features["sm21"] = false; + else if (Name == "sm22") + Features["sm22"] = false; + else if (Name == "sm23") + Features["sm23"] = false; + } + + return true; + } class PTX32TargetInfo : public PTXTargetInfo { public: |

