mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-21 06:30:16 +00:00
Tidy up. 80 columns.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151764 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
b9ace0215d
commit
9c826d2d3c
@ -291,7 +291,8 @@ protected:
|
|||||||
// disassembler should return SoftFail instead of Success.
|
// disassembler should return SoftFail instead of Success.
|
||||||
//
|
//
|
||||||
// This is used for marking UNPREDICTABLE instructions in the ARM world.
|
// This is used for marking UNPREDICTABLE instructions in the ARM world.
|
||||||
BitsInit *SFBits = AllInstructions[Opcode]->TheDef->getValueAsBitsInit("SoftFail");
|
BitsInit *SFBits =
|
||||||
|
AllInstructions[Opcode]->TheDef->getValueAsBitsInit("SoftFail");
|
||||||
|
|
||||||
for (unsigned i = 0; i < BitWidth; ++i) {
|
for (unsigned i = 0; i < BitWidth; ++i) {
|
||||||
if (SFBits && bitFromBits(*SFBits, i) == BIT_TRUE)
|
if (SFBits && bitFromBits(*SFBits, i) == BIT_TRUE)
|
||||||
@ -587,8 +588,9 @@ unsigned Filter::usefulness() const {
|
|||||||
void FilterChooser::emitTop(raw_ostream &o, unsigned Indentation,
|
void FilterChooser::emitTop(raw_ostream &o, unsigned Indentation,
|
||||||
std::string Namespace) {
|
std::string Namespace) {
|
||||||
o.indent(Indentation) <<
|
o.indent(Indentation) <<
|
||||||
"static MCDisassembler::DecodeStatus decode" << Namespace << "Instruction" << BitWidth
|
"static MCDisassembler::DecodeStatus decode" << Namespace << "Instruction"
|
||||||
<< "(MCInst &MI, uint" << BitWidth << "_t insn, uint64_t Address, "
|
<< BitWidth << "(MCInst &MI, uint" << BitWidth
|
||||||
|
<< "_t insn, uint64_t Address, "
|
||||||
<< "const void *Decoder, const MCSubtargetInfo &STI) {\n";
|
<< "const void *Decoder, const MCSubtargetInfo &STI) {\n";
|
||||||
o.indent(Indentation) << " unsigned tmp = 0;\n";
|
o.indent(Indentation) << " unsigned tmp = 0;\n";
|
||||||
o.indent(Indentation) << " (void)tmp;\n";
|
o.indent(Indentation) << " (void)tmp;\n";
|
||||||
@ -771,7 +773,8 @@ void FilterChooser::emitBinaryParser(raw_ostream &o, unsigned &Indentation,
|
|||||||
|
|
||||||
if (Decoder != "")
|
if (Decoder != "")
|
||||||
o.indent(Indentation) << " " << Emitter->GuardPrefix << Decoder
|
o.indent(Indentation) << " " << Emitter->GuardPrefix << Decoder
|
||||||
<< "(MI, tmp, Address, Decoder)" << Emitter->GuardPostfix << "\n";
|
<< "(MI, tmp, Address, Decoder)"
|
||||||
|
<< Emitter->GuardPostfix << "\n";
|
||||||
else
|
else
|
||||||
o.indent(Indentation) << " MI.addOperand(MCOperand::CreateImm(tmp));\n";
|
o.indent(Indentation) << " MI.addOperand(MCOperand::CreateImm(tmp));\n";
|
||||||
|
|
||||||
@ -788,7 +791,8 @@ static void emitSinglePredicateMatch(raw_ostream &o, StringRef str,
|
|||||||
|
|
||||||
bool FilterChooser::emitPredicateMatch(raw_ostream &o, unsigned &Indentation,
|
bool FilterChooser::emitPredicateMatch(raw_ostream &o, unsigned &Indentation,
|
||||||
unsigned Opc) {
|
unsigned Opc) {
|
||||||
ListInit *Predicates = AllInstructions[Opc]->TheDef->getValueAsListInit("Predicates");
|
ListInit *Predicates =
|
||||||
|
AllInstructions[Opc]->TheDef->getValueAsListInit("Predicates");
|
||||||
for (unsigned i = 0; i < Predicates->getSize(); ++i) {
|
for (unsigned i = 0; i < Predicates->getSize(); ++i) {
|
||||||
Record *Pred = Predicates->getElementAsRecord(i);
|
Record *Pred = Predicates->getElementAsRecord(i);
|
||||||
if (!Pred->getValue("AssemblerMatcherPredicate"))
|
if (!Pred->getValue("AssemblerMatcherPredicate"))
|
||||||
@ -814,8 +818,10 @@ bool FilterChooser::emitPredicateMatch(raw_ostream &o, unsigned &Indentation,
|
|||||||
return Predicates->getSize() > 0;
|
return Predicates->getSize() > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void FilterChooser::emitSoftFailCheck(raw_ostream &o, unsigned Indentation, unsigned Opc) {
|
void FilterChooser::emitSoftFailCheck(raw_ostream &o, unsigned Indentation,
|
||||||
BitsInit *SFBits = AllInstructions[Opc]->TheDef->getValueAsBitsInit("SoftFail");
|
unsigned Opc) {
|
||||||
|
BitsInit *SFBits =
|
||||||
|
AllInstructions[Opc]->TheDef->getValueAsBitsInit("SoftFail");
|
||||||
if (!SFBits) return;
|
if (!SFBits) return;
|
||||||
BitsInit *InstBits = AllInstructions[Opc]->TheDef->getValueAsBitsInit("Inst");
|
BitsInit *InstBits = AllInstructions[Opc]->TheDef->getValueAsBitsInit("Inst");
|
||||||
|
|
||||||
@ -902,15 +908,16 @@ bool FilterChooser::emitSingletonDecoder(raw_ostream &o, unsigned &Indentation,
|
|||||||
// If a custom instruction decoder was specified, use that.
|
// If a custom instruction decoder was specified, use that.
|
||||||
if (I->numFields() == 0 && I->Decoder.size()) {
|
if (I->numFields() == 0 && I->Decoder.size()) {
|
||||||
o.indent(Indentation) << " " << Emitter->GuardPrefix << I->Decoder
|
o.indent(Indentation) << " " << Emitter->GuardPrefix << I->Decoder
|
||||||
<< "(MI, insn, Address, Decoder)" << Emitter->GuardPostfix << "\n";
|
<< "(MI, insn, Address, Decoder)"
|
||||||
|
<< Emitter->GuardPostfix << "\n";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
emitBinaryParser(o, Indentation, *I);
|
emitBinaryParser(o, Indentation, *I);
|
||||||
}
|
}
|
||||||
|
|
||||||
o.indent(Indentation) << " return " << Emitter->ReturnOK << "; // " << nameWithID(Opc)
|
o.indent(Indentation) << " return " << Emitter->ReturnOK << "; // "
|
||||||
<< '\n';
|
<< nameWithID(Opc) << '\n';
|
||||||
o.indent(Indentation) << "}\n"; // Closing predicate block.
|
o.indent(Indentation) << "}\n"; // Closing predicate block.
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -952,14 +959,15 @@ bool FilterChooser::emitSingletonDecoder(raw_ostream &o, unsigned &Indentation,
|
|||||||
// If a custom instruction decoder was specified, use that.
|
// If a custom instruction decoder was specified, use that.
|
||||||
if (I->numFields() == 0 && I->Decoder.size()) {
|
if (I->numFields() == 0 && I->Decoder.size()) {
|
||||||
o.indent(Indentation) << " " << Emitter->GuardPrefix << I->Decoder
|
o.indent(Indentation) << " " << Emitter->GuardPrefix << I->Decoder
|
||||||
<< "(MI, insn, Address, Decoder)" << Emitter->GuardPostfix << "\n";
|
<< "(MI, insn, Address, Decoder)"
|
||||||
|
<< Emitter->GuardPostfix << "\n";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
emitBinaryParser(o, Indentation, *I);
|
emitBinaryParser(o, Indentation, *I);
|
||||||
}
|
}
|
||||||
o.indent(Indentation) << " return " << Emitter->ReturnOK << "; // " << nameWithID(Opc)
|
o.indent(Indentation) << " return " << Emitter->ReturnOK << "; // "
|
||||||
<< '\n';
|
<< nameWithID(Opc) << '\n';
|
||||||
o.indent(Indentation) << "}\n";
|
o.indent(Indentation) << "}\n";
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
@ -52,7 +52,8 @@ public:
|
|||||||
FixedLenDecoderEmitter(RecordKeeper &R,
|
FixedLenDecoderEmitter(RecordKeeper &R,
|
||||||
std::string PredicateNamespace,
|
std::string PredicateNamespace,
|
||||||
std::string GPrefix = "if (",
|
std::string GPrefix = "if (",
|
||||||
std::string GPostfix = " == MCDisassembler::Fail) return MCDisassembler::Fail;",
|
std::string GPostfix = " == MCDisassembler::Fail)"
|
||||||
|
" return MCDisassembler::Fail;",
|
||||||
std::string ROK = "MCDisassembler::Success",
|
std::string ROK = "MCDisassembler::Success",
|
||||||
std::string RFail = "MCDisassembler::Fail",
|
std::string RFail = "MCDisassembler::Fail",
|
||||||
std::string L = "") :
|
std::string L = "") :
|
||||||
|
Loading…
x
Reference in New Issue
Block a user