Handle 'X' constraint in asm's better.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46485 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Dale Johannesen
2008-01-29 02:21:21 +00:00
parent c840da14c6
commit ba2a0b960e
6 changed files with 74 additions and 21 deletions

View File

@@ -1525,6 +1525,19 @@ TargetLowering::getConstraintType(const std::string &Constraint) const {
return C_Unknown;
}
/// LowerXConstraint - try to replace an X constraint, which matches anything,
/// with another that has more specific requirements based on the type of the
/// corresponding operand.
void TargetLowering::lowerXConstraint(MVT::ValueType ConstraintVT,
std::string& s) const {
if (MVT::isInteger(ConstraintVT))
s = "r";
else if (MVT::isFloatingPoint(ConstraintVT))
s = "f"; // works for many targets
else
s = "";
}
/// LowerAsmOperandForConstraint - Lower the specified operand into the Ops
/// vector. If it is invalid, don't add anything to Ops.
void TargetLowering::LowerAsmOperandForConstraint(SDOperand Op,