diff options
author | Eric Christopher <echristo@apple.com> | 2012-05-07 05:46:48 +0000 |
---|---|---|
committer | Eric Christopher <echristo@apple.com> | 2012-05-07 05:46:48 +0000 |
commit | 470578a91b40a4391170a0bbd1ba3f8303386675 (patch) | |
tree | 0d1cd71a732ab1ae8b475b1626e2395b1158a6a8 /llvm/lib | |
parent | e07aa430b84edeb451684376f8dac28e812f8a98 (diff) | |
download | bcm5719-llvm-470578a91b40a4391170a0bbd1ba3f8303386675.tar.gz bcm5719-llvm-470578a91b40a4391170a0bbd1ba3f8303386675.zip |
Add support for the 'O' constraint.
Patch by Jack Carter.
llvm-svn: 156285
Diffstat (limited to 'llvm/lib')
-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 ded6aa0608b..97a0ef67367 100644 --- a/llvm/lib/Target/Mips/MipsISelLowering.cpp +++ b/llvm/lib/Target/Mips/MipsISelLowering.cpp @@ -3044,6 +3044,7 @@ MipsTargetLowering::getSingleConstraintMatchWeight( 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) + case 'O': // signed 15 bit immediate (+- 16383) if (isa<ConstantInt>(CallOperandVal)) weight = CW_Constant; break; @@ -3146,6 +3147,16 @@ void MipsTargetLowering::LowerAsmOperandForConstraint(SDValue Op, } } return; + case 'O': // signed 15 bit immediate + if (ConstantSDNode *C = dyn_cast<ConstantSDNode>(Op)) { + EVT Type = Op.getValueType(); + int64_t Val = C->getSExtValue(); + if ((isInt<15>(Val))) { + Result = DAG.getTargetConstant(Val, Type); + break; + } + } + return; } if (Result.getNode()) { |