mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-27 00:21:03 +00:00
Make the FixedLengthDecoderEmitter smart enough to autogenerate decoders for encodings like "let Inst{11-7} = foo;", where the RHS has no bitwidth specifiers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136660 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -1267,8 +1267,14 @@ static bool populateInstruction(const CodeGenInstruction &CGI,
|
|||||||
unsigned Offset = 0;
|
unsigned Offset = 0;
|
||||||
|
|
||||||
for (unsigned bi = 0; bi < Bits.getNumBits(); ++bi) {
|
for (unsigned bi = 0; bi < Bits.getNumBits(); ++bi) {
|
||||||
|
VarInit *Var = 0;
|
||||||
VarBitInit *BI = dynamic_cast<VarBitInit*>(Bits.getBit(bi));
|
VarBitInit *BI = dynamic_cast<VarBitInit*>(Bits.getBit(bi));
|
||||||
if (!BI) {
|
if (BI)
|
||||||
|
Var = dynamic_cast<VarInit*>(BI->getVariable());
|
||||||
|
else
|
||||||
|
Var = dynamic_cast<VarInit*>(Bits.getBit(bi));
|
||||||
|
|
||||||
|
if (!Var) {
|
||||||
if (Base != ~0U) {
|
if (Base != ~0U) {
|
||||||
OpInfo.addField(Base, Width, Offset);
|
OpInfo.addField(Base, Width, Offset);
|
||||||
Base = ~0U;
|
Base = ~0U;
|
||||||
@@ -1278,8 +1284,6 @@ static bool populateInstruction(const CodeGenInstruction &CGI,
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
VarInit *Var = dynamic_cast<VarInit*>(BI->getVariable());
|
|
||||||
assert(Var);
|
|
||||||
if (Var->getName() != NI->second &&
|
if (Var->getName() != NI->second &&
|
||||||
Var->getName() != TiedNames[NI->second]) {
|
Var->getName() != TiedNames[NI->second]) {
|
||||||
if (Base != ~0U) {
|
if (Base != ~0U) {
|
||||||
@@ -1294,8 +1298,8 @@ static bool populateInstruction(const CodeGenInstruction &CGI,
|
|||||||
if (Base == ~0U) {
|
if (Base == ~0U) {
|
||||||
Base = bi;
|
Base = bi;
|
||||||
Width = 1;
|
Width = 1;
|
||||||
Offset = BI->getBitNum();
|
Offset = BI ? BI->getBitNum() : 0;
|
||||||
} else if (BI->getBitNum() != Offset + Width) {
|
} else if (BI && BI->getBitNum() != Offset + Width) {
|
||||||
OpInfo.addField(Base, Width, Offset);
|
OpInfo.addField(Base, Width, Offset);
|
||||||
Base = bi;
|
Base = bi;
|
||||||
Width = 1;
|
Width = 1;
|
||||||
|
Reference in New Issue
Block a user