/// Indicate that the specified operation does not work with the specified
/// type and indicate what to do about it. Note that VT may refer to either
/// the type of a result or that of an operand of Op.
+ void setOperationAction(unsigned Op, MVT VT, LegalizeAction Action) {
+ assert(Op < array_lengthof(OpActions[0]) && "Table isn't big enough!");
+ OpActions[(unsigned)VT.SimpleTy][Op] = Action;
+ }
void setOperationAction(ArrayRef<unsigned> Ops, MVT VT,
LegalizeAction Action) {
- for (auto Op : Ops) {
- assert(Op < array_lengthof(OpActions[0]) && "Table isn't big enough!");
- OpActions[(unsigned)VT.SimpleTy][Op] = Action;
- }
+ for (auto Op : Ops)
+ setOperationAction(Op, VT, Action);
}
void setOperationAction(ArrayRef<unsigned> Ops, ArrayRef<MVT> VTs,
LegalizeAction Action) {
/// Indicate that the specified load with extension does not work with the
/// specified type and indicate what to do about it.
+ void setLoadExtAction(unsigned ExtType, MVT ValVT, MVT MemVT,
+ LegalizeAction Action) {
+ assert(ExtType < ISD::LAST_LOADEXT_TYPE && ValVT.isValid() &&
+ MemVT.isValid() && "Table isn't big enough!");
+ assert((unsigned)Action < 0x10 && "too many bits for bitfield array");
+ unsigned Shift = 4 * ExtType;
+ LoadExtActions[ValVT.SimpleTy][MemVT.SimpleTy] &= ~((uint16_t)0xF << Shift);
+ LoadExtActions[ValVT.SimpleTy][MemVT.SimpleTy] |= (uint16_t)Action << Shift;
+ }
void setLoadExtAction(ArrayRef<unsigned> ExtTypes, MVT ValVT, MVT MemVT,
LegalizeAction Action) {
- for (auto ExtType : ExtTypes) {
- assert(ExtType < ISD::LAST_LOADEXT_TYPE && ValVT.isValid() &&
- MemVT.isValid() && "Table isn't big enough!");
- assert((unsigned)Action < 0x10 && "too many bits for bitfield array");
- unsigned Shift = 4 * ExtType;
- LoadExtActions[ValVT.SimpleTy][MemVT.SimpleTy] &=
- ~((uint16_t)0xF << Shift);
- LoadExtActions[ValVT.SimpleTy][MemVT.SimpleTy] |= (uint16_t)Action
- << Shift;
- }
+ for (auto ExtType : ExtTypes)
+ setLoadExtAction(ExtType, ValVT, MemVT, Action);
}
-
void setLoadExtAction(ArrayRef<unsigned> ExtTypes, MVT ValVT,
ArrayRef<MVT> MemVTs, LegalizeAction Action) {
for (auto MemVT : MemVTs)
//
/// Rename the default libcall routine name for the specified libcall.
+ void setLibcallName(RTLIB::Libcall Call, const char *Name) {
+ LibcallRoutineNames[Call] = Name;
+ }
void setLibcallName(ArrayRef<RTLIB::Libcall> Calls, const char *Name) {
for (auto Call : Calls)
- LibcallRoutineNames[Call] = Name;
+ setLibcallName(Call, Name);
}
/// Get the libcall routine name for the specified libcall.