diff options
author | Eric Christopher <echristo@apple.com> | 2012-05-07 03:13:42 +0000 |
---|---|---|
committer | Eric Christopher <echristo@apple.com> | 2012-05-07 03:13:42 +0000 |
commit | e5076d484b2f530e2e2422fb06c268970b53b055 (patch) | |
tree | 84ceba6e44f14606aed67cfb032672e421a669dd /lib/Target/Mips | |
parent | 50ab03954ec0a43708ad0a5cf3d253ce41a30db3 (diff) | |
download | external_llvm-e5076d484b2f530e2e2422fb06c268970b53b055.zip external_llvm-e5076d484b2f530e2e2422fb06c268970b53b055.tar.gz external_llvm-e5076d484b2f530e2e2422fb06c268970b53b055.tar.bz2 |
Support the 'J' constraint.
Patch by Jack Carter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156280 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/Mips')
-rw-r--r-- | lib/Target/Mips/MipsISelLowering.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/Target/Mips/MipsISelLowering.cpp b/lib/Target/Mips/MipsISelLowering.cpp index 13665ee..97332cf 100644 --- a/lib/Target/Mips/MipsISelLowering.cpp +++ b/lib/Target/Mips/MipsISelLowering.cpp @@ -3040,6 +3040,7 @@ MipsTargetLowering::getSingleConstraintMatchWeight( weight = CW_Register; break; case 'I': // signed 16 bit immediate + case 'J': // integer zero if (isa<ConstantInt>(CallOperandVal)) weight = CW_Constant; break; @@ -3102,6 +3103,16 @@ void MipsTargetLowering::LowerAsmOperandForConstraint(SDValue Op, } } return; + case 'J': // integer zero + if (ConstantSDNode *C = dyn_cast<ConstantSDNode>(Op)) { + EVT Type = Op.getValueType(); + int64_t Val = C->getZExtValue(); + if (Val == 0) { + Result = DAG.getTargetConstant(0, Type); + break; + } + } + return; } if (Result.getNode()) { |