1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-01-31 20:51:52 +01:00

[ARM] Move machine operand target flags to ARMBaseInstrInfo

This makes sure the flags are available for use for thumb MIR as well.

A test that requires this will be added in the next commit.

llvm-svn: 340450
This commit is contained in:
Martin Storsjo 2018-08-22 20:34:06 +00:00
parent a83db8d2cb
commit f934a89e05
4 changed files with 35 additions and 35 deletions

View File

@ -5060,3 +5060,31 @@ bool ARMBaseInstrInfo::getInsertSubregLikeInputs(
}
llvm_unreachable("Target dependent opcode missing");
}
std::pair<unsigned, unsigned>
ARMBaseInstrInfo::decomposeMachineOperandsTargetFlags(unsigned TF) const {
const unsigned Mask = ARMII::MO_OPTION_MASK;
return std::make_pair(TF & Mask, TF & ~Mask);
}
ArrayRef<std::pair<unsigned, const char *>>
ARMBaseInstrInfo::getSerializableDirectMachineOperandTargetFlags() const {
using namespace ARMII;
static const std::pair<unsigned, const char *> TargetFlags[] = {
{MO_LO16, "arm-lo16"}, {MO_HI16, "arm-hi16"}};
return makeArrayRef(TargetFlags);
}
ArrayRef<std::pair<unsigned, const char *>>
ARMBaseInstrInfo::getSerializableBitmaskMachineOperandTargetFlags() const {
using namespace ARMII;
static const std::pair<unsigned, const char *> TargetFlags[] = {
{MO_GOT, "arm-got"},
{MO_SBREL, "arm-sbrel"},
{MO_DLLIMPORT, "arm-dllimport"},
{MO_SECREL, "arm-secrel"},
{MO_NONLAZY, "arm-nonlazy"}};
return makeArrayRef(TargetFlags);
}

View File

@ -331,6 +331,13 @@ public:
/// Get the number of addresses by LDM or VLDM or zero for unknown.
unsigned getNumLDMAddresses(const MachineInstr &MI) const;
std::pair<unsigned, unsigned>
decomposeMachineOperandsTargetFlags(unsigned TF) const override;
ArrayRef<std::pair<unsigned, const char *>>
getSerializableDirectMachineOperandTargetFlags() const override;
ArrayRef<std::pair<unsigned, const char *>>
getSerializableBitmaskMachineOperandTargetFlags() const override;
private:
unsigned getInstBundleLength(const MachineInstr &MI) const;

View File

@ -135,31 +135,3 @@ void ARMInstrInfo::expandLoadStackGuard(MachineBasicBlock::iterator MI) const {
.cloneMemRefs(*MI)
.add(predOps(ARMCC::AL));
}
std::pair<unsigned, unsigned>
ARMInstrInfo::decomposeMachineOperandsTargetFlags(unsigned TF) const {
const unsigned Mask = ARMII::MO_OPTION_MASK;
return std::make_pair(TF & Mask, TF & ~Mask);
}
ArrayRef<std::pair<unsigned, const char *>>
ARMInstrInfo::getSerializableDirectMachineOperandTargetFlags() const {
using namespace ARMII;
static const std::pair<unsigned, const char *> TargetFlags[] = {
{MO_LO16, "arm-lo16"}, {MO_HI16, "arm-hi16"}};
return makeArrayRef(TargetFlags);
}
ArrayRef<std::pair<unsigned, const char *>>
ARMInstrInfo::getSerializableBitmaskMachineOperandTargetFlags() const {
using namespace ARMII;
static const std::pair<unsigned, const char *> TargetFlags[] = {
{MO_GOT, "arm-got"},
{MO_SBREL, "arm-sbrel"},
{MO_DLLIMPORT, "arm-dllimport"},
{MO_SECREL, "arm-secrel"},
{MO_NONLAZY, "arm-nonlazy"}};
return makeArrayRef(TargetFlags);
}

View File

@ -38,13 +38,6 @@ public:
///
const ARMRegisterInfo &getRegisterInfo() const override { return RI; }
std::pair<unsigned, unsigned>
decomposeMachineOperandsTargetFlags(unsigned TF) const override;
ArrayRef<std::pair<unsigned, const char *>>
getSerializableDirectMachineOperandTargetFlags() const override;
ArrayRef<std::pair<unsigned, const char *>>
getSerializableBitmaskMachineOperandTargetFlags() const override;
private:
void expandLoadStackGuard(MachineBasicBlock::iterator MI) const override;
};