aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorEric Christopher <echristo@apple.com>2011-07-01 01:00:07 +0000
committerEric Christopher <echristo@apple.com>2011-07-01 01:00:07 +0000
commit5e653c925c7da969c3fb5fa9a46263ffb160b81e (patch)
treea7359b33afbdc323fc4d59a23f163c59d227e570 /lib
parent30cb6dda5ae441f27edef302cbb33936fbafba6d (diff)
downloadexternal_llvm-5e653c925c7da969c3fb5fa9a46263ffb160b81e.tar.gz
external_llvm-5e653c925c7da969c3fb5fa9a46263ffb160b81e.tar.bz2
external_llvm-5e653c925c7da969c3fb5fa9a46263ffb160b81e.zip
Add support for the 'j' immediate constraint. This is conditionalized on
supporting the instruction that the constraint is for 'movw'. Part of rdar://9119939 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134222 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Target/ARM/ARMISelLowering.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/Target/ARM/ARMISelLowering.cpp b/lib/Target/ARM/ARMISelLowering.cpp
index 4a78ad4bf2..fb738cd65c 100644
--- a/lib/Target/ARM/ARMISelLowering.cpp
+++ b/lib/Target/ARM/ARMISelLowering.cpp
@@ -7485,6 +7485,7 @@ ARMTargetLowering::getConstraintType(const std::string &Constraint) const {
case 'h': return C_RegisterClass;
case 'x': return C_RegisterClass;
case 't': return C_RegisterClass;
+ case 'j': return C_Other; // Constant for movw.
}
} else if (Constraint.size() == 2) {
switch (Constraint[0]) {
@@ -7590,6 +7591,7 @@ void ARMTargetLowering::LowerAsmOperandForConstraint(SDValue Op,
char ConstraintLetter = Constraint[0];
switch (ConstraintLetter) {
default: break;
+ case 'j':
case 'I': case 'J': case 'K': case 'L':
case 'M': case 'N': case 'O':
ConstantSDNode *C = dyn_cast<ConstantSDNode>(Op);
@@ -7604,6 +7606,13 @@ void ARMTargetLowering::LowerAsmOperandForConstraint(SDValue Op,
return;
switch (ConstraintLetter) {
+ case 'j':
+ // Constant suitable for movw, must be between 0 and
+ // 65535.
+ if (Subtarget->hasV6T2Ops())
+ if (CVal >= 0 && CVal <= 65535)
+ break;
+ return;
case 'I':
if (Subtarget->isThumb1Only()) {
// This must be a constant between 0 and 255, for ADD