summaryrefslogtreecommitdiffstats
path: root/clang/lib/Basic/Targets.cpp
diff options
context:
space:
mode:
authorHal Finkel <hfinkel@anl.gov>2014-03-02 18:24:18 +0000
committerHal Finkel <hfinkel@anl.gov>2014-03-02 18:24:18 +0000
commitf7a07a5010e7abd97b3f5e56eb8a5c044c43ad6a (patch)
tree8e35b2df2adc03180b2c0ce40bab59ed12b72d3f /clang/lib/Basic/Targets.cpp
parent6aca2373f2b2deb9abbbbb16986c4f9066d0d52c (diff)
downloadbcm5719-llvm-f7a07a5010e7abd97b3f5e56eb8a5c044c43ad6a.tar.gz
bcm5719-llvm-f7a07a5010e7abd97b3f5e56eb8a5c044c43ad6a.zip
Add a PPC inline asm constraint type for single CR bits
This adds support for the PPC "wc" inline asm constraint (used for allocating individual CR bits). Support for this constraint type was recently added to the LLVM PowerPC backend. Although gcc does not currently support allocating individual CR bits, this identifier choice has been coordinated with the gcc PowerPC team, and will be marked as reserved for this purpose in the gcc constraints.md file. Prior to this change, none of the multi-character PPC constraints were handled correctly (the '^' escape character was not being added as required by the parsing code in LLVM). This should now be fixed. I'll add tests for these other constraints as support is added for them in the backend. llvm-svn: 202658
Diffstat (limited to 'clang/lib/Basic/Targets.cpp')
-rw-r--r--clang/lib/Basic/Targets.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/clang/lib/Basic/Targets.cpp b/clang/lib/Basic/Targets.cpp
index 4a87717693a..1a59ec62086 100644
--- a/clang/lib/Basic/Targets.cpp
+++ b/clang/lib/Basic/Targets.cpp
@@ -788,6 +788,7 @@ public:
case 'f':// VSX vector register to hold vector float data
case 's':// VSX vector register to hold scalar float data
case 'a':// Any VSX register
+ case 'c':// An individual CR bit
break;
default:
return false;
@@ -863,6 +864,20 @@ public:
}
return true;
}
+ virtual std::string convertConstraint(const char *&Constraint) const {
+ std::string R;
+ switch (*Constraint) {
+ case 'e':
+ case 'w':
+ // Two-character constraint; add "^" hint for later parsing.
+ R = std::string("^") + std::string(Constraint, 2);
+ Constraint++;
+ break;
+ default:
+ return TargetInfo::convertConstraint(Constraint);
+ }
+ return R;
+ }
virtual const char *getClobbers() const {
return "";
}
OpenPOWER on IntegriCloud