summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorEric Christopher <echristo@apple.com>2012-05-07 06:25:19 +0000
committerEric Christopher <echristo@apple.com>2012-05-07 06:25:19 +0000
commit0d8c15d20f419ac12357b3c6a41b5d626025bf5c (patch)
treeebd02f1a0b98f242a3c493e7ffb1b881617475cd /llvm
parent9c492e6ebfb6e00b60229b663f7e172562259412 (diff)
downloadbcm5719-llvm-0d8c15d20f419ac12357b3c6a41b5d626025bf5c.tar.gz
bcm5719-llvm-0d8c15d20f419ac12357b3c6a41b5d626025bf5c.zip
Add support for the 'x' constraint.
Patch by Jack Carter. llvm-svn: 156295
Diffstat (limited to 'llvm')
-rw-r--r--llvm/lib/Target/Mips/MipsISelLowering.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/llvm/lib/Target/Mips/MipsISelLowering.cpp b/llvm/lib/Target/Mips/MipsISelLowering.cpp
index ca0472b757a..337a5e30f4c 100644
--- a/llvm/lib/Target/Mips/MipsISelLowering.cpp
+++ b/llvm/lib/Target/Mips/MipsISelLowering.cpp
@@ -3001,7 +3001,8 @@ getConstraintType(const std::string &Constraint) const
// backwards compatibility.
// 'c' : A register suitable for use in an indirect
// jump. This will always be $25 for -mabicalls.
- // 'l' : The lo register.
+ // 'l' : The lo register. 1 word storage.
+ // 'x' : The hilo register pair. Double word storage.
if (Constraint.size() == 1) {
switch (Constraint[0]) {
default : break;
@@ -3010,6 +3011,7 @@ getConstraintType(const std::string &Constraint) const
case 'f':
case 'c':
case 'l':
+ case 'x':
return C_RegisterClass;
}
}
@@ -3045,6 +3047,7 @@ MipsTargetLowering::getSingleConstraintMatchWeight(
break;
case 'c': // $25 for indirect jumps
case 'l': // lo register
+ case 'x': // hilo register pair
if (type->isIntegerTy())
weight = CW_SpecificReg;
break;
@@ -3097,6 +3100,10 @@ getRegForInlineAsmConstraint(const std::string &Constraint, EVT VT) const
if (VT == MVT::i32)
return std::make_pair((unsigned)Mips::LO, &Mips::HILORegClass);
return std::make_pair((unsigned)Mips::LO64, &Mips::HILO64RegClass);
+ case 'x': // register suitable for indirect jump
+ // Fixme: Not triggering the use of both hi and low
+ // This will generate an error message
+ return std::make_pair(0u, static_cast<const TargetRegisterClass*>(0));
}
}
return TargetLowering::getRegForInlineAsmConstraint(Constraint, VT);
OpenPOWER on IntegriCloud