diff options
author | Eric Christopher <echristo@apple.com> | 2012-05-07 06:25:02 +0000 |
---|---|---|
committer | Eric Christopher <echristo@apple.com> | 2012-05-07 06:25:02 +0000 |
commit | c18ae4a3b1f0888a7347b9691981f7cdcf3d589a (patch) | |
tree | b31b344b2b24947b838050479145559e035236b0 /llvm/lib/Target | |
parent | 6347b68fd95ba302d095078a39a2a3e371c708d3 (diff) | |
download | bcm5719-llvm-c18ae4a3b1f0888a7347b9691981f7cdcf3d589a.tar.gz bcm5719-llvm-c18ae4a3b1f0888a7347b9691981f7cdcf3d589a.zip |
Add support for the 'P' constraint.
Patch by Jack Carter.
llvm-svn: 156292
Diffstat (limited to 'llvm/lib/Target')
-rw-r--r-- | llvm/lib/Target/Mips/MipsISelLowering.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/llvm/lib/Target/Mips/MipsISelLowering.cpp b/llvm/lib/Target/Mips/MipsISelLowering.cpp index 97a0ef67367..910416fe5c5 100644 --- a/llvm/lib/Target/Mips/MipsISelLowering.cpp +++ b/llvm/lib/Target/Mips/MipsISelLowering.cpp @@ -3045,6 +3045,7 @@ MipsTargetLowering::getSingleConstraintMatchWeight( case 'L': // signed 32 bit immediate where lower 16 bits are 0 case 'N': // immediate in the range of -65535 to -1 (inclusive) case 'O': // signed 15 bit immediate (+- 16383) + case 'P': // immediate in the range of 65535 to 1 (inclusive) if (isa<ConstantInt>(CallOperandVal)) weight = CW_Constant; break; @@ -3157,6 +3158,16 @@ void MipsTargetLowering::LowerAsmOperandForConstraint(SDValue Op, } } return; + case 'P': // immediate in the range of 1 to 65535 (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()) { |