mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-24 23:28:41 +00:00
Inline asm multiple alternative constraints development phase 2 - improved basic logic, added initial platform support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117667 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -1269,6 +1269,37 @@ getConstraintType(const std::string &Constraint) const
|
||||
return TargetLowering::getConstraintType(Constraint);
|
||||
}
|
||||
|
||||
/// Examine constraint type and operand type and determine a weight value.
|
||||
/// This object must already have been set up with the operand type
|
||||
/// and the current alternative constraint selected.
|
||||
TargetLowering::ConstraintWeight
|
||||
MipsTargetLowering::getSingleConstraintMatchWeight(
|
||||
AsmOperandInfo &info, const char *constraint) const {
|
||||
ConstraintWeight weight = CW_Invalid;
|
||||
Value *CallOperandVal = info.CallOperandVal;
|
||||
// If we don't have a value, we can't do a match,
|
||||
// but allow it at the lowest weight.
|
||||
if (CallOperandVal == NULL)
|
||||
return CW_Default;
|
||||
const Type *type = CallOperandVal->getType();
|
||||
// Look at the constraint type.
|
||||
switch (*constraint) {
|
||||
default:
|
||||
weight = TargetLowering::getSingleConstraintMatchWeight(info, constraint);
|
||||
break;
|
||||
case 'd':
|
||||
case 'y':
|
||||
if (type->isIntegerTy())
|
||||
weight = CW_Register;
|
||||
break;
|
||||
case 'f':
|
||||
if (type->isFloatTy())
|
||||
weight = CW_Register;
|
||||
break;
|
||||
}
|
||||
return weight;
|
||||
}
|
||||
|
||||
/// getRegClassForInlineAsmConstraint - Given a constraint letter (e.g. "r"),
|
||||
/// return a list of registers that can be used to satisfy the constraint.
|
||||
/// This should only be used for C_RegisterClass constraints.
|
||||
|
Reference in New Issue
Block a user