summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/Mips/MipsISelLowering.cpp
diff options
context:
space:
mode:
authorEric Christopher <echristo@apple.com>2012-05-07 05:46:43 +0000
committerEric Christopher <echristo@apple.com>2012-05-07 05:46:43 +0000
commite07aa430b84edeb451684376f8dac28e812f8a98 (patch)
tree87052a7eb3bdee604980f16915f7d5f785d199d5 /llvm/lib/Target/Mips/MipsISelLowering.cpp
parent1109b3406d721eff20c0d1eedf3d09db2a7df716 (diff)
downloadbcm5719-llvm-e07aa430b84edeb451684376f8dac28e812f8a98.tar.gz
bcm5719-llvm-e07aa430b84edeb451684376f8dac28e812f8a98.zip
Add support for the 'N' inline asm constraint.
Patch by Jack Carter. llvm-svn: 156284
Diffstat (limited to 'llvm/lib/Target/Mips/MipsISelLowering.cpp')
-rw-r--r--llvm/lib/Target/Mips/MipsISelLowering.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/llvm/lib/Target/Mips/MipsISelLowering.cpp b/llvm/lib/Target/Mips/MipsISelLowering.cpp
index 3f445a0cc8c..ded6aa0608b 100644
--- a/llvm/lib/Target/Mips/MipsISelLowering.cpp
+++ b/llvm/lib/Target/Mips/MipsISelLowering.cpp
@@ -3043,6 +3043,7 @@ MipsTargetLowering::getSingleConstraintMatchWeight(
case 'J': // integer zero
case 'K': // unsigned 16 bit immediate
case 'L': // signed 32 bit immediate where lower 16 bits are 0
+ case 'N': // immediate in the range of -65535 to -1 (inclusive)
if (isa<ConstantInt>(CallOperandVal))
weight = CW_Constant;
break;
@@ -3135,6 +3136,16 @@ void MipsTargetLowering::LowerAsmOperandForConstraint(SDValue Op,
}
}
return;
+ case 'N': // immediate in the range of -65535 to -1 (inclusive)
+ if (ConstantSDNode *C = dyn_cast<ConstantSDNode>(Op)) {
+ EVT Type = Op.getValueType();
+ int64_t Val = C->getSExtValue();
+ if ((Val >= -65535) && (Val <= -1)) {
+ Result = DAG.getTargetConstant(Val, Type);
+ break;
+ }
+ }
+ return;
}
if (Result.getNode()) {
OpenPOWER on IntegriCloud