rename hasNativeSupportFor* -> is(Operation|Type)Legal.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23011 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner
2005-08-24 16:34:59 +00:00
parent 9ed62c16f2
commit de6a4bc058

View File

@@ -99,10 +99,10 @@ public:
return RC; return RC;
} }
/// hasNativeSupportFor - Return true if the target has native support for the /// isTypeLegal - Return true if the target has native support for the
/// specified value type. This means that it has a register that directly /// specified value type. This means that it has a register that directly
/// holds it without promotions or expansions. /// holds it without promotions or expansions.
bool hasNativeSupportFor(MVT::ValueType VT) const { bool isTypeLegal(MVT::ValueType VT) const {
return RegClassForVT[VT] != 0; return RegClassForVT[VT] != 0;
} }
@@ -132,15 +132,17 @@ public:
return LegalFPImmediates.end(); return LegalFPImmediates.end();
} }
/// getOperationAction - Return how this operation should be /// getOperationAction - Return how this operation should be treated: either
/// it is legal, needs to be promoted to a larger size, needs to be
/// expanded to some other code sequence, or the target has a custom expander
/// for it.
LegalizeAction getOperationAction(unsigned Op, MVT::ValueType VT) const { LegalizeAction getOperationAction(unsigned Op, MVT::ValueType VT) const {
return (LegalizeAction)((OpActions[Op] >> (2*VT)) & 3); return (LegalizeAction)((OpActions[Op] >> (2*VT)) & 3);
} }
/// hasNativeSupportForOperation - Return true if this operation is legal for /// isOperationLegal - Return true if the specified operation is legal on this
/// this type. /// target.
/// bool isOperationLegal(unsigned Op, MVT::ValueType VT) const {
bool hasNativeSupportForOperation(unsigned Op, MVT::ValueType VT) const {
return getOperationAction(Op, VT) == Legal; return getOperationAction(Op, VT) == Legal;
} }
@@ -154,8 +156,8 @@ public:
NVT = (MVT::ValueType)(NVT+1); NVT = (MVT::ValueType)(NVT+1);
assert(MVT::isInteger(NVT) == MVT::isInteger(VT) && NVT != MVT::isVoid && assert(MVT::isInteger(NVT) == MVT::isInteger(VT) && NVT != MVT::isVoid &&
"Didn't find type to promote to!"); "Didn't find type to promote to!");
} while (!hasNativeSupportFor(NVT) || } while (!isTypeLegal(NVT) ||
getOperationAction(Op, NVT) == Promote); getOperationAction(Op, NVT) == Promote);
return NVT; return NVT;
} }