mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-19 04:32:19 +00:00
Add back in r109901, which adds a Compare flag to the target instructions. It's
useful after all. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110531 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
a5c4cc5f34
commit
73739d0bf1
@ -198,6 +198,7 @@ class Instruction {
|
|||||||
bit isReturn = 0; // Is this instruction a return instruction?
|
bit isReturn = 0; // Is this instruction a return instruction?
|
||||||
bit isBranch = 0; // Is this instruction a branch instruction?
|
bit isBranch = 0; // Is this instruction a branch instruction?
|
||||||
bit isIndirectBranch = 0; // Is this instruction an indirect branch?
|
bit isIndirectBranch = 0; // Is this instruction an indirect branch?
|
||||||
|
bit isCompare = 0; // Is this instruction a comparison instruction?
|
||||||
bit isBarrier = 0; // Can control flow fall through this instruction?
|
bit isBarrier = 0; // Can control flow fall through this instruction?
|
||||||
bit isCall = 0; // Is this instruction a call instruction?
|
bit isCall = 0; // Is this instruction a call instruction?
|
||||||
bit canFoldAsLoad = 0; // Can this be folded as a simple memory operand?
|
bit canFoldAsLoad = 0; // Can this be folded as a simple memory operand?
|
||||||
|
@ -105,6 +105,7 @@ namespace TID {
|
|||||||
IndirectBranch,
|
IndirectBranch,
|
||||||
Predicable,
|
Predicable,
|
||||||
NotDuplicable,
|
NotDuplicable,
|
||||||
|
Compare,
|
||||||
DelaySlot,
|
DelaySlot,
|
||||||
FoldableAsLoad,
|
FoldableAsLoad,
|
||||||
MayLoad,
|
MayLoad,
|
||||||
@ -315,7 +316,7 @@ public:
|
|||||||
bool isIndirectBranch() const {
|
bool isIndirectBranch() const {
|
||||||
return Flags & (1 << TID::IndirectBranch);
|
return Flags & (1 << TID::IndirectBranch);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// isConditionalBranch - Return true if this is a branch which may fall
|
/// isConditionalBranch - Return true if this is a branch which may fall
|
||||||
/// through to the next instruction or may transfer control flow to some other
|
/// through to the next instruction or may transfer control flow to some other
|
||||||
/// block. The TargetInstrInfo::AnalyzeBranch method can be used to get more
|
/// block. The TargetInstrInfo::AnalyzeBranch method can be used to get more
|
||||||
@ -340,6 +341,11 @@ public:
|
|||||||
return Flags & (1 << TID::Predicable);
|
return Flags & (1 << TID::Predicable);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// isCompare - Return true if this instruction is a comparison.
|
||||||
|
bool isCompare() const {
|
||||||
|
return Flags & (1 << TID::Compare);
|
||||||
|
}
|
||||||
|
|
||||||
/// isNotDuplicable - Return true if this instruction cannot be safely
|
/// isNotDuplicable - Return true if this instruction cannot be safely
|
||||||
/// duplicated. For example, if the instruction has a unique labels attached
|
/// duplicated. For example, if the instruction has a unique labels attached
|
||||||
/// to it, duplicating it would cause multiple definition errors.
|
/// to it, duplicating it would cause multiple definition errors.
|
||||||
|
@ -102,6 +102,7 @@ CodeGenInstruction::CodeGenInstruction(Record *R, const std::string &AsmStr)
|
|||||||
isReturn = R->getValueAsBit("isReturn");
|
isReturn = R->getValueAsBit("isReturn");
|
||||||
isBranch = R->getValueAsBit("isBranch");
|
isBranch = R->getValueAsBit("isBranch");
|
||||||
isIndirectBranch = R->getValueAsBit("isIndirectBranch");
|
isIndirectBranch = R->getValueAsBit("isIndirectBranch");
|
||||||
|
isCompare = R->getValueAsBit("isCompare");
|
||||||
isBarrier = R->getValueAsBit("isBarrier");
|
isBarrier = R->getValueAsBit("isBarrier");
|
||||||
isCall = R->getValueAsBit("isCall");
|
isCall = R->getValueAsBit("isCall");
|
||||||
canFoldAsLoad = R->getValueAsBit("canFoldAsLoad");
|
canFoldAsLoad = R->getValueAsBit("canFoldAsLoad");
|
||||||
|
@ -123,6 +123,7 @@ namespace llvm {
|
|||||||
bool isReturn;
|
bool isReturn;
|
||||||
bool isBranch;
|
bool isBranch;
|
||||||
bool isIndirectBranch;
|
bool isIndirectBranch;
|
||||||
|
bool isCompare;
|
||||||
bool isBarrier;
|
bool isBarrier;
|
||||||
bool isCall;
|
bool isCall;
|
||||||
bool canFoldAsLoad;
|
bool canFoldAsLoad;
|
||||||
|
@ -270,6 +270,7 @@ void InstrInfoEmitter::emitRecord(const CodeGenInstruction &Inst, unsigned Num,
|
|||||||
if (Inst.isReturn) OS << "|(1<<TID::Return)";
|
if (Inst.isReturn) OS << "|(1<<TID::Return)";
|
||||||
if (Inst.isBranch) OS << "|(1<<TID::Branch)";
|
if (Inst.isBranch) OS << "|(1<<TID::Branch)";
|
||||||
if (Inst.isIndirectBranch) OS << "|(1<<TID::IndirectBranch)";
|
if (Inst.isIndirectBranch) OS << "|(1<<TID::IndirectBranch)";
|
||||||
|
if (Inst.isCompare) OS << "|(1<<TID::Compare)";
|
||||||
if (Inst.isBarrier) OS << "|(1<<TID::Barrier)";
|
if (Inst.isBarrier) OS << "|(1<<TID::Barrier)";
|
||||||
if (Inst.hasDelaySlot) OS << "|(1<<TID::DelaySlot)";
|
if (Inst.hasDelaySlot) OS << "|(1<<TID::DelaySlot)";
|
||||||
if (Inst.isCall) OS << "|(1<<TID::Call)";
|
if (Inst.isCall) OS << "|(1<<TID::Call)";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user